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); }
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); }
public bool updateData(PhuTungObj PTObj) { return(PTMod.UpdateData(PTObj)); }
public bool addData(PhuTungObj PTObj) { return(PTMod.AddData(PTObj)); }