Exemplo n.º 1
0
        public ActionResult Index(string SmsCons = "", string BenginDate = "", string EndDate = "", int pageIndex = 1, int pageSize = 10)
        {
            ViewBag.SmsCon    = SmsCons;
            ViewBag.pageIndex = pageIndex;
            var UserID             = CurrentUser.UserId;
            ConditionExpression ce = null;
            QueryCondition      qc = new QueryCondition();

            if (!string.IsNullOrEmpty(SmsCons))
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "Title";
                ce.ExpValue    = "%" + SmsCons + "%";
                ce.ExpOperater = eConditionOperator.Like;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (!string.IsNullOrEmpty(BenginDate))
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "SenderTime";
                ce.ExpValue    = Convert.ToDateTime(BenginDate);
                ce.ExpOperater = eConditionOperator.GreaterThanOrEqual;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (!string.IsNullOrEmpty(EndDate))
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "SenderTime";
                ce.ExpValue    = Convert.ToDateTime(EndDate + " 23:59:59");
                ce.ExpOperater = eConditionOperator.LessThanOrEqual;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            qc.PageInfo = GetPageInfo(pageIndex, pageSize);
            Result <List <Msg_Email> > result = new Result <List <Msg_Email> >();

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

            return(View(result.Data));
        }