public bool UpdData(DungLuongObj dlObj) { cmd.CommandText = "UPDATE DUNGLUONG SET TENDL = N'" + dlObj.TenDl + "' WHERE MADL = '" + dlObj.MaDl + "'"; cmd.CommandType = CommandType.Text; cmd.Connection = con.Connection; try { con.OpenConn(); cmd.ExecuteNonQuery(); con.CloseConn(); return(true); } catch (Exception ex) { string mex = ex.Message; cmd.Dispose(); con.CloseConn(); } return(false); }
public bool AddData(DungLuongObj dlObj) { cmd.CommandText = "INSERT INTO DUNGLUONG VALUES ('" + dlObj.MaDl + "', N'" + dlObj.TenDl + "')"; cmd.CommandType = CommandType.Text; cmd.Connection = con.Connection; try { con.OpenConn(); cmd.ExecuteNonQuery(); con.CloseConn(); return(true); } catch (Exception ex) { string mex = ex.Message; cmd.Dispose(); con.CloseConn(); } return(false); }
public bool updData(DungLuongObj dlObj) { return(dlMod.UpdData(dlObj)); }
private void addData(DungLuongObj dl) { dl.MaDl = txtmadl.Text.Trim(); dl.TenDl = txttendl.Text.Trim(); }
public bool addData(DungLuongObj dlObj) { return(dlMod.AddData(dlObj)); }