Example #1
0
        public ActionResult AddNew(TaiKhoan obj)
        {
            if (obj.TaiKhoan1 != null && obj.MatKhau != null)
            {
                int id = dao.AddNew(obj);

                if (id != -1)
                {
                    return(RedirectToAction("Index", "TaiKhoan"));
                }
                else
                {
                    ViewBag.Message("Them moi khong thanh cong");
                    return(RedirectToAction("AddNew", "TaiKhoan"));
                }
            }
            else
            {
                ModelState.AddModelError("", "Bạn phải nhập vào trường này");
            }
            LoaiTaiKhoanDAO tkdao = new LoaiTaiKhoanDAO();
            var             ltk   = tkdao.ListOf();

            ViewBag.ltk = ltk;

            return(View());
        }
Example #2
0
        public JsonResult GetListLoaiTaikhoan()
        {
            var dao    = new LoaiTaiKhoanDAO();
            var result = dao.GetListLoaiTK();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Example #3
0
 public static bool ThemLoaiTaiKhoan(LoaiTaiKhoanDTO loaiTaiKhoan, List <ChucNang_LoaiTaiKhoanDTO> lsChucNang_LoaiTaiKhoan)
 {
     if (LoaiTaiKhoanDAO.ThemLoaiTaiKhoan(loaiTaiKhoan))
     {
         return(ChucNang_LoaiTaiKhoanBUS.ThemChucNang_LoaiTaiKhoan(lsChucNang_LoaiTaiKhoan));
     }
     return(false);
 }
Example #4
0
 public static bool KhoiPhucLoaiTaiKhoan(int maLoaiTaiKhoan)
 {
     if (LoaiTaiKhoanDAO.KhoiPhucLoaiTaiKhoan(maLoaiTaiKhoan))
     {
         return(TaiKhoanDAO.KhoiPhucTaiKhoanTheoLoai(maLoaiTaiKhoan));
     }
     return(false);
 }
Example #5
0
 public static bool SuaLoaiTaiKhoan(LoaiTaiKhoanDTO loaiTaiKhoan, List <ChucNang_LoaiTaiKhoanDTO> lsChucNang_LoaiTaiKhoan)
 {
     if (ChucNang_LoaiTaiKhoanBUS.SuaChucNang_LoaiTaiKhoan(loaiTaiKhoan.MaLoaiTaiKhoan, lsChucNang_LoaiTaiKhoan))
     {
         return(LoaiTaiKhoanDAO.SuaLoaiTaiKhoan(loaiTaiKhoan));
     }
     return(false);
 }
Example #6
0
        public ActionResult AddNew()
        {
            LoaiTaiKhoanDAO tkdao = new LoaiTaiKhoanDAO();
            var             ltk   = tkdao.ListOf();

            ViewBag.ltk = ltk;

            return(View());
        }
Example #7
0
        public ActionResult Update(int id)
        {
            LoaiTaiKhoanDAO tkdao = new LoaiTaiKhoanDAO();
            var             ltk   = tkdao.ListOf();

            ViewBag.ltk = ltk;
            var up = dao.Detail(id);

            return(View(up));
        }
Example #8
0
 public static bool XoaLoaiTaiKhoan(int maLoaiTaiKhoan)
 {
     if (TaiKhoanBUS.XoaTaiKhoanTheoLoai(maLoaiTaiKhoan))
     {
         //if (ChucNang_LoaiTaiKhoanBUS.XoaChucNang_LoaiTaiKhoan(maLoaiTaiKhoan))
         //{
         return(LoaiTaiKhoanDAO.XoaLoaiTaiKhoan(maLoaiTaiKhoan));
         //}
     }
     return(false);
 }
Example #9
0
        public JsonResult Delete(string id)
        {
            var  dao   = new LoaiTaiKhoanDAO();
            bool value = dao.Delete(id);

            if (value)
            {
                SetAlert("Xóa thành công", "success");
            }
            else
            {
                SetAlert("Không thể xóa nhóm quyền", "warning");
            }
            return(Json(value, JsonRequestBehavior.AllowGet));
        }
Example #10
0
        public ActionResult SaveData(LoaitaiKhoanModel sp)
        {
            int  result = 0;
            bool kq     = false;

            if (ModelState.IsValid)
            {
                var    dao  = new LoaiTaiKhoanDAO();
                string user = ((UserLogin)Session[CommonStants.USER_SESSION]).userName;

                result = dao.SaveData(sp, user);
                if (result == 1)
                {
                    kq = true;
                }
                else if (result == 2)
                {
                    kq = true;
                }
            }
            return(Json(kq, JsonRequestBehavior.AllowGet));
        }
Example #11
0
        public List <LoaiTaiKhoanDTO> DanhSachLoaiTK()
        {
            LoaiTaiKhoanDAO b = new LoaiTaiKhoanDAO();

            return(b.dsloaiND());
        }
Example #12
0
        public JsonResult GetListLoaiTaikhoanByID(string ID)
        {
            var value = new LoaiTaiKhoanDAO().GetListLoaiTaikhoanByID(ID);

            return(Json(value, JsonRequestBehavior.AllowGet));
        }
Example #13
0
 static LoaiTaiKhoanBUS()
 {
     db = new LoaiTaiKhoanDAO();
 }
Example #14
0
        public void getallTypeUser(long?selectedId = null)
        {
            var dao = new LoaiTaiKhoanDAO();

            ViewBag.IDLOAITAIKHOAN = new SelectList(dao.GetListLoaiTK(), "IDLOAITAIKHOAN", "TENLOAITAIKHOAN", selectedId);
        }
Example #15
0
 public static int LayMaLoaiTaiKhoanMoiNhat()
 {
     return(LoaiTaiKhoanDAO.LayMaLoaiTaiKhoanMoiNhat());
 }
Example #16
0
 public static List <LoaiTaiKhoanDTO> LayDanhSachLoaiTaiKhoan(string timKiem = "", bool trangThai = true)
 {
     return(LoaiTaiKhoanDAO.LayDanhSachLoaiTaiKhoan(timKiem, trangThai));
 }
Example #17
0
 public static List <LoaiTaiKhoanDTO> LayDanhSachTatCaLoaiTaiKhoan()
 {
     return(LoaiTaiKhoanDAO.LayDanhSachTatCaLoaiTaiKhoan());
 }
Example #18
0
        public bool CapNhatDSLoaiTK(LoaiTaiKhoanDTO loai)
        {
            LoaiTaiKhoanDAO a = new LoaiTaiKhoanDAO();

            return(a.CapNhatDSLoaiTK(loai));
        }