Example #1
0
 public ActionResult Create(string Id=null)
 {
     var resultMsg = string.Empty;
     ModelOrganization model = new ModelOrganization();
     if (!string.IsNullOrWhiteSpace(Id))
     {
         LogicOrganization logic = new LogicOrganization();
         model = logic.OrganizationDetail(out resultMsg, int.Parse(Id));
     }
     return View(model);
 }
Example #2
0
        public ActionResult Create(ModelOrganization model)
        {
            var resultMsg = string.Empty;
            var result = new ResultBase();

            var logic = new LogicOrganization();
            model.Status = "1";
            var res = logic.OrganizationInsertUpdate(out resultMsg, model);
            if (res > 0)
            {
                resultMsg = "操作成功!";
                ViewBag.CustomScript = UtilityScript.ShowMessage(resultMsg, isCreate: true, isSuccess: true, funName: "Goto");
            }
            else
            {
                resultMsg = "操作失败,请检查数据是否正确后重新操作!";
                ViewBag.CustomScript = UtilityScript.ShowMessage(resultMsg, isCreate: true, isSuccess: true, funName: "BtnShow");
            }
            return View(model);
        }
Example #3
0
        public ActionResult Delete(string Id)
        {
            int idx = 0;
            int.TryParse(Id, out idx);
            var result = new ResultBase();
            var resultMsg = string.Empty;
            var logic = new LogicOrganization();
            var res = logic.OrganizationDelete(out resultMsg, idx);
            if (res > 0)
            {
                result.result = 1;
                result.resultMsg = "删除成功!";
            }
            else
            {
                result.result = -1;
                result.resultMsg = string.IsNullOrWhiteSpace(resultMsg) ? "删除失败!" : resultMsg;
            }

            return Json(result);
        }
Example #4
0
        public ActionResult Index(ModelPagerOrg model, string PagerIndex, string PagerSize)
        {
            var pageIndex = 0;
            var pageSize = 0;
            int.TryParse(PagerIndex, out pageIndex);
            int.TryParse(PagerSize, out pageSize);

            var resultMsg = string.Empty;
            var recordCount = decimal.Zero;
            var logic = new LogicOrganization();
            var criteria = new CriteriaOrganization.Pager();
            criteria.KeyWord = model.KeyWord;

            var list = logic.QueryOrganizationListPager(out resultMsg, out recordCount, criteria, pageSize: pageSize, pageIndex: pageIndex);
            model.PagerRowCount = recordCount;
            model.PagerCount = pageSize == 0 ? 0 : Math.Ceiling(recordCount / pageSize);
            model.AdsList = list;
            return View(model);
        }
Example #5
0
        /// <summary>
        /// 获取组织架构下拉列表
        /// </summary> 
        private IList<SelectListItem> GetOrgs(string selected = null)
        {
            string resultMsg = string.Empty;
            LogicOrganization logic = new LogicOrganization();
            var list = logic.OrganizationAll(out resultMsg);
            var res = (from ModelOrganization model in list
                      select new SelectListItem()
                      {
                          Selected = string.IsNullOrWhiteSpace(selected) == false && model.Orgid.ToString().Equals(selected) ? true : false,
                          Text = model.Orgname,
                          Value = model.Orgid.ToString()
                      }).ToList();

            return res;
        }