public bool UpdateData(ChiTietNhapPhuTungObj CTNhapPTObj) { cmd.CommandText = string.Format("UPDATE tblChiTietNhapPhuTung SET MACTNPT = '{0}', MANPT = '{1}', MATTPT = '{2}', DONGIANHAP = {3}, SOLUONG = {4} WHERE (MACTNPT = '{0}')", CTNhapPTObj.MaCTNhapPT, CTNhapPTObj.MaNhapPT, CTNhapPTObj.MaTTPT, CTNhapPTObj.DonGiaNhap, CTNhapPTObj.SoLuong); 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(ChiTietNhapPhuTungObj CTNhapPTObj) { cmd.CommandText = string.Format("INSERT INTO tblChiTietNhapPhuTung (MACTNPT, MANPT, MATTPT, DONGIANHAP, SOLUONG) VALUES ('{0}', '{1}', '{2}', {3}, {4})", CTNhapPTObj.MaCTNhapPT, CTNhapPTObj.MaNhapPT, CTNhapPTObj.MaTTPT, CTNhapPTObj.DonGiaNhap, CTNhapPTObj.SoLuong); 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(ChiTietNhapPhuTungObj CTNhapPTObj) { return(CTNhapPTMod.UpdateData(CTNhapPTObj)); }
public bool addData(ChiTietNhapPhuTungObj CTNhapPTObj) { return(CTNhapPTMod.AddData(CTNhapPTObj)); }