コード例 #1
0
ファイル: SimCodeController.cs プロジェクト: SweetieXu/lhzw
        public ActionResult DeleteSimCode(FormCollection fc)
        {
            string[] ids = fc["tid"].Split(',');

            var result = SimCodeBLL.DeleteSimCode(ids);

            base.DoLog(OperationTypeEnum.Delete, result, fc["tid"]);
            return(Json(result));
        }
コード例 #2
0
ファイル: SimCodeController.cs プロジェクト: SweetieXu/lhzw
        public ActionResult GetSimCodeInfo(SimCodeSearchModels model, int searchPage)
        {
            SearchDataWithPagedDatas <SimCodeSearchModels, SimCodeListModels> result =
                new SearchDataWithPagedDatas <SimCodeSearchModels, SimCodeListModels>();

            result.SearchModel = model;
            result.PagedDatas  = SimCodeBLL.GetPagedSimCode(model, searchPage, this.PageSize);
            return(PartialView("_SimCodePagedGrid", result));
        }
コード例 #3
0
ファイル: TerminalController.cs プロジェクト: SweetieXu/lhzw
        public ActionResult GetNotUserdSimCodeList(string simCode, int?simCodeId)
        {
            var            list       = SimCodeBLL.GetNotUserdSimCodeList(simCode, simCodeId);
            List <dynamic> resultList = new List <dynamic>();

            foreach (var item in list)
            {
                resultList.Add(new { label = item.SimCode, value = item.SimCode, VID = item.ID });
            }
            return(Json(resultList, JsonRequestBehavior.AllowGet));
        }
コード例 #4
0
ファイル: SimCodeController.cs プロジェクト: SweetieXu/lhzw
 public ActionResult AddSimCode(AddSimCodeModels model)
 {
     if (ModelState.IsValid)
     {
         var result = SimCodeBLL.AddSimCode(model, base.UserIDForLog);
         base.DoLog(OperationTypeEnum.Add, result, "ID:" + model.ID);
         return(Json(result));
     }
     else
     {
         return(PartialView("_AddSimCode", model));
     }
 }
コード例 #5
0
ファイル: SimCodeController.cs プロジェクト: SweetieXu/lhzw
        public ActionResult AddSimCode()
        {
            AddSimCodeModels model = new AddSimCodeModels();

            model.OpeningDate               = DateTime.Today.ToString("yyyy-MM-dd");
            model.PurchaseDate              = DateTime.Today.ToString("yyyy-MM-dd");
            model.ExpiryDate                = DateTime.Today.ToString("yyyy-MM-dd");
            model.CommModeSelectList        = new SelectList(SimCodeBLL.GetCommMode(), "ID", "Name");
            model.ServiceProviderSelectList = new SelectList(SimCodeBLL.GetServiceProvider(), "ID", "Name");
            //var structures = StructureBLL.GetStructures();
            //model.OwnerStrucName = new SelectList(structures, "ID", "StrucName");
            //model.UseStrucName = new SelectList(structures, "ID", "StrucName");
            return(PartialView("_AddSimCode", model));
        }
コード例 #6
0
ファイル: SimCodeController.cs プロジェクト: SweetieXu/lhzw
        public ActionResult ImportExcel(HttpPostedFileBase excelFile)
        {
            object importExcelLocker = new object();

            #region 文件合法性检查
            if (excelFile == null)
            {
                return(Json(new { Success = false, Message = DataAnnotations.FileDoesNotExist }));
            }
            Regex  reg      = new Regex(@"\.(xls|xlsx|XLS|XLSX)$");
            string fileName = excelFile.FileName;
            string extName  = Path.GetExtension(fileName);
            fileName = fileName.Remove(fileName.LastIndexOf('.'));
            if (!reg.IsMatch(extName))
            {
                return(Json(new { Success = false, Message = DataAnnotations.WrongFileType }));
            }
            #endregion

            #region 保存上传的文件
            string filePath = string.Empty;
            try
            {
                //保存上传的文件到UploadFiles/VehicleExcels/日期/
                string dirPath = Path.Combine("~/UploadFiles/SimExcels/", DateTime.Now.ToShortDateString());
                dirPath = Server.MapPath(dirPath);
                if (!Directory.Exists(dirPath))
                {
                    lock (importExcelLocker)
                    {
                        if (!Directory.Exists(dirPath))
                        {
                            Directory.CreateDirectory(dirPath);
                        }
                    }
                }
                filePath = Path.Combine(dirPath, string.Format("{0}[{1}]{2}", fileName, DateTime.Now.ToString("HHmmss"), extName));
                excelFile.SaveAs(filePath);
            }
            catch (Exception ex)
            {
                return(Json(new { Success = false, Message = "导入失败:保存文件异常!" }));
            }
            #endregion

            return(Json(SimCodeBLL.ImportSimCodes(filePath, "SIM", base.CurrentUserID)));
        }
コード例 #7
0
ファイル: SimCodeController.cs プロジェクト: SweetieXu/lhzw
        public ActionResult SearchSimCode()
        {
            SearchDataWithPagedDatas <SimCodeSearchModels, SimCodeListModels> model =
                new SearchDataWithPagedDatas <SimCodeSearchModels, SimCodeListModels>();

            model.SearchModel = new SimCodeSearchModels();
            model.SearchModel.CommModeSelectList = SimCodeBLL.GetCommMode().ToSelectListWithAll(m => GetSelectListItem(m.ID, m.Name));
            model.SearchModel.CommMode           = -1;

            model.SearchModel.ServiceProviderSelectList = SimCodeBLL.GetServiceProvider().ToSelectListWithAll(m => GetSelectListItem(m.ID, m.Name));
            model.SearchModel.ServiceProviderID         = -1;

            model.SearchModel.UseStrucID   = -1;
            model.SearchModel.OwnerStrucID = -1;
            model.PagedDatas = SimCodeBLL.GetPagedSimCode(model.SearchModel, 1, this.PageSize);
            return(PartialView("_SearchSimCodeList", model));
        }
コード例 #8
0
ファイル: SimCodeController.cs プロジェクト: SweetieXu/lhzw
        public ActionResult EditSimCode(int id)
        {
            var result = SimCodeBLL.GetSimCodeID(id);

            if (result.DataResult == null)
            {
                return(Content(result.Message));
            }
            var model = result.DataResult;

            model.CommModeSelectList        = new SelectList(SimCodeBLL.GetCommMode(), "ID", "Name");
            model.ServiceProviderSelectList = new SelectList(SimCodeBLL.GetServiceProvider(), "ID", "Name");
            //var structures = StructureBLL.GetStructures();
            //model.OwnerStrucName = new SelectList(structures, "ID", "StrucName",model.OwnerStrucID);
            //model.UseStrucName = new SelectList(structures, "ID", "StrucName",model.UseStrucID);
            return(PartialView("_EditSimCode", model));
        }
コード例 #9
0
ファイル: SimCodeController.cs プロジェクト: SweetieXu/lhzw
 public ActionResult CheckAddSIMCodeExists(string SIMCode)
 {
     return(Json(!SimCodeBLL.CheckSIMCodeExists(SIMCode)));
 }
コード例 #10
0
ファイル: SimCodeController.cs プロジェクト: SweetieXu/lhzw
 public ActionResult CheckEditSIMCodeExists(string SIMCode, int id)
 {
     return(Json(!SimCodeBLL.CheckEditSIMCodeExists(SIMCode, id)));
 }