Example #1
0
        public ActionResult DisplayInfo(string t, string p)
        {
            IdxInfoSearchModels infoList = new IdxInfoSearchModels();
            if (!StringUtils.IsEmpty(t))
            {
                infoList.infoTypeCode = StringUtils.base64Decode(t);
            }
            int pageIndex = 0;
            if (Int32.TryParse(p, out pageIndex))
            {
                infoList.pageIndex = pageIndex;
            }
            else
            {
                infoList.pageIndex = 0;
            }

            MstInfoTypeDAO infoTypeDAO = new MstInfoTypeDAO(this.mapper);
            IList<MstInfoTypeModels> infoTypeModelsList = infoTypeDAO.GeInfoType(infoList.infoTypeCode, null);
            if (infoTypeModelsList == null || infoTypeModelsList.Count == 0)
            {
                infoList.errorMessage = Resource.MsgErrNoDataFound;
                return View(infoList);
            }

            infoList.infoTypeName = infoTypeModelsList[0].infoTypeName;

            IdxInfoDAO infoDAO = new IdxInfoDAO(this.mapper);
            infoList = infoDAO.searchIdxInfo(infoList);
            return View(infoList);
        }
Example #2
0
 public ActionResult Search(IdxInfoSearchModels infoList)
 {
     MstInfoTypeModels allType = new MstInfoTypeModels();
     infoList.infoTypeList = this.initTypeList();
     infoList.infoTypeList.Insert(0, allType);
     IdxInfoDAO infoDAO = new IdxInfoDAO(this.mapper);
     infoList = infoDAO.searchIdxInfo(infoList);
     return View("Index", infoList);
 }
Example #3
0
 public ActionResult Delete(string infoCode)
 {
     // TODO: Add delete logic here
     SysUserModels userSession = (SysUserModels)Session["UserSession"];
     IdxInfoDAO infoDAO = new IdxInfoDAO(this.mapper);
     IdxInfoModels model = new IdxInfoModels();
     model.infoCode = infoCode;
     infoDAO.deactiveIdxInfo(model, userSession.userCode);
     return RedirectToAction("Index");
 }
Example #4
0
 public FileContentResult Download(string i)
 {
     //return new DownloadResult { VirtualPath = u, FileDownloadName = n };
     string infoCode = StringUtils.base64Decode(i);
     IdxInfoDAO infoDAO = new IdxInfoDAO(this.mapper);
     IdxInfoModels model = infoDAO.GetInfo(infoCode);
     if (model == null)
     {
         return null;
     }
     else
     {
         var fileRes = new FileContentResult(model.fileContent.ToArray(), "application/octet-stream");
         fileRes.FileDownloadName = model.fileName;
         return fileRes;
     }
 }
Example #5
0
 public ActionResult UploadInfoFile(IdxInfoUploadModels model)
 {
     if (ModelState.IsValid)
     {
         SysUserModels userSession = (SysUserModels)Session["UserSession"];
         IdxInfoDAO idxDAO = new IdxInfoDAO(this.mapper);
         model.infoFile = Request.Files["infoFile"];
         string uploadFolder = Server.MapPath(Constants.File.UploadInfoFolder);
         idxDAO.uploadIdxInfoFile(model, userSession.userCode, uploadFolder);
     }
     model.infoTypeList = this.initTypeList();
     return View(model);
 }