Пример #1
0
 public bool Insert(VehicleRep vr)
 {
     try
     {
         string query = "INSERT into Vehicle VALUES ('" + vr.CarID + "', '" + vr.Category + "', '" + vr.ModelName + "','" + vr.Date + "','" + vr.Engine + "','" + vr.Color + "','" + vr.Cost + "','" + vr.Seat + "' )";
         DatabaseConnectionClass dcc = new DatabaseConnectionClass();
         dcc.ConnectWithDB();
         int x = dcc.ExecuteSQL(query);
         dcc.CloseConnection();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
 public bool Insert(SalesRep sr)
 {
     try
     {
         string query = "INSERT into Sales VALUES ('" + sr.SalesID + "', '" + sr.CustName + "', '" + sr.CustAddress + "', '" + sr.CustContacts + "', '" + sr.CustMail + "', '" + sr.VecModel + "', '" + sr.VecNetCost + "','" + sr.Payment + "','" + sr.Date + "','" + sr.SalesInvoice + "')";
         DatabaseConnectionClass dcc = new DatabaseConnectionClass();
         dcc.ConnectWithDB();
         int x = dcc.ExecuteSQL(query);
         dcc.CloseConnection();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
 public bool Insert(EmployeeRep emp)
 {
     try
     {
         string query = "INSERT into Employee VALUES ('" + emp.Employeeid + "', '" + emp.Employeename + "', '" + emp.Gender + "', '" + emp.Address + "', '" + emp.Email + "', '" + emp.Contacts + "', '" + emp.Status + "','" + emp.Password + "','" + emp.Salary + "')";
         DatabaseConnectionClass dcc = new DatabaseConnectionClass();
         dcc.ConnectWithDB();
         int x = dcc.ExecuteSQL(query);
         dcc.CloseConnection();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Пример #4
0
 public bool Insert(ManufacturerRep mr)
 {
     try
     {
         string query = "INSERT into Manufacturer VALUES ('" + mr.Id + "', '" + mr.Name + "', '" + mr.Address + "', '" + mr.Email + "', '" + mr.Contacts + "', '" + mr.Status + "')";
         DatabaseConnectionClass dcc = new DatabaseConnectionClass();
         dcc.ConnectWithDB();
         int x = dcc.ExecuteSQL(query);
         dcc.CloseConnection();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
 public bool Delete(string seniorEmployeeID)
 {
     try
     {
         string query = "DELETE from SeniorEmployee WHERE Id = '" + seniorEmployeeID + "'";
         DatabaseConnectionClass dcc = new DatabaseConnectionClass();
         dcc.ConnectWithDB();
         int x = dcc.ExecuteSQL(query);
         dcc.CloseConnection();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
 public bool Update(SeniorEmployeeRep se)
 {
     try
     {
         string query = "UPDATE SeniorEmployee SET Name = '" + se.SeniorEmployeename + "', Gender = " + se.Gender + ", Address = '" + se.SeniorEmployeeaddress + "', Email = '" + se.Email + "', Contacts = '" + se.Contacts + "', Status = '" + se.Status + "', Password = '******', Salary = '" + se.Salary + "' WHERE Id= '" + se.SeniorEmployeeid + "'";
         DatabaseConnectionClass dcc = new DatabaseConnectionClass();
         dcc.ConnectWithDB();
         int x = dcc.ExecuteSQL(query);
         dcc.CloseConnection();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Пример #7
0
 public bool Insert(ClientRep cr)
 {
     try
     {
         string query = "INSERT into Client VALUES ('" + cr.Id + "', '" + cr.Name + "', '" + cr.Gender + "', '" + cr.Address + "', '" + cr.Email + "', '" + cr.Contacts + "', '" + cr.Password + "','" + cr.Occupation + "','" + cr.AddedBy + "')";
         DatabaseConnectionClass dcc = new DatabaseConnectionClass();
         dcc.ConnectWithDB();
         int x = dcc.ExecuteSQL(query);
         dcc.CloseConnection();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }