Example #1
0
 public bool UpdateData(PhuTungObj PTObj)
 {
     cmd.CommandText = string.Format("UPDATE tblePhuTung SET MAPT = '{0}', MACTNPT = '{1}', DONGIABAN = {2} WHERE (MAPT = '{0}')", PTObj.MaPT, PTObj.MaCTNhapPT, PTObj.DonGiaBan);
     cmd.CommandType = CommandType.Text;
     cmd.Connection  = con.Connection;
     try
     {
         con.openCon();
         cmd.ExecuteNonQuery();
         con.closeCon();
         return(true);
     }
     catch (Exception ex)
     {
         string mes = ex.Message;
         cmd.Dispose();
         con.closeCon();
     }
     return(false);
 }
Example #2
0
 public bool AddData(PhuTungObj PTObj)
 {
     cmd.CommandText = string.Format("INSERT INTO tblePhuTung (MAPT, MACTNPT, DONGIABAN) VALUES ('{0}', '{1}', {2})", PTObj.MaPT, PTObj.MaCTNhapPT, PTObj.DonGiaBan);
     cmd.CommandType = CommandType.Text;
     cmd.Connection  = con.Connection;
     try
     {
         con.openCon();
         cmd.ExecuteNonQuery();
         con.closeCon();
         return(true);
     }
     catch (Exception ex)
     {
         string mes = ex.Message;
         cmd.Dispose();
         con.closeCon();
     }
     return(false);
 }
Example #3
0
 public bool updateData(PhuTungObj PTObj)
 {
     return(PTMod.UpdateData(PTObj));
 }
Example #4
0
 public bool addData(PhuTungObj PTObj)
 {
     return(PTMod.AddData(PTObj));
 }