protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                GetCompanyCussent();
                GetWarehouseList();
                LoadStorageType();
                CompanyId = Guid.Empty;
                DdlSaleFiliale.DataSource = null;
                DdlSaleFiliale.DataBind();


                var yearlist = new List <int>();
                for (var i = 2007; i <= (DateTime.Now.Year - GlobalConfig.KeepYear); i++)
                {
                    yearlist.Add(i);
                }
                DDL_Years.DataSource = yearlist.OrderByDescending(y => y);
                DDL_Years.DataBind();
                DDL_Years.Items.Add(new ListItem(GlobalConfig.KeepYear + "年内数据", "0"));
                DDL_Years.SelectedValue = "0";

                YearSelected();
            }
        }
Esempio n. 2
0
        private void BindSaleFiliales()
        {
            List <FilialeInfo> dataSource = new List <FilialeInfo> {
                new FilialeInfo
                {
                    ID = Guid.Empty, Name = ""
                }
            };

            dataSource.AddRange(FilialeManager.GetB2CFilialeList());
            DdlSaleFiliale.DataSource = dataSource;
            DdlSaleFiliale.DataBind();
            DdlSaleFiliale.SelectedValue = string.Format("{0}", Guid.Empty);
        }
Esempio n. 3
0
        /// <summary>
        /// 绑定公司
        /// </summary>
        /// <returns></returns>
        protected void LoadFilialeData()
        {
            var newDic = new Dictionary <string, string> {
                { Guid.Empty.ToString(), string.Empty }
            };

            foreach (var info in SaleFilialeList)
            {
                newDic.Add(info.ID.ToString(), info.Name);
            }
            newDic.Add(_reckoningElseFilialeid.ToString(), "ERP");

            DdlSaleFiliale.DataSource     = newDic;
            DdlSaleFiliale.DataTextField  = "Value";
            DdlSaleFiliale.DataValueField = "Key";
            DdlSaleFiliale.DataBind();
        }
        protected void RCBWarehouse_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            var cb = (RadComboBox)sender;

            if (cb != null)
            {
                var warehouse = WarehouseAuth.FirstOrDefault(act => act.WarehouseId == new Guid(cb.SelectedItem.Value));
                var filiales  = new List <HostingFilialeAuth> {
                    new HostingFilialeAuth {
                        HostingFilialeId = Guid.Empty, HostingFilialeName = "请选择物流公司"
                    }
                };
                if (warehouse != null)
                {
                    foreach (var hostingFilialeAuth in warehouse.FilialeAuths)
                    {
                        if (filiales.Any(act => act.HostingFilialeId == hostingFilialeAuth.HostingFilialeId))
                        {
                            continue;
                        }
                        filiales.Add(hostingFilialeAuth);
                        foreach (var proxyFiliale in hostingFilialeAuth.ProxyFiliales.Where(proxyFiliale => filiales.All(ent => ent.HostingFilialeId != proxyFiliale.ProxyFilialeId)))
                        {
                            filiales.Add(new HostingFilialeAuth
                            {
                                HostingFilialeId   = proxyFiliale.ProxyFilialeId,
                                HostingFilialeName = proxyFiliale.ProxyFilialeName
                            });
                        }
                    }
                }
                if (filiales.Count == 1)
                {
                    DdlSaleFiliale.Items.Clear();
                    return;
                }
                DdlSaleFiliale.DataSource = filiales.ToDictionary(k => k.HostingFilialeId, v => v.HostingFilialeName);
                DdlSaleFiliale.DataBind();
            }
        }