Exemplo n.º 1
0
 public bool them_ThietBiphong(THIETBI_PHONG tb)
 {
     try
     {
         data.THIETBI_PHONGs.InsertOnSubmit(tb);
         data.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 2
0
        //Xóa

        public bool xoa_ThietBiphong(string pMaTB, string pmaphong)
        {
            try
            {
                THIETBI_PHONG tb = data.THIETBI_PHONGs.Where(t => t.MATHIETBI == pMaTB && t.MAPHONG == pmaphong).FirstOrDefault();
                data.THIETBI_PHONGs.DeleteOnSubmit(tb);
                data.SubmitChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        public bool sua_ThietBiphong(THIETBI_PHONG pThietBi)
        {
            try
            {
                THIETBI_PHONG nv = data.THIETBI_PHONGs.Where(t => t.MATHIETBI == pThietBi.MATHIETBI && t.MAPHONG == pThietBi.MAPHONG).FirstOrDefault();
                if (nv != null)
                {
                    nv.TRANGTHAI = pThietBi.TRANGTHAI;

                    data.SubmitChanges();
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemplo n.º 4
0
 //Thêm
 public bool them_ThietBiphong(THIETBI_PHONG pThietBi)
 {
     return(thietbi.them_ThietBiphong(pThietBi));
 }
Exemplo n.º 5
0
 //Sửa
 public bool sua_ThietBiphong(THIETBI_PHONG pThietBi)
 {
     return(thietbi.sua_ThietBiphong(pThietBi));
 }