示例#1
0
        /// <summary>
        ///     文本改变事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void tbxFCustomer_OnTextChanged(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(tbxFCustomer.Text.Trim()))
            {
                Window1.Hidden = true;
                Window2.Hidden = true;
                Window3.Hidden = true;

                var custmoer = ViewUnitService.Where(p => p.FName == tbxFCustomer.Text.Trim() && p.FCompanyId == CurrentUser.AccountComId).FirstOrDefault();
                if (custmoer != null)
                {
                    txtFCode.Text    = custmoer.FCode;
                    txtFAddress.Text = custmoer.FAddress.Trim();
                    txtFLinkman.Text = custmoer.FLinkman;
                    txtFPhone.Text   = custmoer.FPhome;
                }
            }
        }
示例#2
0
        /// <summary>
        ///     绑定数据表格
        /// </summary>
        private void BindDataGrid()
        {
            int output;

            dynamic orderingSelector;
            Expression <Func <vm_Unit, bool> > predicate = BuildPredicate(out orderingSelector);

            //取数据源
            IQueryable <vm_Unit> list = ViewUnitService.Where(predicate, Grid1.PageSize, Grid1.PageIndex + 1,
                                                              orderingSelector, EnumHelper.ParseEnumByString <OrderingOrders>(SortDirection), out output);

            //设置页面大小
            Grid1.RecordCount = output;

            //绑定数据源
            Grid1.DataSource = list;
            Grid1.DataBind();

            ddlPageSize.SelectedValue = Grid1.PageSize.ToString(CultureInfo.InvariantCulture);
        }
示例#3
0
        /// <summary>
        ///     ProcessRequest
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            string code = context.Request.QueryString["term"];

            if (!string.IsNullOrEmpty(code))
            {
                var service = new ViewUnitService();

                var ja = new JArray();

                foreach (
                    var custmoer in
                    service.Where(
                        p => ((p.FCode.Contains(code) || p.FName.Contains(code)) ||
                              p.FSpell.Contains(code))).OrderBy(p => p.FName).Take(10))
                {
                    ja.Add(string.Format("{0}", custmoer.FName));
                }

                context.Response.ContentType = "text/plain";
                context.Response.Write(ja.ToString());
            }
        }