-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfinancialManager.cs
59 lines (55 loc) · 2.04 KB
/
financialManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
namespace TMSooad
{
class financialManager
{
//-----Creating Property ----
public string cname;
public string company;
public int amount;
public string mehodPayment;
private string connectionstring;
//-----Creating Constructor With same name as Financial Manager Class
public financialManager()
{
}
//-----Creating Constructor With same name as Financial Manager Class and one parameter
public financialManager(string connectionstring)
{
this.connectionstring = connectionstring;
}
//---Creating Customize Constructor ---
//public financialManager(string cn, string compan, int a, string paymentBy)
//{
// cname = cn;
// company = compan;
// amount = a;
// mehodPayment = paymentBy;
//}
//----Creating method of void method is paymentMethod-----
public void SavaUserPayment()
{
//------Sql Query of Insert----------
using (SqlConnection connection = new SqlConnection(connectionstring))
{
string query = "INSERT INTO Fmanger (customerName,companyName,amount,paymentMethod) VALUES (@customerName, @companyName, @amount, @payment)";
SqlCommand command = new SqlCommand(query, connection);
command.Parameters.AddWithValue("@customerName", cname);
command.Parameters.AddWithValue("@companyName", company);
command.Parameters.AddWithValue("@amount", amount);
command.Parameters.AddWithValue("@payment", mehodPayment);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
}
}
public void clearData()
{
}
}
}