Beispiel #1
0
        protected void btThem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(curentId))
            {
                // eidt
                Guid        id       = Guid.Parse(curentId);
                TblVanPhong updatevp = VanPhongBussiness.GwtVanPhongById(id);
                if (updatevp != null)
                {
                    // updatevp.Email = txtEmail.Text;

                    updatevp.TenVanPhong  = txtTenVanPhong.Text;
                    updatevp.NguoiCapNhat = txtNguoiTao.Text;
                    updatevp.NgayCapNhat  = DateTime.Now;
                    updatevp = VanPhongBussiness.UpdateVanPhong(updatevp);
                }
            }

            else
            {
                TblVanPhong vp = new TblVanPhong();
                vp.Id          = Guid.NewGuid();
                vp.TenVanPhong = txtTenVanPhong.Text;
                vp.NgayTao     = DateTime.Now;
                vp.NguoiTao    = txtNguoiTao.Text;
                if (cbTrangThai.Checked)
                {
                    vp.TrangThai = true;
                }
                vp = VanPhongBussiness.InsertVanPhong(vp);
            }
            Response.Redirect("VanPhongView.aspx");
        }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(curentId))
         {
             TblVanPhong vp = VanPhongBussiness.GwtVanPhongById(curentId);
             if (vp != null)
             {
                 txtTenVanPhong.Text = vp.TenVanPhong;
                 txtNguoiTao.Text    = vp.NguoiTao;
                 cbTrangThai.Checked = vp.TrangThai;
             }
         }
         else
         {
         }
     }
 }
Beispiel #3
0
 public static TblVanPhong UpdateVanPhong(TblVanPhong item)
 {
     return(new TblVanPhongController().Update(item));
 }
Beispiel #4
0
 public static TblVanPhong InsertVanPhong(TblVanPhong item)
 {
     return(new TblVanPhongController().Insert(item));
 }