Esempio n. 1
0
 public ActionResult CapNhatTrangThai(int maHoSo, int trangThaiId, DateTime date)
 {
     using (var _thuyenChuyen = new ThuyenChuyenRepository())
     {
         ThuyenChuyen thuyenChuyen = _thuyenChuyen.GetThuyenChuyensById(maHoSo);
         if (thuyenChuyen == null)
         {
             return(Json(new ReturnResult(400, "failed", null), JsonRequestBehavior.AllowGet));
         }
         using (var _trangthai = new TrangThaiHoSoService())
         {
             string trangthai = _trangthai.GetStatusThuyenChuyensById(trangThaiId).Name;
             _thuyenChuyen.CapNhatTrangThaiHoSo(thuyenChuyen, trangThaiId);
             return(Json(new ReturnResult(200, trangthai, null), JsonRequestBehavior.AllowGet));
         }
     }
 }
Esempio n. 2
0
        public async Task <ActionResult> DownloadThuyenChuyenNgoaiTinh(int statusId, int year)
        {
            Account account = (Account)Session[Utils.Constants.USER_SESSION];

            if (account == null)
            {
                return(RedirectToRoute("login"));
            }
            using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
            {
                List <ThuyenChuyenNgoaiTinh> thuyenChuyens = _thuyenChuyenService.GetThuyenChuyenByStatusAndDvqlAndYear(statusId, account.DvqlId, year);
                string filePath = System.Web.HttpContext.Current.Server.MapPath("~/Utils/ds-thuyenchuyenngoaitinh.xlsx");
                using (var _statusThuyenChuyen = new TrangThaiHoSoService())
                {
                    StatusThuyenChuyen statusThuyenChuyen = _statusThuyenChuyen.GetStatusThuyenChuyensById(statusId);
                    await Utils.ExportExcel.GenerateXLSThuyenChuyenNgoaiTinh(thuyenChuyens, filePath, statusThuyenChuyen.Name);

                    return(File(filePath, "application/vnd.ms-excel", "ds-thuyenchuyenngoaitinh.xlsx"));
                }
            }
        }