Пример #1
0
        public ActionResult DeptOperManage()
        {
            var gridModel = new DeptOperManageGridModel();

            SetupDeptOperManageGridModel(gridModel);
            return(PartialView(gridModel));
        }
Пример #2
0
        public ActionResult DeptOperManage_Func_EditData(string ParentRowId, bool IsInRole, DXInfo.Models.tbFunc func)
        {
            var gridModel = new DeptOperManageGridModel();

            SetupDeptOperManageGridModel(gridModel);
            DXInfo.Models.tbOperFunc operFunc = Uow.tbOperFunc.GetAll().Where(w => w.vcOperID == ParentRowId &&
                                                                              w.vcFuncName == func.cnvcFuncName //&&w.vcFuncAddress == func.cnvcFuncAddress
                                                                              ).FirstOrDefault();
            if (IsInRole)
            {
                if (operFunc == null)
                {
                    DXInfo.Models.tbFunc oldFunc = Uow.tbFunc.GetById(g => g.cnvcFuncName == func.cnvcFuncName &&
                                                                      g.cnvcFuncType == "CS");
                    operFunc = new tbOperFunc();
                    operFunc.vcFuncAddress = oldFunc.cnvcFuncAddress;
                    operFunc.vcFuncName    = func.cnvcFuncName;//func.cnvcFuncName;
                    operFunc.vcOperID      = ParentRowId;

                    Uow.tbOperFunc.Add(operFunc);
                    Uow.Commit();
                }
            }
            else
            {
                if (operFunc != null)
                {
                    Uow.tbOperFunc.Delete(operFunc);
                    Uow.Commit();
                }
            }
            return(new EmptyResult());
        }
Пример #3
0
        public ActionResult DeptOperManage_EditData(DXInfo.Models.tbOper tbOper)
        {
            var gridModel = new DeptOperManageGridModel();

            SetupDeptOperManageGridModel(gridModel);
            return(ajaxCallBack <DXInfo.Models.tbOper>(gridModel.DeptOperManageGrid, tbOper, addDeptOperManage, editDeptOperManage, delDeptOperManage));
        }
Пример #4
0
        public ActionResult DeptOperManage_RequestData()
        {
            var gridModel = new DeptOperManageGridModel();

            SetupDeptOperManageGridModel(gridModel);

            var q = from d in Uow.tbOper.GetAll()
                    select d;

            return(QueryAndExcel(gridModel.DeptOperManageGrid, q, "客户端操作员.xls"));
        }
Пример #5
0
        private void SetupDeptOperManageGridModel(DeptOperManageGridModel gridModel)
        {
            var operGrid = gridModel.DeptOperManageGrid;
            var funcGrid = gridModel.FuncGrid;

            operGrid.DataUrl = Url.Action("DeptOperManage_RequestData");
            operGrid.EditUrl = Url.Action("DeptOperManage_EditData");
            SetUpGrid(operGrid);
            SetRequiredColumn(operGrid, "vcOperId");
            SetRequiredColumn(operGrid, "vcDeptId");
            SetRequiredColumn(operGrid, "vcOperName");
            SetRequiredColumn(operGrid, "vcLimit");
            SetRequiredColumn(operGrid, "vcActiveFlag");
            SetRequiredColumn(operGrid, "vcPwdBeginFlag");

            SetDropDownColumn(operGrid, "vcLimit", centerCommon.GetLM());
            SetDropDownColumn(operGrid, "vcDeptId", centerCommon.GetMD());

            SetDropDownColumn(operGrid, "vcActiveFlag", new List <SelectListItem>()
            {
                new SelectListItem {
                    Selected = true, Text = "正常", Value = "1"
                },
                new SelectListItem {
                    Text = "冻结", Value = "0"
                }
            });

            SetDropDownColumn(operGrid, "vcPwdBeginFlag", new List <SelectListItem>()
            {
                new SelectListItem {
                    Selected = true, Text = "正常", Value = "0"
                },
                new SelectListItem {
                    Text = "待初始化", Value = "1"
                }
            });

            SetBoolColumn(operGrid, "IsDiscount");

            funcGrid.DataUrl = Url.Action("DeptOperManage_Func_RequestData");
            funcGrid.EditUrl = Url.Action("DeptOperManage_Func_EditData");
            funcGrid.SortSettings.InitialSortColumn = "cnvcFuncParentName";
            SetBoolColumn(funcGrid, "IsInRole");
        }
Пример #6
0
        public ActionResult DeptOperManage_Func_RequestData(string ParentRowId)
        {
            var gridModel = new DeptOperManageGridModel();

            SetupDeptOperManageGridModel(gridModel);
            var q = from d in Uow.tbFunc.GetAll().Where(w => w.cnvcFuncType == "CS")
                    join d1 in Uow.tbOperFunc.GetAll().Where(w => w.vcOperID == ParentRowId)
                    on new { key1 = d.cnvcFuncAddress, key2 = d.cnvcFuncName } equals new { key1 = d1.vcFuncAddress, key2 = d1.vcFuncName } into dd1
            from dd1s in dd1.DefaultIfEmpty()
            //where dd1s.vcOperID==ParentRowId && d.cnvcFuncType=="CS"
            select new
            {
                IsInRole = dd1s != null,
                d.cnvcFuncName,
                d.cnvcFuncParentName,
                //d.cnvcFuncAddress,
            };

            return(QueryAndExcel(gridModel.FuncGrid, q, "操作员权限.xls"));
            //return gridModel.UsersGrid.DataBind(users);
        }