public IActionResult AddDuAn(DuAnDTO duAnDTO)
        {
            (List <DuAnDTO> duAnDTOs, ThongTinDuLieuCuoi thongTinDuLieuCuois, DuAnDTO duAnDTO)objs;
            objs = new(duAnSv.GetList(), thongTinDuLieuCuoiAc.FindById("1"), duAnSv.FindById("da00001"));
            duAnDTO.PhanTramDuAn = 100;
            duAnDTO.TrangThai    = 1;
            DateTime dt = DateTime.Now;

            if (dt.Date > duAnDTO.NgayBatDau)
            {
                ViewBag.Error = "Ngày bắt đầu dự án phải lớn hơn ngày hiện tại!";
                return(View("Index", objs));
            }
            if ((int)((DateTime)duAnDTO.NgayKetThuc - (DateTime)duAnDTO.NgayBatDau).Days < 15)
            {
                ViewBag.Error = "Ngày kết thúc dự án phải sau ngày bắt đầu 15 ngày!";
                return(View("Index", objs));
            }
            string messerror = duAnSv.AddDuAn(duAnDTO);

            ViewBag.error = "Add " + messerror;
            if (messerror == null)
            {
                ThongTinDuLieuCuoi t = thongTinDuLieuCuoiAc.FindById("1");
                t.DuAnId = duAnDTO.DuAnId;
                thongTinDuLieuCuoiAc.Update(t);
            }
            return(RedirectToAction(actionName: "Index", controllerName: "DuAn"));
        }
Exemple #2
0
        public IActionResult AddPB(PhongBanDTO phongBanDTO)
        {
            string messerror = phongBanSv.AddPhongBan(phongBanDTO);

            ViewBag.error = "Add " + messerror;
            if (messerror == null)
            {
                ThongTinDuLieuCuoi t = thongTinDuLieuCuoiAc.FindById("1");
                t.PhongBanId = phongBanDTO.PhongBanId;
                thongTinDuLieuCuoiAc.Update(t);
            }
            return(RedirectToAction(actionName: "Index", controllerName: "PhongBan"));
        }
Exemple #3
0
        public IActionResult AddPhuCap(PhuCapDTO phuCapDTO)
        {
            phuCapDTO.TrangThai = 1;
            string messerror = phuCapSv.AddPhuCap(phuCapDTO);

            ViewBag.error = "Add " + messerror;
            if (messerror == null)
            {
                ThongTinDuLieuCuoi t = thongTinDuLieuCuoiAc.FindById("1");
                t.PhuCapId = phuCapDTO.PhuCapId;
                thongTinDuLieuCuoiAc.Update(t);
            }
            return(RedirectToAction(actionName: "Index", controllerName: "Phucap"));
        }