Beispiel #1
0
        /// <summary>
        /// 搜索
        /// </summary>
        private void selectTJ()
        {
            try
            {
                //if (expr == null)
                //{
                //expr = PredicateExtensionses.True<View_UserInfo_D_R_d>();
                expr = (Expression <Func <View_UserInfo2_D_R_d, bool> >)PredicateExtensionses.True <View_UserInfo2_D_R_d>();
                //}
                int i = 0;
                //if (txtSearchId.Text.Trim() != "")//用户名
                //{
                //    //expr = expr.And(n => n.UserLoginId == txtSearchId.Text.Trim());
                //    expr = expr.And(n => SqlMethods.Like(n.UserLoginId, "%" + txtSearchId.Text.Trim() + "%") && n.UserLoginId != "emewe");
                //    i++;

                //}
                if (txt_Name.Text.Trim() != "")//真实姓名
                {
                    //expr = expr.And(n => n.UserName == txt_Name.Text.Trim());
                    expr = expr.And(n => SqlMethods.Like(n.UserName, "%" + txt_Name.Text.Trim() + "%"));
                    i++;
                }
                if (cobDuty_Name2.SelectedValue != "") //职位
                {
                    expr = expr.And(n => SqlMethods.Like(n.Duty_Name, "%" + cobDuty_Name2.Text.Trim() + "%"));
                    i++;
                }
                //if (cmbSearchRole.Text != "")//角色
                //{
                //    expr = expr.And(n => n.Role_Name == cmbSearchRole.Text && n.UserLoginId != "emewe");

                //    i++;
                //}
                //if (i == 0)
                //{
                //    expr = expr.And(n => n.UserLoginId != "emewe");
                //}
            }
            catch (Exception ex)
            {
                Common.WriteTextLog("用户管理 selectTJ()" + ex.Message.ToString());
            }
            finally
            {
                page = new PageControl();
                page.PageMaxCount = tscbxPageSize2.SelectedItem.ToString();
                LoadData();
            }
        }
        private void LoadData(string strName)
        {
            if (expr == null)
            {
                expr = (Expression <Func <idebarJoinU9, bool> >)PredicateExtensionses.True <idebarJoinU9>();
            }

            if (txtPRODID2.Text != "")
            {
                expr = expr.And(n => SqlMethods.Like(n.idebarJoinU9_PROD_ID, "%" + txtPRODID2.Text.Trim() + "%"));
            }

            dgvView_WaterSet.AutoGenerateColumns = false;
            dgvView_WaterSet.DataSource          = page.BindBoundControl <idebarJoinU9>(strName, txtCurrentPage1, lblPageCount1, expr, "idebarJoinU9_id");
        }
Beispiel #3
0
        public ActionResult InvalidInvst()
        {
            Expression <Func <V_Bid_records_Lost, bool> > where = PredicateExtensionses.True <V_Bid_records_Lost>();
            where = where.And(p => p.bid_records_id > 0);
            //清理10分钟之前的无效标的
            DateTime dt2 = DateTime.Now.AddMinutes(-10);

            where = where.And(a => ((DateTime)a.invest_time) <= dt2);
            List <V_Bid_records_Lost> list = ef.V_Bid_records_Lost.Where(where).AsNoTracking().ToList();

            foreach (V_Bid_records_Lost item in list)
            {
                setRecords_Lost(item.investor_registerid.ToString(), item.bid_records_id.ToString(), item.OrdId.ToString(), DateTime.Parse(item.invest_time.ToString()).ToString("yyyyMMdd"), item.UsrCustId.ToString(), item.FrozenidNo, item.investment_amount.ToString(), item.FreezeTrxId == null ? "" : item.FreezeTrxId.ToString(), "", "TENDER");
            }
            return(Content("远程调用成功"));
        }
Beispiel #4
0
        public Expression <Func <T, bool> > CreateDydaminWhereAndExpression <T>(T querymodel) where T : class
        {
            Expression <Func <T, bool> > finalexpression = PredicateExtensionses.True <T>();

            if (querymodel == null)
            {
                return(finalexpression);
            }
            Type t = querymodel.GetType();

            PropertyInfo[] properties = t.GetProperties();
            foreach (PropertyInfo item in properties)
            {
                object value = item.GetValue(querymodel, null);
                if (value != null)
                {
                    Type valuetype = value.GetType();
                    if (valuetype != typeof(Int32) && valuetype != typeof(Int64))
                    {
                        if (valuetype == typeof(DateTime) && (DateTime)value != DateTime.Parse("1900/1/1 0:00:00") && (DateTime)value != default(DateTime))
                        {
                            DateTime startdate = DateTime.Parse(Convert.ToDateTime(value).ToShortDateString());
                            DateTime enddate   = startdate.AddDays(1);
                            Expression <Func <T, bool> > startexpression = ExpressionOperator.CreateCompareExpression <T>(item.Name, startdate, "greaterthanorequal");
                            Expression <Func <T, bool> > endexpression   = ExpressionOperator.CreateCompareExpression <T>(item.Name, enddate, "lessthan");
                            finalexpression = finalexpression.And <T>(startexpression).And <T>(endexpression);
                        }
                        if (valuetype != typeof(DateTime) && valuetype != typeof(Boolean))
                        {
                            Expression <Func <T, bool> > currentexpression = ExpressionOperator.CreateCompareExpression <T>(item.Name, value);
                            finalexpression = finalexpression.And <T>(currentexpression);
                        }
                    }
                    else
                    {
                        long convervalue = Convert.ToInt64(value);
                        if (convervalue != 0)
                        {
                            Expression <Func <T, bool> > currentexpression = ExpressionOperator.CreateCompareExpression <T>(item.Name, value);
                            finalexpression = finalexpression.And <T>(currentexpression);
                        }
                    }
                }
            }
            return(finalexpression);
        }
Beispiel #5
0
 private void Search()
 {
     Expression <Func <MODEL.GoodsInfo, bool> > where = PredicateExtensionses.True <MODEL.GoodsInfo>();
     if (!string.IsNullOrWhiteSpace(strGiEncoder))
     {
         where = where.And(u => u.GIEncoder == strGiEncoder);
     }
     if (!string.IsNullOrWhiteSpace(strGiName))
     {
         where = where.And(u => u.GIName == strGiName);
     }
     if (!string.IsNullOrWhiteSpace(strGiSize))
     {
         where = where.And(u => u.GISize == strGiSize);
     }
     GoodsInfoList = bllGoodsInfo.GetListBy(where);
 }
Beispiel #6
0
        public ActionResult AdminUserList(int page = 1, int pagesize = 10)
        {
            //渠道用户非,非后台登录用户
            hx_Channel_AdminUser adminUser = Session["Channel_AdminUser"] as hx_Channel_AdminUser;

            //判定用户
            if (adminUser == null)
            {
                return(RedirectToAction("LoginOut", "Channel"));
            }
            int    pageIndex = page / 1;
            string realname  = Utils.CheckSQLHtml(DNTRequest.GetString("RealName"));
            string username  = Utils.CheckSQLHtml(DNTRequest.GetString("UserName"));
            string startTime = DNTRequest.GetString("StartTime");
            string endTime   = DNTRequest.GetString("EndTime");

            Expression <Func <V_Channel_UserList, bool> > where = PredicateExtensionses.True <V_Channel_UserList>();
            where = where.And(p => p.AdminUserName == adminUser.AdminUserName);
            if (!string.IsNullOrEmpty(realname))
            {
                where = where.And(p => p.realname.Contains(realname.Trim()));
            }
            if (!string.IsNullOrEmpty(username))
            {
                where = where.And(p => p.username.Contains(username.Trim()));
            }
            if (!string.IsNullOrEmpty(startTime) && startTime != "")
            {
                DateTime stime = Convert.ToDateTime(startTime);
                where = where.And(p => DbFunctions.DiffDays(p.registration_time, stime) <= 0);
                DateTime etime = DateTime.Now;
                if (!string.IsNullOrEmpty(endTime) && endTime != "")
                {
                    etime = Convert.ToDateTime(endTime);
                }
                etime = etime.AddDays(1).AddSeconds(-1);
                where = where.And(p => DbFunctions.DiffDays(p.registration_time, etime) >= 0);
            }
            var list = ef.V_Channel_UserList.Where(where).OrderByDescending(p => p.registration_time).ToPagedList(pageIndex, pagesize);

            ViewBag.Username  = username;
            ViewBag.RealName  = realname;
            ViewBag.StartTime = startTime;
            ViewBag.EndTime   = endTime;
            return(View(list));
        }
Beispiel #7
0
 public PagingOutput <Accounts> GetPageList(GetPageListInput input)
 {
     return(AutofacConfig.Resolve <AccountsRepository>().GetPageList(
                input.PageIndex,
                input.PageSize,
                PredicateExtensionses.True <Accounts>().AndIf(a => a.LoginAccount == input.LoginAccount, !string.IsNullOrWhiteSpace(input.LoginAccount))
                .AndIf(a => a.LoginName.Contains(input.LoginName), !string.IsNullOrWhiteSpace(input.LoginName))
                .And(a => a.IsDeleted == input.IsDeleted)
                .AndIf(a => a.Email == input.Email, !string.IsNullOrWhiteSpace(input.Email))
                .AndIf(a => a.CreateTime >= input.CreateTimeBegin.Value, input.CreateTimeBegin.HasValue)
                .AndIf(a => a.CreateTime < input.CreateTimeEnd.Value, input.CreateTimeEnd.HasValue)
                .AndIf(a => a.DeleteTime >= input.DeleteTimeBegin.Value, input.DeleteTimeBegin.HasValue)
                .AndIf(a => a.DeleteTime < input.DeleteTimeEnd.Value, input.DeleteTimeEnd.HasValue),
                a => a.CreateTime,
                true
                ));
 }
Beispiel #8
0
 /// <summary>
 /// 加载用户
 /// </summary>
 private void InitUser()
 {
     expr = PredicateExtensionses.True <View_UserInfo2_D_R_d>();
     //  expr = expr.And(n => n.UserLoginId != "emewe");
     this.lvwUserList.AutoGenerateColumns = false;//设置只显示列表控件绑定的列
     LoadData();
     bingcob_Duty_Name();
     bingcob_QCGroup_Name(cbxState);
     //  bingcob_QCGroup_Name(cmbSearchRole);
     btnUpUser.Visible     = false;
     btnUserCancle.Visible = false;
     mf = new MainFrom();
     if (btnAdd.Visible)
     {
         rbool = true;
     }
 }
Beispiel #9
0
        public PagedList <V_td_LLpay_bank> LLRecharge(int id, string startdatetime, string enddatetime, int?pageIndex = 1, int page = 1, int PageSize = 5)
        {
            Expression <Func <V_td_LLpay_bank, bool> > where = PredicateExtensionses.True <V_td_LLpay_bank>();
            where = where.And(p => p.Rechargeid > 0);
            where = where.And(p => p.UsrId == id);

            DateTime sdatetime = new DateTime();
            DateTime edatetime = new DateTime();

            if (Utils.IsDate(startdatetime))
            {
                sdatetime = DateTime.Parse(startdatetime);
            }
            if (Utils.IsDate(enddatetime))
            {
                edatetime = DateTime.Parse(enddatetime);
            }


            var list = ef.V_td_LLpay_bank.Where(where).OrderByDescending(p => p.Rechargeid).ToPagedList(pageIndex ?? 1, PageSize);

            var listwheretime = list;

            if (sdatetime > DateTime.Parse("0001-01-01 00:00:00") && edatetime > DateTime.Parse("0001-01-01 00:00:00"))
            {
                //where = where.And(p => (p.ordertime.ToDateTime()).CompareTo(sdatetime) >= 0);
                //DateTime dt2 = Convert.ToDateTime(edatetime.ToString("yyyy-MM-dd") + " 23:59:59");
                //where = where.And(p => (Convert.ToDateTime(p.ordertime).CompareTo(dt2) <= 0));

                listwheretime.Clear();
                foreach (var item in list)
                {
                    var ordertime = Convert.ToDateTime(item.ordertime);
                    if (ordertime >= sdatetime && ordertime <= Convert.ToDateTime(edatetime.ToString("yyyy-MM-dd") + " 23:59:59"))
                    {
                        listwheretime.Add(item);
                    }
                }
            }
            listwheretime = listwheretime.ToPagedList(pageIndex ?? 1, PageSize);



            return(listwheretime);
        }
Beispiel #10
0
        public ActionResult Index(string page)
        {
            if (string.IsNullOrEmpty(page))
            {
                page = "1";
            }

            string zhanghao      = Request["zhanghao"] ?? "";
            string zhanghaoequal = Request["zhanghaoequal"] ?? "";
            string zhanghaoand   = Request["zhanghaoand"] ?? "";

            Expression <Func <base_yonghu, bool> > where = PredicateExtensionses.True <base_yonghu>();
            if (!string.IsNullOrEmpty(zhanghao))
            {
                if (zhanghaoequal.Equals("="))
                {
                    if (zhanghaoand.Equals("and"))
                    {
                        where = where.And(base_yonghu => base_yonghu.Zhanghao == zhanghao);
                    }
                    else
                    {
                        where = where.Or(base_yonghu => base_yonghu.Zhanghao == zhanghao);
                    }
                }
                if (zhanghaoequal.Equals("like"))
                {
                    if (zhanghaoand.Equals("and"))
                    {
                        where = where.And(base_yonghu => base_yonghu.Zhanghao.Contains(zhanghao));
                    }
                    else
                    {
                        where = where.Or(base_yonghu => base_yonghu.Zhanghao.Contains(zhanghao));
                    }
                }
            }

            where = where.And(base_yonghu => base_yonghu.IsDelete == false);

            var tempData = ob_base_yonghuservice.LoadSortEntities(where.Compile(), false, base_yonghu => base_yonghu.ID).ToPagedList <base_yonghu>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"]));

            ViewBag.base_yonghu = tempData;
            return(View(tempData));
        }
Beispiel #11
0
        public ActionResult Index(string project_type_name = "", int Page = 1, int pageSize = 10)
        {
            int pageNumber = Page / 1;

            Expression <Func <hx_Project_type, bool> > where = PredicateExtensionses.True <hx_Project_type>();
            where = where.And(p => p.project_type_id > 0);

            if (!string.IsNullOrEmpty(project_type_name))
            {
                where = where.And(p => p.project_type_name.Contains(project_type_name));
            }

            IPagedList <hx_Project_type> list = ef.hx_Project_type.Where(where).OrderByDescending(p => p.project_type_id).ToPagedList(pageNumber, pageSize);

            ViewBag.project_type_name = project_type_name;
            ViewBag.page = Page;
            return(View(list));
        }
Beispiel #12
0
        public ActionResult Index(string guarantee_way_name = "", int Page = 1, int pageSize = 10)
        {
            int pageNumber = Page / 1;

            Expression <Func <guarantee_way, bool> > where = PredicateExtensionses.True <guarantee_way>();
            where = where.And(p => p.guarantee_way_id > 0);

            if (!string.IsNullOrEmpty(guarantee_way_name))
            {
                where = where.And(p => p.guarantee_way_name.Contains(guarantee_way_name));
            }

            IPagedList <guarantee_way> list = ef.guarantee_way.Where(where).OrderByDescending(p => p.guarantee_way_id).ToPagedList(pageNumber, pageSize);

            ViewBag.guarantee_way_name = guarantee_way_name;
            ViewBag.page = Page;
            return(View(list));
        }
Beispiel #13
0
        /// <summary>
        /// 现金奖励
        /// </summary>
        /// <returns></returns>
        // GET: Reward
        public ActionResult Index(int?pageIndex, int pgaesize = 6)
        {
            int userid = Utils.checkloginsession();
            //新加抵扣券提醒
            var cookie = new HttpCookie("RewardTimeXianJin" + userid);//保存至Cookie

            cookie.Value   = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.Date.AddYears(1);
            Response.Cookies.Add(cookie);

            int     Totals      = 0;
            decimal succTotal   = 0.00M;
            var     ListByOwner = ef.hx_UserAct.Where(l => l.registerid == userid && l.RewTypeID == 1).GroupBy(l => l.registerid)
                                  .Select(lg => new
            {
                Owner     = lg.Key,
                Counts    = lg.Count(),
                succTotal = lg.Sum(w => w.Amt)
            });

            foreach (var itc in ListByOwner)
            {
                if (itc.Counts > 0)
                {
                    Totals = (int)itc.Counts;
                    decimal.TryParse(itc.succTotal.ToString(), out succTotal);
                }
            }
            Expression <Func <hx_UserAct, bool> > where = PredicateExtensionses.True <hx_UserAct>();
            where = where.And(p => p.UserAct > 0);
            where = where.And(p => p.registerid == userid);
            where = where.And(p => p.RewTypeID == 1);

            var list = ef.hx_UserAct.Where(where).OrderByDescending(p => p.UserAct).ToPagedList(pageIndex ?? 1, pgaesize);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("_RewardList1", list));
            }
            ViewBag.Totals    = Totals;
            ViewBag.succTotal = succTotal;

            return(View(list));
        }
Beispiel #14
0
        public static List <Model.UserLoginToken> GetUserLoginToken(string ids = null, long userID = 0, string token = null, byte platformType = 0, bool?isDel = false)
        {
            using (var mainContext = new MainDbContext())
            {
                var where = PredicateExtensionses.True <Model.UserLoginToken>();

                if (!string.IsNullOrEmpty(ids))
                {
                    var tmpWhere = PredicateExtensionses.True <Model.UserLoginToken>();
                    var idsArray = ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    foreach (var item in idsArray)
                    {
                        var tempItem = ConvertHelper.GetLong(item, 0);
                        if (tempItem > 0)
                        {
                            tmpWhere = tmpWhere.Or(value => value.ID == tempItem);
                        }
                    }
                    where = where.And(tmpWhere);
                }

                if (userID > 0)
                {
                    where = where.And(item => item.UserID == userID);
                }

                if (!string.IsNullOrEmpty(token))
                {
                    where = where.And(item => item.Token == token);
                }

                if (platformType > 0)
                {
                    where = where.And(item => item.PlatformType == platformType);
                }

                if (isDel != null)
                {
                    where = where.And(item => item.IsDel == isDel);
                }

                return(mainContext.FindAll(where));
            }
        }
Beispiel #15
0
        private void LoadData()
        {
            if (expr == null)
            {
                expr = (Expression <Func <View_WeightSet, bool> >)PredicateExtensionses.True <View_WeightSet>();
            }

            if (cbxTestItem2.Text != "")
            {
                expr = expr.And(n => n.TestItems_ID == Convert.ToInt32(cbxTestItem2.SelectedValue) + 1);
            }

            if (cbxWeightNum2.Text != "")
            {
                expr = expr.And(n => n.WeightSet_weightNum == (cbxWeightNum2.SelectedIndex));
            }
            dgvView_WaterSet.AutoGenerateColumns = false;
            dgvView_WaterSet.DataSource          = page.BindBoundControl <View_WeightSet>("", txtCurrentPage1, lblPageCount1, expr, "WeightSet_id");
        }
Beispiel #16
0
 /// <summary>
 /// 单击查询按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         string begin = dateTimePicker1.Value.ToString(); // + " 00:00:00"
         string end   = dateTimePicker2.Value.ToString(); // + "23:59:59 "
         expr = (Expression <Func <SMSRecord, bool> >)PredicateExtensionses.True <SMSRecord>();
         if (!string.IsNullOrEmpty(txtCNTR_NO.Text.Trim()))
         {
             expr = expr.And(c => SqlMethods.Like(c.SMSRecord_DRAW_EXAM_INTERFACE_CNTR_NO, "%" + txtCNTR_NO.Text.Trim() + "%"));
         }
         if (cboUnusualType_Name.SelectedIndex > -1)
         {
             expr = expr.And(c => SqlMethods.Like(c.SMSRecord_Unusual_Id.ToString(), "%" + cboUnusualType_Name.SelectedValue.ToString() + "%"));
         }
         if (!string.IsNullOrEmpty(txtReceivePhone.Text.Trim()))
         {
             expr = expr.And(c => SqlMethods.Like(c.SMSRecord_ReceivePhone.ToString(), "%" + txtReceivePhone.Text.Trim() + "%"));
         }
         if (Convert.ToDateTime(begin) > Convert.ToDateTime(end))
         {
             MessageBox.Show("查询起止时间不能大于截止时间");
             return;
         }
         //时间
         if (!string.IsNullOrEmpty(dateTimePicker1.Value.ToString()))
         {
             expr = expr.And(n => n.SMSRecord_SendTime >= Common.GetDateTime(begin));
         }
         if (!string.IsNullOrEmpty(dateTimePicker2.Value.ToString()))
         {
             expr = expr.And(n => n.SMSRecord_SendTime <= Common.GetDateTime(end));
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         LoadData("");
     }
 }
Beispiel #17
0
        public ActionResult Index(int Reward = -1, int Page = 1, int pageSize = 10)
        {
            int pageNumber = Page / 1;

            Expression <Func <GrabIphone, bool> > where = PredicateExtensionses.True <GrabIphone>();
            where = where.And(p => p.ID > 0);
            if (Reward != -1)
            {
                where = where.And(p => p.WinningState == Reward);
            }


            IPagedList <GrabIphone> list = ef.GrabIphone.Where(where).OrderByDescending(p => p.ID).ToPagedList(pageNumber, pageSize);


            ViewBag.Reward = Reward;

            return(View(list));
        }
Beispiel #18
0
        public ActionResult Index(string username = "", int state = 0)
        {
            Expression <Func <v_adminuser_department, bool> > where = PredicateExtensionses.True <v_adminuser_department>();
            where = where.And(p => p.adminuserid > 0);
            if (!string.IsNullOrEmpty(username))
            {
                where = where.And(p => p.adminuser.Contains(username));
            }
            if (state > 0)
            {
                where = where.And(p => p.state == state);
            }
            List <v_adminuser_department> list = ef.v_adminuser_department.Where(where).OrderByDescending(a => a.adminuserid).ToList();

            ViewBag.username = username;
            ViewBag.state    = state;

            return(View(list));
        }
Beispiel #19
0
        public ActionResult MyborrowidList(string Username = "", string userTel = "", string time1 = "", string time2 = "", int BorrType = -1, int Page = 1, int pageSize = 10)
        {
            int pageNumber = Page / 1;

            Expression <Func <hx_td_Myborrow, bool> > where = PredicateExtensionses.True <hx_td_Myborrow>();
            where = where.And(p => p.Myborrowid > 0);
            if (!string.IsNullOrEmpty(Username))
            {
                where = where.And(p => p.Username.Contains(Username));
            }
            if (!string.IsNullOrEmpty(userTel))
            {
                where = where.And(p => p.userTel.Contains(userTel));
            }
            if (!string.IsNullOrEmpty(time1))
            {
                DateTime dt1 = Convert.ToDateTime(time1);
                where = where.And(a => ((DateTime)a.EntryTime).CompareTo(dt1) >= 0);
            }

            if (!string.IsNullOrEmpty(time2))
            {
                DateTime dt2 = Convert.ToDateTime(time2);
                dt2   = Convert.ToDateTime(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
                where = where.And(a => ((DateTime)a.EntryTime).CompareTo(dt2) <= 0);
            }

            if (BorrType > -1)
            {
                where = where.And(p => p.BorrType == BorrType);
            }

            IPagedList <hx_td_Myborrow> list = ef.hx_td_Myborrow.Where(where).OrderByDescending(p => p.Myborrowid).ToPagedList(pageNumber, pageSize);

            ViewBag.Username = Username;
            ViewBag.userTel  = userTel;
            ViewBag.time1    = time1;
            ViewBag.time2    = time2;
            ViewBag.BorrType = BorrType;

            return(View(list));
        }
Beispiel #20
0
        /// <summary>
        /// 搜索
        /// </summary>
        private void selectTJ()
        {
            try
            {
                if (expr == null)
                {
                    //expr = PredicateExtensionses.True<PresetTare>();
                    expr = (Expression <Func <View_PresetTare_Dictionary, bool> >)PredicateExtensionses.True <View_PresetTare_Dictionary>();
                }
                int i = 0;
                if (this.cbxSeachState.SelectedValue != null)//预置皮重状态
                {
                    int stateID = Converter.ToInt(cbxSeachState.SelectedValue.ToString());
                    if (stateID > 0)
                    {
                        expr = expr.And(n => n.PresetTare_Dictionary_ID == Converter.ToInt(cbxSeachState.SelectedValue.ToString()));

                        i++;
                    }
                }
                if (this.txtName.Text != "")//预置皮重名称
                {
                    //expr = expr.And(n => n.PresetTare_NAME.Contains(txtName.Text).ToString() == txtName.Text.Trim());
                    expr = expr.And(n => n.PresetTare_NAME.Contains(txtName.Text));

                    i++;
                }
                if (i == 0)
                {
                    expr = null;
                }
            }
            catch (Exception ex)
            {
                Common.WriteTextLog("预置皮重管理 selectTJ()" + ex.Message.ToString());
            }
            finally
            {
                page = new PageControl();
                LoadData();
            }
        }
Beispiel #21
0
        public ActionResult Index(string title1 = "", string realname = "", int Page = 1, int pageSize = 10)
        {
            int pageNumber = Page / 1;

            Expression <Func <V_borrowing_target_addlist, bool> > where = PredicateExtensionses.True <V_borrowing_target_addlist>();
            where = where.And(p => p.targetid > 0);
            if (!string.IsNullOrEmpty(title1))
            {
                where = where.And(p => p.borrowing_title.Contains(title1));
            }
            if (!string.IsNullOrEmpty(realname))
            {
                where = where.And(p => p.realname == realname);
            }
            IPagedList <V_borrowing_target_addlist> list = ef.V_borrowing_target_addlist.Where(where).OrderByDescending(p => p.targetid).ToPagedList(pageNumber, pageSize);

            ViewBag.title2   = title1;
            ViewBag.realname = realname;

            return(View(list));
        }
Beispiel #22
0
        public ActionResult Index(string news_title = "", int rootid = 0, int Page = 1, int pageSize = 10)
        {
            int pageNumber = Page / 1;

            Expression <Func <V_type_news, bool> > where = PredicateExtensionses.True <V_type_news>();
            where = where.And(p => p.newid > 0);

            where = where.And(p => p.rootid == rootid);

            if (!string.IsNullOrEmpty(news_title))
            {
                where = where.And(p => p.News_title.Contains(news_title));
            }

            IPagedList <V_type_news> list = ef.V_type_news.Where(where).OrderByDescending(p => p.newid).ToPagedList(pageNumber, pageSize);

            ViewBag.news_title = news_title;
            ViewBag.rootid     = rootid;
            ViewBag.page       = Page;
            return(View(list));
        }
Beispiel #23
0
        /// <summary>
        /// 单击查询按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                int    index = 0;
                string begin = dateTimePicker1.Value.ToString(); // + " 00:00:00"
                string end   = dateTimePicker2.Value.ToString(); // + "23:59:59 "
                expr = (Expression <Func <View_UnusualImage, bool> >)PredicateExtensionses.True <View_UnusualImage>();
                if (!string.IsNullOrEmpty(txtQCInfo_QCInfo_ID.Text.Trim()))
                {
                    expr = expr.And(c => SqlMethods.Like(c.ImageRecord_Id.ToString(), "%" + txtQCInfo_QCInfo_ID.Text.Trim() + "%"));
                    index++;
                }
                //时间
                if (!string.IsNullOrEmpty(dateTimePicker1.Value.ToString()))
                {
                    expr = expr.And(n => n.ImageRecord_Time >= Common.GetDateTime(begin));
                    index++;
                }
                if (!string.IsNullOrEmpty(dateTimePicker2.Value.ToString()))
                {
                    expr = expr.And(n => n.ImageRecord_Time <= Common.GetDateTime(end));
                    index++;
                }

                if (index == 0)
                {
                    expr = null;
                }
            }
            catch (System.Exception ex)
            {
                //MessageBox.Show(ex.Message);
            }
            finally
            {
                LoadData("");
            }
        }
Beispiel #24
0
        public ActionResult ChannelUserList(int page = 1, int pagesize = 10)
        {
            int    pageIndex     = page / 1;
            string adminUserName = Utils.CheckSQLHtml(DNTRequest.GetString("AdminUserName"));
            string username      = Utils.CheckSQLHtml(DNTRequest.GetString("UserName"));
            string startTime     = DNTRequest.GetString("StartTime");
            string endTime       = DNTRequest.GetString("EndTime");

            Expression <Func <V_Channel_UserList, bool> > where = PredicateExtensionses.True <V_Channel_UserList>();
            if (!string.IsNullOrEmpty(adminUserName))
            {
                where = where.And(p => p.AdminUserName.Contains(adminUserName.Trim()));
            }
            if (!string.IsNullOrEmpty(username))
            {
                where = where.And(p => p.username.Contains(username.Trim()));
            }
            if (!string.IsNullOrEmpty(startTime) && startTime != "")
            {
                DateTime stime = Convert.ToDateTime(startTime);
                where = where.And(p => DbFunctions.DiffDays(p.registration_time, stime) <= 0);
                DateTime etime = DateTime.Now;
                if (!string.IsNullOrEmpty(endTime) && endTime != "")
                {
                    etime = Convert.ToDateTime(endTime);
                }
                etime = etime.AddDays(1).AddSeconds(-1);
                where = where.And(p => DbFunctions.DiffDays(p.registration_time, etime) >= 0);
            }
            var list = ef.V_Channel_UserList.Where(where).OrderByDescending(p => p.registration_time).ToPagedList(pageIndex, pagesize);

            ViewBag.AdminUserName  = adminUserName;
            ViewBag.Username       = username;
            ViewBag.StartTime      = startTime;
            ViewBag.EndTime        = endTime;
            ViewBag.TotalItemCount = list.TotalItemCount;
            ViewBag.TotalPageCount = (list.TotalItemCount - 1) / pagesize + 1;
            return(View(list));
        }
Beispiel #25
0
        public ActionResult LLPayList(string orderNO = "", int paystate = -1, string txtStart = "", string txtEnd = "", int Page = 1, int pageSize = 10)
        {
            int pageNumber = Page / 1;

            Expression <Func <V_LLPay_Re, bool> > where = PredicateExtensionses.True <V_LLPay_Re>();
            where = where.And(p => p.Rechargeid > 0);

            if (!string.IsNullOrEmpty(orderNO))
            {
                where = where.And(p => p.no_order.Contains(orderNO));
            }
            if (paystate >= 0)
            {
                where = where.And(p => p.ReState == paystate);
            }
            if (!string.IsNullOrEmpty(txtStart))
            {
                DateTime dtStart = Convert.ToDateTime(txtStart);
                where = where.And(p => Convert.ToDateTime(p.ordertime) >= dtStart);
                // where = where.And(p => DbFunctions.DiffDays(p.ordertime, dtStart) <= 0);
            }

            if (!string.IsNullOrEmpty(txtEnd))
            {
                DateTime dtEnd = Convert.ToDateTime(txtEnd);
                where = where.And(p => Convert.ToDateTime(p.ordertime) <= dtEnd);
            }


            IPagedList <V_LLPay_Re> list = ef.V_LLPay_Re.Where(where).OrderByDescending(p => p.Rechargeid).ToPagedList(pageNumber, pageSize);

            ViewBag.orderNO  = orderNO;
            ViewBag.paystate = paystate;
            ViewBag.txtStart = txtStart;
            ViewBag.txtEnd   = txtEnd;

            return(View(list));
        }
Beispiel #26
0
        public ActionResult Index(string orderNO = "", int paystate = -1, string txtStart = "", string txtEnd = "", int Page = 1, int pageSize = 10)
        {
            int pageNumber = Page / 1;

            //var datas = from a in ef.V_Recharge_user_bank orderby a.recharge_history_id descending select new { a.recharge_history_id, a.recharge_amount, a.recharge_time, a.account_amount, a.order_No, a.recharge_condition, a.recharge_bank, a.username, a.BankName, a.realname };

            Expression <Func <V_Recharge_user_bank, bool> > where = PredicateExtensionses.True <V_Recharge_user_bank>();
            where = where.And(p => p.recharge_history_id > 0);
            if (!string.IsNullOrEmpty(orderNO))
            {
                //datas = datas.Where(p => p.order_No.Contains(orderNO));
                where = where.And(p => p.order_No.Contains(orderNO));
            }
            if (paystate >= 0)
            {
                where = where.And(p => p.recharge_condition == paystate);
            }
            if (!string.IsNullOrEmpty(txtStart))
            {
                DateTime dtStart = Convert.ToDateTime(txtStart);
                where = where.And(p => DbFunctions.DiffDays(p.recharge_time, dtStart) <= 0);
            }

            if (!string.IsNullOrEmpty(txtEnd))
            {
                DateTime dtEnd = Convert.ToDateTime(txtEnd);
                where = where.And(p => DbFunctions.DiffDays(p.recharge_time, dtEnd) >= 0);
            }

            IPagedList <V_Recharge_user_bank> list = ef.V_Recharge_user_bank.Where(where).OrderByDescending(p => p.recharge_history_id).ToPagedList(pageNumber, pageSize);

            ViewBag.orderNO  = orderNO;
            ViewBag.paystate = paystate;
            ViewBag.txtStart = txtStart;
            ViewBag.txtEnd   = txtEnd;

            return(View(list));
        }
Beispiel #27
0
        private void LoadData(string clickName)
        {
            expr = (Expression <Func <View_PacketsRecord, bool> >)PredicateExtensionses.True <View_PacketsRecord>();
            if (txtCNTR_NO.Text.Trim() != "")
            {
                expr = expr.And(c => SqlMethods.Like(c.CNTR_NO, "%" + txtCNTR_NO.Text.Trim() + "%"));
            }

            if (txtSHIPMENT_NO.Text.Trim() != "")
            {
                expr = expr.And(c => SqlMethods.Like(c.SHIPMENT_NO, "%" + txtSHIPMENT_NO.Text.Trim() + "%"));
            }
            if (txtPO_NO.Text.Trim() != "")
            {
                expr = expr.And(c => SqlMethods.Like(c.PO_NO, "%" + txtPO_NO.Text.Trim() + "%"));
            }

            if (cbxPROD_ID.Text.Trim() != "")
            {
                expr = expr.And(c => SqlMethods.Like(c.PROD_ID, "%" + cbxPROD_ID.Text.Trim() + "%"));
            }
            if (comboBox2.Text.Trim() == "是")
            {
                expr = expr.And(c => c.Packets_this_Update != "" || c.Packets_this_Update != null);
            }
            if (comboBox1.Text.Trim() == "是")
            {
                expr = expr = expr.And(n => n.Packets_this.ToString().Replace("+", "").Replace("-", "") == n.Packets_this_Update);
            }

            if (txtbeginTime.Value != null && txtendTime.Value != null)
            {
                expr = expr.And(c => c.Packets_Time >= Convert.ToDateTime(txtbeginTime.Value.ToString("yyyy-MM-dd")) && c.Packets_Time <= Convert.ToDateTime(txtendTime.Value.ToString("yyyy-MM-dd")));
            }

            page.PageMaxCount      = tscbxPageSize2.SelectedItem.ToString();
            lvwUserList.DataSource = page.BindBoundControl <View_PacketsRecord>(clickName, txtCurrentPage2, lblPageCount2, expr, orderbywhere);
        }
Beispiel #28
0
        public ActionResult Index(string username = "", int OrdIdState = -1, int ddlType = 4, int Page = 1, int pageSize = 10)
        {
            int pageNumber = Page / 1;

            Expression <Func <V_LL_Cash_User, bool> > where = PredicateExtensionses.True <V_LL_Cash_User>();
            where = where.And(p => p.LLcashid > 0);

            if (!String.IsNullOrEmpty(username))
            {
                where = where.And(p => p.acct_name.Contains(username));
            }
            if (OrdIdState >= 0)
            {
                where = where.And(p => p.paystate == (OrdIdState));
            }
            IPagedList <V_LL_Cash_User> list = ef.V_LL_Cash_User.Where(where).OrderByDescending(p => p.LLcashid).ToPagedList(pageNumber, pageSize);

            ViewBag.username   = username;
            ViewBag.OrdIdState = OrdIdState;
            ViewBag.ddlType    = ddlType;

            return(View(list));
        }
Beispiel #29
0
        public ActionResult Index(string linkname = "", int linktype = 0, int linkstate = 0, int Page = 1, int pageSize = 10)
        {
            int pageNumber = Page / 1;

            Expression <Func <hx_td_Links, bool> > where = PredicateExtensionses.True <hx_td_Links>();
            where = where.And(p => p.Linkid > 0);



            if (!string.IsNullOrEmpty(linkname))
            {
                where = where.And(p => p.Linkname.Contains(linkname));
            }
            if (linktype == 1)
            {
                where = where.And(p => p.LinkType == 0);
            }
            else if (linktype == 2)
            {
                where = where.And(p => p.LinkType == 1);
            }
            if (linkstate == 1)
            {
                where = where.And(p => p.Linkstate == 0);
            }
            else if (linkstate == 2)
            {
                where = where.And(p => p.Linkstate == 1);
            }
            IPagedList <hx_td_Links> list = ef.hx_td_Links.Where(where).OrderByDescending(p => p.Linkid).ToPagedList(pageNumber, pageSize);

            ViewBag.linkname  = linkname;
            ViewBag.linktype  = linktype;
            ViewBag.linkstate = linkstate;

            return(View(list));
        }
Beispiel #30
0
        public JsonResult GetStoreCargo1()
        {
            int _userid = (int)Session["user_id"];
            var _mxid   = Request["mx"] ?? "";
            var _hzid   = Request["hz"] ?? "";
            var _spid   = Request["sp"] ?? "";
            var _ph     = Request["ph"] ?? "";
            var _xlm    = Request["xlm"] ?? "";
            int _custid = 0;

            if (string.IsNullOrEmpty(_mxid) || string.IsNullOrEmpty(_hzid))
            {
                return(Json(-1));
            }
            _custid = int.Parse(_hzid);
            Expression <Func <wms_inventory_v, bool> > where = PredicateExtensionses.True <wms_inventory_v>();
            if (!string.IsNullOrEmpty(_spid))
            {
                where = where.And(p => p.ShangpinID == int.Parse(_spid));
            }
            if (!string.IsNullOrEmpty(_ph))
            {
                where = where.And(p => p.Pihao == _ph);
            }
            if (!string.IsNullOrEmpty(_xlm))
            {
                where = where.And(p => p.Xuliema == _xlm);
            }
            where = where.And(p => p.sshuliang > 0);
            var tempData = ServiceFactory.wms_cunhuoservice.GetInventory(where.Compile());

            if (tempData == null)
            {
                return(Json(-1));
            }
            return(Json(tempData.ToList()));
        }