예제 #1
0
        // GET: Dep/Edit/5
        public ActionResult Edit(long id)
        {
            Result <Base_Dep> result = new Result <Base_Dep>();

            using (AdminClientProxy proxy = new AdminClientProxy(ProxyEx(Request)))
            {
                result = proxy.GeDepModel(id);
            }
            var isConfirm = result.Data.IsConfirm ? EnumState.Confirmed.ToString() : EnumState.NoConfim.ToString();
            var isEnable  = result.Data.IsEnable ? EnumState.Enable.ToString() : EnumState.Disable.ToString();

            ViewBag.IsEnable  = HelperExt.GetEnableList(false, isEnable);
            ViewBag.IsConfirm = HelperExt.GetConfirmList(false, isConfirm);
            var companyId = result.Data.CompanyId;
            Result <List <Base_Dep> > resultDep = new Result <List <Base_Dep> >();

            using (AdminClientProxy proxy = new AdminClientProxy(ProxyEx(Request)))
            {
                resultDep = proxy.GeDepListByCompanyId(companyId);
                var depList = resultDep.Data;
                if (result.Data.PreId == "0")
                {
                    ViewBag.PreId = depList.ToSelectList("Name", "Id", true);
                }
                else
                {
                    ViewBag.PreId = depList.ToSelectList("Name", "Id", false, result.Data.PreId);
                }
            }
            return(View(result.Data));
        }
예제 #2
0
 public ActionResult Add(string Belong)
 {
     //权限检查
     Helper.IsCheck(HttpContext, AdminModule.AdminRole.ToString(), SystemRight.Add.ToString(), true);
     ViewBag.IsConfirm = HelperExt.GetConfirmList(false);
     ViewBag.IsEnable  = HelperExt.GetEnableList(false);
     return(View());
 }
예제 #3
0
        public ActionResult Add()
        {
            ViewBag.IsConfirm = HelperExt.GetConfirmList(false);
            ViewBag.IsEnable  = HelperExt.GetEnableList(false);
            ViewBag.Step      = Enum <MessageStep> .AsEnumerable().ToDictionary(i => i.ToString(), j => j.GetText()).ToList().ToSelectList("Value", "Key", true);

            return(View());
        }
예제 #4
0
 // GET: Role/Add
 public ActionResult Add(string Belong)
 {
     ViewBag.Belong     = Belong;
     ViewBag.BelongText = Belong.ToEnumReq <RoleType>().GetText();
     ViewBag.IsConfirm  = HelperExt.GetConfirmList(false);
     ViewBag.IsEnable   = HelperExt.GetEnableList(false);
     return(View());
 }
예제 #5
0
        public ActionResult Index(string RoleName = "", string IsEnable = "0", string IsConfirm = "0", int pageIndex = 1, int pageSize = 10)
        {
            //权限检查
            Helper.IsCheck(HttpContext, AdminModule.AdminRole.ToString(), SystemRight.Browse.ToString(), true);

            ViewBag.RoleName  = RoleName;
            ViewBag.pageIndex = pageIndex;
            ViewBag.IsConfirm = HelperExt.GetConfirmList(true, IsConfirm);
            ViewBag.IsEnable  = HelperExt.GetEnableList(true, IsEnable);
            ConditionExpression ce = null;
            QueryCondition      qc = new QueryCondition();

            ce = new ConditionExpression();

            if (!string.IsNullOrEmpty(RoleName))
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "RoleName";
                ce.ExpValue    = "%" + RoleName + "%";
                ce.ExpOperater = eConditionOperator.Like;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (IsEnable != "0")
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "IsEnable";
                ce.ExpValue    = IsEnable == EnumState.Enable.ToString();
                ce.ExpOperater = eConditionOperator.Equal;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (IsConfirm != "0")
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "IsConfirm";
                ce.ExpValue    = IsConfirm == EnumState.Confirmed.ToString();
                ce.ExpOperater = eConditionOperator.Equal;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            qc.PageInfo = GetPageInfo(pageIndex, pageSize);
            Result <List <Base_Role> > result = new Result <List <Base_Role> >();

            using (AdminClientProxy proxy = new AdminClientProxy(ProxyEx(Request)))
            {
                result = proxy.GetRoleList(qc);

                foreach (var item in result.Data)
                {
                    item.Remark   = item.Remark.CutByByteLength(200, "...");
                    item.RoleName = item.RoleName.CutByByteLength(15, "...");
                }

                ViewBag.Total = result.AllRowsCount;
            }
            return(View(result.Data));
        }
예제 #6
0
        // GET: Role
        public ActionResult Index(string Belong = "Owner", string RoleName = "", string IsEnable = "0", string IsConfirm = "0", int pageIndex = 1, int pageSize = 10)
        {
            ViewBag.Belong     = Belong;
            ViewBag.RoleName   = RoleName;
            ViewBag.pageIndex  = pageIndex;
            ViewBag.BelongText = Belong.ToEnumReq <RoleType>().GetText();
            ViewBag.IsConfirm  = HelperExt.GetConfirmList(true, IsConfirm);
            ViewBag.IsEnable   = HelperExt.GetEnableList(true, IsEnable);
            ConditionExpression ce = null;
            QueryCondition      qc = new QueryCondition();

            ce = new ConditionExpression();
            //ce.ExpName = "Belong";
            //ce.ExpValue = Belong;
            //ce.ExpOperater = eConditionOperator.Equal;
            //ce.ExpLogical = eLogicalOperator.And;
            //qc.ConditionList.Add(ce);
            if (!string.IsNullOrEmpty(RoleName))
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "RoleName";
                ce.ExpValue    = "%" + RoleName + "%";
                ce.ExpOperater = eConditionOperator.Like;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (IsEnable != "0")
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "IsEnable";
                ce.ExpValue    = IsEnable == EnumState.Enable.ToString();
                ce.ExpOperater = eConditionOperator.Equal;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (IsConfirm != "0")
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "IsConfirm";
                ce.ExpValue    = IsConfirm == EnumState.Confirmed.ToString();
                ce.ExpOperater = eConditionOperator.Equal;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            qc.PageInfo = GetPageInfo(pageIndex, pageSize);
            Result <List <Base_Role> > result = new Result <List <Base_Role> >();

            using (AdminClientProxy proxy = new AdminClientProxy(ProxyEx(Request)))
            {
                result        = proxy.GetRoleList(qc);
                ViewBag.Total = result.AllRowsCount;
            }
            return(View(result.Data));
        }
예제 #7
0
        public ActionResult Index(string Name = "", string IsEnable = "0", string IsConfirm = "0", int pageIndex = 1, int pageSize = 10)
        {
            ViewBag.Name      = Name;
            ViewBag.pageIndex = pageIndex;
            //下拉框
            ViewBag.Step = Enum <MessageStep> .AsEnumerable().ToDictionary(i => i.ToString(), j => j.GetText()).ToList().ToSelectList("Value", "Key", true);

            ViewBag.IsConfirm = HelperExt.GetConfirmList(true, IsConfirm);
            ViewBag.IsEnable  = HelperExt.GetEnableList(true, IsEnable);
            ConditionExpression ce = null;
            QueryCondition      qc = new QueryCondition();

            ce = new ConditionExpression();
            if (!string.IsNullOrEmpty(Name))
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "Name";
                ce.ExpValue    = "%" + Name + "%";
                ce.ExpOperater = eConditionOperator.Like;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (!string.IsNullOrEmpty(IsEnable) && IsEnable != "0")
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "IsEnable";
                ce.ExpValue    = IsEnable == EnumState.Enable.ToString();
                ce.ExpOperater = eConditionOperator.Equal;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (!string.IsNullOrEmpty(IsConfirm) && IsConfirm != "0")
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "IsConfirm";
                ce.ExpValue    = IsConfirm == EnumState.Confirmed.ToString();
                ce.ExpOperater = eConditionOperator.Equal;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            qc.PageInfo = GetPageInfo(pageIndex, pageSize);
            Result <List <Msg_SMSTemplete> > result = new Result <List <Msg_SMSTemplete> >();

            using (MessageClientProxy proxy = new MessageClientProxy(ProxyEx(Request)))
            {
                result        = proxy.GetSMSTempleteList(qc);
                ViewBag.Total = result.AllRowsCount;
            }

            return(View(result.Data));
        }
예제 #8
0
        public ActionResult Add(long CompanyId)
        {
            ViewBag.CompanyId = CompanyId;
            ViewBag.IsConfirm = HelperExt.GetConfirmList(false);
            ViewBag.IsEnable  = HelperExt.GetEnableList(false);
            Result <List <Base_Dep> > result = new Result <List <Base_Dep> >();

            using (AdminClientProxy proxy = new AdminClientProxy(ProxyEx(Request)))
            {
                result        = proxy.GeDepListByCompanyId(CompanyId);
                ViewBag.PreId = result.Data.ToSelectList("Name", "Id", true);
            }
            return(View());
        }
예제 #9
0
        public ActionResult Detail(long id)
        {
            Result <Base_Protocol> result = new Result <Base_Protocol>();

            using (AdminClientProxy proxy = new AdminClientProxy(ProxyEx(Request)))
            {
                result = proxy.GetProtocolModel(id);
            }
            var isConfirm = result.Data.IsConfirm ? EnumState.Confirmed.ToString() : EnumState.NoConfim.ToString();
            var isEnable  = result.Data.IsEnable ? EnumState.Enable.ToString() : EnumState.Disable.ToString();

            ViewBag.IsEnable  = HelperExt.GetEnableList(false, isEnable);
            ViewBag.IsConfirm = HelperExt.GetConfirmList(false, isConfirm);


            return(View(result.Data));
        }
예제 #10
0
        public ActionResult Edit(long id)
        {
            Result <Msg_EmailSetting> result = new Result <Msg_EmailSetting>();

            using (MessageClientProxy proxy = new MessageClientProxy(ProxyEx(Request)))
            {
                result = proxy.GetEmailSettingModel(id);
            }
            var isConfirm = result.Data.IsConfirm ? EnumState.Confirmed.ToString() : EnumState.NoConfim.ToString();
            var isEnable  = result.Data.IsEnable ? EnumState.Enable.ToString() : EnumState.Disable.ToString();

            ViewBag.IsEnable  = HelperExt.GetEnableList(false, isEnable);
            ViewBag.IsConfirm = HelperExt.GetConfirmList(false, isConfirm);


            return(View(result.Data));
        }
예제 #11
0
        public ActionResult Edit(long id)
        {
            Result <Msg_SMSTemplete> result = new Result <Msg_SMSTemplete>();

            using (MessageClientProxy proxy = new MessageClientProxy(ProxyEx(Request)))
            {
                result = proxy.GetSMSTempleteModel(id);
            }
            ViewBag.Step = Enum <MessageStep> .AsEnumerable().ToDictionary(i => i.ToString(), j => j.GetText()).ToList().ToSelectList("Value", "Key", true, result.Data.Step);

            var isConfirm = result.Data.IsConfirm ? EnumState.Confirmed.ToString() : EnumState.NoConfim.ToString();
            var isEnable  = result.Data.IsEnable ? EnumState.Enable.ToString() : EnumState.Disable.ToString();

            ViewBag.IsEnable  = HelperExt.GetEnableList(false, isEnable);
            ViewBag.IsConfirm = HelperExt.GetConfirmList(false, isConfirm);


            return(View(result.Data));
        }
예제 #12
0
        public ActionResult Edit(string tableName, long id)
        {
            ViewBag.tableName = tableName;
            ViewBag.id        = id;
            Result <Base_Protocol> result = new Result <Base_Protocol>();

            using (AdminClientProxy proxy = new AdminClientProxy(ProxyEx(Request)))
            {
                result = proxy.GetProtocolModel(id);
            }
            var isConfirm = result.Data.IsConfirm ? EnumState.Confirmed.ToString() : EnumState.NoConfim.ToString();
            var isEnable  = result.Data.IsEnable ? EnumState.Enable.ToString() : EnumState.Disable.ToString();

            ViewBag.Type = Enum <ProtocolType> .AsEnumerable().ToDictionary(i => i.ToString(), j => j.GetText()).ToList().ToSelectList("Value", "Key", false, result.Data.Type);

            ViewBag.IsEnable  = HelperExt.GetEnableList(false, isEnable);
            ViewBag.IsConfirm = HelperExt.GetConfirmList(false, isConfirm);


            return(View(result.Data));
        }
예제 #13
0
 public ActionResult Add()
 {
     ViewBag.IsConfirm = HelperExt.GetConfirmList(false);
     ViewBag.IsEnable  = HelperExt.GetEnableList(false);
     return(View());
 }
예제 #14
0
        public ActionResult Index(long CompanyId, string name = "", string isEnable = "0", string isConfirm = "0", int pageIndex = 1, int pageSize = 10)
        {
            ViewBag.pageIndex = pageIndex;
            ViewBag.companyId = CompanyId;
            ViewBag.Name      = name;
            ViewBag.IsConfirm = HelperExt.GetConfirmList(true, isConfirm);
            ViewBag.IsEnable  = HelperExt.GetEnableList(true, isEnable);
            ConditionExpression ce = null;
            QueryCondition      qc = new QueryCondition();

            if (!string.IsNullOrEmpty(name))
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "Name";
                ce.ExpValue    = "%" + name + "%";
                ce.ExpOperater = eConditionOperator.Like;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }


            ce             = new ConditionExpression();
            ce.ExpName     = "CompanyId";
            ce.ExpValue    = CompanyId;
            ce.ExpOperater = eConditionOperator.Equal;
            ce.ExpLogical  = eLogicalOperator.And;
            qc.ConditionList.Add(ce);
            if (isEnable != "0")
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "IsEnable";
                ce.ExpValue    = isEnable == EnumState.Enable.ToString();
                ce.ExpOperater = eConditionOperator.Equal;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (isConfirm != "0")
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "IsConfirm";
                ce.ExpValue    = isConfirm == EnumState.Confirmed.ToString();
                ce.ExpOperater = eConditionOperator.Equal;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            qc.PageInfo = GetPageInfo(pageIndex, pageSize);
            Result <List <Base_Dep> > result = new Result <List <Base_Dep> >();

            using (AdminClientProxy proxy = new AdminClientProxy(ProxyEx(Request)))
            {
                result = proxy.GeDepList(qc);
                foreach (var item in result.Data)
                {
                    if (string.IsNullOrEmpty(item.PreName))
                    {
                        item.PreName = "无上级部门";
                    }
                }
                ViewBag.TotalPage = Math.Ceiling((decimal)result.AllRowsCount / pageSize);
            }
            return(View(result.Data));
        }