Пример #1
0
 public bool AddPhanLoaiPhong(PhanLoaiPhongObj plobj)
 {
     cmd.CommandText = "Insert into PhanLoaiPhong values ('" + plobj.MaPL + "',N'" + plobj.TenLoaiPhong + "',N'" + plobj.TrangBi + "')";
     cmd.CommandType = CommandType.Text;
     cmd.Connection  = con.strConn;
     try
     {
         con.OpenConnect();
         cmd.ExecuteNonQuery();
         con.CloseConnection();
         return(true);
     }
     catch (Exception ex)
     {
         string mes = ex.Message;
         cmd.Dispose();
         con.CloseConnection();
     }
     return(true);
 }
Пример #2
0
 public bool UpdatePhanLoaiPhong(PhanLoaiPhongObj plobj)
 {
     cmd.CommandText = " update PhanLoaiPhong set TenLoaiPhong=N'" + plobj.TenLoaiPhong + "',TrangBi=N'" + plobj.TrangBi + "' where MaPL='" + plobj.MaPL + "'";
     cmd.CommandType = CommandType.Text;
     cmd.Connection  = con.strConn;
     try
     {
         con.OpenConnect();
         cmd.ExecuteNonQuery();
         con.CloseConnection();
         return(true);
     }
     catch (Exception ex)
     {
         string mes = ex.Message;
         cmd.Dispose();
         con.CloseConnection();
     }
     return(true);
 }
Пример #3
0
 private void GanDuLieu(PhanLoaiPhongObj pl1obj)
 {
     pl1obj.MaPL         = txtMaPL.Text.ToString().Trim();
     pl1obj.TenLoaiPhong = txtTenLP.Text.ToString().Trim();
     pl1obj.TrangBi      = txtTrangBi.Text.ToString().Trim();
 }