public void Insert_LK(string LK_Name, string LK_Number, string LK_Producer, string LK_Price) { sql = @"Insert into Inf_LK (LK_Id, LK_Name, LK_Number, LK_Producer, LK_Price, LK_Time_Add) VALUES(N'LK" + day + "" + Min + "" + sec + @"',N'" + LK_Name + @"',N'" + LK_Number + @"', N'" + LK_Producer + @"', N'" + LK_Price + @"', N'" + time + @"')"; db.ExecuteNonQuery(sql); time = DateTime.Now.ToString("dd/MM/yyyy"); day = DateTime.Now.ToString("dd"); Min = DateTime.Now.ToString("mm"); sec = DateTime.Now.ToString("ss"); }
public void Insert_NV(string Staff_Name, string Staff_Sex, string Staff_Birth, string Staff_Address, string Staff_Phone, string Staff_Department) { if (Staff_Sex == "Nam") { Sex = "1"; } else { Sex = "2"; } if (Staff_Department == "Quản Lý") { PhongBan = "1"; } else if (Staff_Department == "Kỹ Thuật") { PhongBan = "2"; } else { PhongBan = "3"; } sql = @"Insert into Inf_Staff (Staff_Id, Staff_Name, Staff_Sex, Staff_Birth, Staff_Address, Staff_Phone, Staff_Deparment, Staff_TimeAdd) VALUES(N'NV" + day + "" + Min + "" + sec + "" + @"',N'" + Staff_Name + @"',N'" + Sex + @"', N'" + Staff_Birth + @"', N'" + Staff_Address + @"', N'" + Staff_Phone + @"' , N'" + PhongBan + @"' , N'" + time + @"')"; db.ExecuteNonQuery(sql); sql = @"Insert into Account_Staff(Staff_Id, Staff_Account, Staff_Password, Staff_Role) VALUES (N'NV" + day + "" + Min + "" + sec + "" + @"', N'NV" + day + "" + Min + "" + sec + "" + @"', 1, N'" + PhongBan + @"')"; db.ExecuteNonQuery(sql); sql = @"Insert into Salary_Staff(Staff_Id, Staff_Default_Salary, Staff_Salary_Per_Hour, Staff_OT, Staff_Reward) VALUES (N'NV" + day + "" + Min + "" + sec + "" + @"',0, 0, 0, 0)"; db.ExecuteNonQuery(sql); time = DateTime.Now.ToString("dd/MM/yyyy"); day = DateTime.Now.ToString("dd"); Min = DateTime.Now.ToString("mm"); sec = DateTime.Now.ToString("ss"); }
public void Insert_KH(string Customer_Name, string Customer_Sex, string Customer_Birth, string Customer_Email, string Customer_Phone) { if (Customer_Sex == "Nam") { Sex = "1"; } else { Sex = "2"; } sql = @"Insert into Inf_Customers (Customer_Id, Customer_Name, Customer_Sex, Customer_Birth, Customer_Email, Customer_Phone, Customer_TimeAdd) VALUES(N'KH" + day + "" + Min + "" + sec + "" + @"',N'" + Customer_Name + @"',N'" + Sex + @"', N'" + Customer_Birth + "',N'" + Customer_Email + @"',N'" + Customer_Phone + @"', N'" + time + @"')"; db.ExecuteNonQuery(sql); sql = @"Insert into Inf_Repair (Repair_Id, Customer_Id, Laptop_Name, Laptop_Status, Staff_Id) VALUES(N'RP" + day + "" + Min + "" + sec + "" + @"',N'KH" + day + "" + Min + "" + sec + "" + @"', N'Chưa biết', N'Chưa biết', N'Chưa biết')"; db.ExecuteNonQuery(sql); sql = @"Insert into Detail_Inf_Repair (Repair_Id, Repair_Reason, Repair_Note, Repair_Appointment, Repair_Money) VALUES(N'RP" + day + "" + Min + "" + sec + "" + @"', N'Chưa biết', N'Sửa lấy ngay', '09/05/2000', 0)"; db.ExecuteNonQuery(sql); time = DateTime.Now.ToString("yyyy/MM/dd"); day = DateTime.Now.ToString("dd"); Min = DateTime.Now.ToString("mm"); sec = DateTime.Now.ToString("ss"); }