示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
 public bool updData(DungLuongObj dlObj)
 {
     return(dlMod.UpdData(dlObj));
 }
示例#4
0
 private void addData(DungLuongObj dl)
 {
     dl.MaDl  = txtmadl.Text.Trim();
     dl.TenDl = txttendl.Text.Trim();
 }
示例#5
0
 public bool addData(DungLuongObj dlObj)
 {
     return(dlMod.AddData(dlObj));
 }