Ejemplo n.º 1
0
        /// <summary>
        /// 入库仓Changed事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void DDLWaerhouse_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            Guid warehouseId = string.IsNullOrEmpty(RCB_Warehouse.SelectedValue)
               ? Guid.Empty
               : new Guid(RCB_Warehouse.SelectedValue);

            //获得入库储
            var personinfo    = CurrentSession.Personnel.Get();
            var warehouseAuth = WMSSao.GetSingleWarehouseAndFilialeAuth(personinfo.PersonnelId, warehouseId);
            //获得物流配送公司
            var hlist        = new List <HostingFilialeAuth>();
            var saleFiliales = new List <HostingFilialeAuth>();

            if (warehouseAuth != null)
            {
                foreach (var filialeAuth in warehouseAuth.FilialeAuths)
                {
                    hlist.Add(filialeAuth);
                    foreach (var filiale in filialeAuth.ProxyFiliales)
                    {
                        if (hlist.All(p => p.HostingFilialeId != filiale.ProxyFilialeId) && saleFiliales.All(ent => ent.HostingFilialeId != filiale.ProxyFilialeId))
                        {
                            saleFiliales.Add(new HostingFilialeAuth {
                                HostingFilialeId = filiale.ProxyFilialeId, HostingFilialeName = filiale.ProxyFilialeName
                            });
                        }
                    }
                }
            }
            RCB_Filile.DataSource     = hlist.Union(saleFiliales);
            RCB_Filile.DataTextField  = "HostingFilialeName";
            RCB_Filile.DataValueField = "HostingFilialeId";
            RCB_Filile.DataBind();
            RCB_Filile.Items.Insert(0, new RadComboBoxItem("全部", Guid.Empty.ToString()));
        }