Exemplo n.º 1
0
        protected void RcbShopListItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            IDictionary <Guid, string> dics = FilialeManager.GetAllianceFilialeList()
                                              .Where(act => act.Rank == (int)FilialeRank.Partial).ToDictionary(k => k.ID, v => v.Name);
            var combo = (RadComboBox)o;

            combo.Items.Clear();
            var list = !string.IsNullOrEmpty(e.Text) && e.Text.Length >= 1 ? dics.Where(act => act.Value.Contains(e.Text))
                : dics;
            var keyValuePairs = list as KeyValuePair <Guid, string>[] ?? list.ToArray();

            if (e.NumberOfItems >= keyValuePairs.Count())
            {
                e.EndOfItems = true;
            }
            else
            {
                foreach (var item in keyValuePairs)
                {
                    var rcb = new RadComboBoxItem
                    {
                        Text  = item.Value,
                        Value = item.Key + "",
                    };
                    combo.Items.Add(rcb);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 绑定联盟店铺
        /// </summary>
        protected void BindShopList()
        {
            IDictionary <Guid, string> dics = FilialeManager.GetAllianceFilialeList()
                                              .Where(act => act.Rank == (int)FilialeRank.Partial)
                                              .ToDictionary(k => k.ID, v => v.Name);

            RcbShopList.DataSource = dics;
            RcbShopList.DataBind();
            RcbShopList.Items.Insert(0, new RadComboBoxItem("", string.Format("{0}", Guid.Empty)));
        }
Exemplo n.º 3
0
        //门店
        protected void LoadShopData()
        {
            var shopList = FilialeManager.GetAllianceFilialeList().Where(act => act.Rank == (int)FilialeRank.Partial &&
                                                                         act.ShopJoinType == (int)ShopJoinType.DirectSales).OrderBy(act => act.Name);

            ddl_AssumeShop.DataSource     = shopList;
            ddl_AssumeShop.DataTextField  = "Name";
            ddl_AssumeShop.DataValueField = "ID";
            ddl_AssumeShop.DataBind();
            ddl_AssumeShop.Items.Insert(0, new ListItem("请选择", ""));
        }
Exemplo n.º 4
0
        public void GetGoodsInfoTest()
        {
            //var list = GoodsManager.GetRealGoodsIdListByGoodsNameOrCode("4544848122");
            //var goodsInfo = GoodsManager.GetGoodsBaseInfoByGoodsCode("盘点测试01(勿动)");
            //var goodsInfo1 = GoodsManager.GetGoodsBaseInfoByGoodsCode("4544848122");

            var shopFilialeList = FilialeManager.GetAllianceFilialeList();
            var shopList        = FilialeManager.GetEntityShop();
            var info            = shopFilialeList.Where(act => act.Rank == (int)MIS.Enum.FilialeRank.Partial).ToDictionary(k => k.ID, v => v.Name);

            Assert.IsTrue(true);
        }
Exemplo n.º 5
0
 public void TestGetAllianceFilialeList()
 {
     using (ShimsContext.Create())
     {
         //模拟返回结果
         ShimFilialeSao.GetAllFiliale = () => new List <FilialeInfo>
         {
             new FilialeInfo {
                 ID = new Guid("6E677868-AE98-4932-B4DB-0000020DC859"), Type = (int)FilialeType.EntityShop, IsActive = false
             },
             new FilialeInfo {
                 ID = new Guid("7E677868-AE98-4932-B4DB-0000020DC859"), Type = (int)FilialeType.SaleCompany, IsActive = false
             },
             new FilialeInfo {
                 ID = new Guid("8E677868-AE98-4932-B4DB-0000020DC859"), Type = (int)FilialeType.EntityShop, IsActive = true
             }
         };
         var result = FilialeManager.GetAllianceFilialeList();
         Assert.IsNotNull(result);
     }
 }