コード例 #1
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.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 (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 <Msg_EmailSetting> > result = new Result <List <Msg_EmailSetting> >();

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

            return(View(result.Data));
        }