public bool UpdateData(NhapXeObj nhapxObj) { cmd.CommandText = string.Format("UPDATE tblNhap SET MANHAP = '{0}', MANV = '{1}', MANHACC = '{2}', NGAYNHAP = CONVERT(date, '{3}', 103) WHERE (MANHAP = '{0}')", nhapxObj.MaNhap, nhapxObj.MaNV, nhapxObj.MaNhaCC, nhapxObj.NgayNhap); 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(NhapXeObj nhapxObj) { cmd.CommandText = string.Format("INSERT INTO tblNhap (MANHAP, MANV, MANHACC, NGAYNHAP) VALUES ('{0}', '{1}', '{2}', CONVERT(date, '{3}', 103))", nhapxObj.MaNhap, nhapxObj.MaNV, nhapxObj.MaNhaCC, nhapxObj.NgayNhap); 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(NhapXeObj nhapxObj) { return(nhapxmod.UpdateData(nhapxObj)); }
public bool addData(NhapXeObj nhapxObj) { return(nhapxmod.AddData(nhapxObj)); }