/// <summary>
        /// 绑定单位
        /// </summary>
        private void BindCustomer(double labid)
        {
            List <Dictcustomer> CustomerList = loginservice.GetDictcustomer();

            if (labid == 0)
            {
                List <Dictlab>      dictList         = loginservice.GetPermissionDictlab(Userinfo);
                List <Dictcustomer> dictcustomerback = new List <Dictcustomer>();
                foreach (Dictlab dict in dictList)
                {
                    List <Dictcustomer> dictcustomerfirt = CustomerList.FindAll(c => c.Dictlabid == dict.Dictlabid);
                    foreach (Dictcustomer dictcust in dictcustomerfirt)
                    {
                        dictcustomerback.Add(dictcust);
                    }
                }

                DropCustomer.DataSource     = dictcustomerback;// CustomerList.Where<Dictcustomer>(c => c.Dictlabid == labid);
                DropCustomer.DataValueField = "Dictcustomerid";
                DropCustomer.DataTextField  = "Customername";
                DropCustomer.DataBind();
                DropCustomer.Items.Insert(0, new ExtAspNet.ListItem("请选择", "-1"));
            }
            else
            {
                DropCustomer.DataSource     = CustomerList.Where <Dictcustomer>(c => c.Dictlabid == labid);
                DropCustomer.DataValueField = "Dictcustomerid";
                DropCustomer.DataTextField  = "Customername";
                DropCustomer.DataBind();
                DropCustomer.Items.Insert(0, new ExtAspNet.ListItem("请选择", "-1"));
            }
        }
Beispiel #2
0
        /// <summary>
        /// 绑定单位
        /// </summary>
        private void BindCustomer(double labid)
        {
            List <Dictcustomer> CustomerList = loginservice.GetDictcustomer();

            DropCustomer.DataSource     = CustomerList.Where <Dictcustomer>(c => (c.Dictlabid == labid && c.Customertype == "0" && c.Active == "1") || c.IsPublic == "1");
            DropCustomer.DataValueField = "Dictcustomerid";
            DropCustomer.DataTextField  = "Customername";
            DropCustomer.DataBind();
            DropCustomer.Items.Insert(0, new ListItem("请选择体检单位", "-1"));
        }
Beispiel #3
0
        private void BindCustomer()
        {
            List <Dictcustomer> CustomerList = loginservice.GetDictcustomer();

            DropCustomer.DataSource     = CustomerList.Where <Dictcustomer>(v => v.Dictsalemanid == Userinfo.userId && v.Active == "1" && v.Customertype == "0");
            DropCustomer.DataValueField = "Dictcustomerid";
            DropCustomer.DataTextField  = "Customername";
            DropCustomer.DataBind();
            DropCustomer.Items.Insert(0, new ExtAspNet.ListItem("全部", "-1"));
        }
Beispiel #4
0
        private void SelectCustomer()
        {
            string cusName = tbxmember.Text.Trim();

            if (string.IsNullOrEmpty(cusName))
            {
                //体检单位初始化
                BindCustomer(Convert.ToInt32(DropDictLab.SelectedValue));
            }
            else
            {
                string labid = string.Empty;
                if (DropDictLab.SelectedValue == "-1")
                {
                    labid = Userinfo.joinLabidstr;
                }
                else
                {
                    labid = DropDictLab.SelectedValue;
                }
                Hashtable htPara = new Hashtable();
                htPara.Add("labid", labid);
                htPara.Add("customername", cusName);

                DataTable dtList = new DictCustomerService().GetCustomerListBySearchBox(htPara);
                if (dtList == null || dtList.Rows.Count == 0)
                {
                    MessageBoxShow("没有搜索到匹配的体检单位!");
                    tbxmember.Text = string.Empty;
                    tbxmember.Focus();
                    return;
                }
                else if (dtList.Rows.Count == 1)
                {
                    DropCustomer.SelectedValue = dtList.Rows[0]["dictcustomerid"].ToString();
                    tbxmember.Text             = string.Empty;
                }
                else
                {
                    DropCustomer.DataSource     = dtList;
                    DropCustomer.DataValueField = "Dictcustomerid";
                    DropCustomer.DataTextField  = "Customername";
                    DropCustomer.DataBind();
                    tbxmember.Text = string.Empty;
                }
            }
        }
Beispiel #5
0
        //绑定单位
        private void BindCustomer(double?labid)
        {
            List <Dictcustomer> CustomerList = loginservice.GetDictcustomer();

            var customer = CustomerList.Where <Dictcustomer>(c => c.Dictlabid == labid && c.Customertype == "0" && c.Active == "1");//

            DropCustomer.DataSource     = customer;
            DropCustomer.DataValueField = "Dictcustomerid";
            DropCustomer.DataTextField  = "Customername";
            DropCustomer.DataBind();



            //if (radlCustomerType.SelectedValue == "0")
            //{
            //    DropCustomer.Items.Insert(0, new ExtAspNet.ListItem("个人客户", "-1"));
            //    DropCustomer.SelectedValue = "-1";
            //}
        }