Exemplo n.º 1
0
        private void BaseButton_Search_Click(object sender, EventArgs e)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                isBarCode = false;
                string costumeID = this.skinTextBox1.SkinTxt.Text.Trim();
                //if (string.IsNullOrEmpty(costumeID))
                //{
                //    return;
                //}

                //条形码,先根据条形码获取款号
                //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper()));

                ////,条形码为一条,找到这个款号
                //if (barCodes != null && barCodes.Count == 1)
                //{
                //    costumeID = barCodes[0].CostumeID;
                //    this.skinTextBox1.SkinTxt.Text = barCodes[0].BarCodeValue;
                //    isBarCode = true;
                //}
                if (costumeID.Length == 15)
                {
                    BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID);
                    if (costume != null)
                    {
                        costumeID = costume.CostumeID;
                        skinTextBox1.SkinTxt.Text = costume.BarCode;
                        isBarCode = true;
                    }
                }

                List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => (t.ID.ToUpper().Contains(costumeID.ToUpper())));
                if (filterValid)
                {
                    resultList = resultList.FindAll(t => t.IsValid);
                }

                /* this.currentLeftCostumeitems = CommonGlobalCache.ServerProxy.GetCostumeStores(new CostumeStoreListPara() {
                 *   CostumeID = costumeID,
                 *   ShopID = this.ShopID,
                 *   IsOnlyShowValid = filterValid
                 * });*/
                this.currentCostume = resultList;
                this.SetLeftDataSource();
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemplo n.º 2
0
        private void BaseButton1_Click(object sender, EventArgs e)
        {
            try
            {
                string costumeID = this.skinTextBox1.SkinTxt.Text.Trim();
                if (string.IsNullOrEmpty(costumeID))
                {
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                //条形码,先根据条形码获取款号
                //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper()));

                ////,条形码为一条,找到这个款号
                //if (barCodes != null && barCodes.Count == 1)
                //{
                //    costumeID = barCodes[0].CostumeID;
                //    this.skinTextBox1.SkinTxt.Text = barCodes[0].BarCodeValue;

                //}
                if (costumeID.Length == 15)
                {
                    BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID);
                    if (costume != null)
                    {
                        costumeID = costume.CostumeID;
                        skinTextBox1.SkinTxt.Text = costume.BarCode;
                        //  isBarCode = true;
                    }
                }

                List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => t.SupplierID == this.SupplierID && t.ID.ToUpper().Contains(costumeID.ToUpper()));
                if (filterValid)
                {
                    resultList = resultList.FindAll(t => t.IsValid);
                }


                if (this.BrandID != -1 && resultList != null)
                {
                    resultList = resultList.FindAll(t => t.BrandID == this.BrandID);
                }

                this.SetDataSource(resultList);
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemplo n.º 3
0
        private List <BarCode4Costume> GetDetailBarCodesCount(BoundDetail detail, string sizeName)
        {
            List <BarCode4Costume> barCode4Costumes = new List <BarCode4Costume>();
            //获取对应尺码的值

            short count = GetSizeCount(sizeName, detail);

            for (int i = 0; i < count; i++)
            {
                BarCode4Costume costume = new BarCode4Costume();
                ReflectionHelper.CopyProperty(detail, costume);
                costume.SizeName = sizeName;
                barCode4Costumes.Add(costume);
            }
            return(barCode4Costumes);
        }
Exemplo n.º 4
0
        private void SkinTxt_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            if (e.KeyCode != Keys.Enter)
            {
                return;
            }
            try
            {
                isBarCode = false;
                string costumeID = this.SkinTxt.Text.Trim();
                if (string.IsNullOrEmpty(costumeID))
                {
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(null);
                    }
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                //条形码,先根据条形码获取款号
                //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper()));

                ////,条形码为一条,找到这个款号
                //if (barCodes != null && barCodes.Count == 1)
                //{
                //    costumeID = barCodes[0].CostumeID;
                //    this.SkinTxt.Text = barCodes[0].BarCodeValue;
                //    isBarCode = true;
                //}
                if (costumeID.Length == 15)
                {
                    BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID);
                    if (costume != null)
                    {
                        costumeID    = costume.CostumeID;
                        SkinTxt.Text = costume.BarCode;
                        isBarCode    = true;
                    }
                }



                List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => t.ID.ToUpper().Contains(costumeID.ToUpper()) && t.IsValid == true);
                //  List<CostumeItem> resultList = GlobalCache.ServerProxy.GetPfCustomerStores("", costumeID);
                if (resultList == null || resultList.Count == 0)
                {
                    this.CostumeSelected?.Invoke(null);
                    //this.SkinTxt.Text = "";

                    return;
                }
                if (resultList.Count == 1)
                {
                    List <CostumeItem> OneresultList = GlobalCache.ServerProxy.GetPfCustomerStores(CustomerID, costumeID, true);
                    if (OneresultList.Count == 0)
                    {
                        CostumeItem createItem = new CostumeItem();

                        createItem.Costume          = resultList[0];
                        createItem.CostumeStoreList = SetupStores(resultList[0]);
                        OneresultList.Add(createItem);
                    }
                    OneresultList[0].Costume.BrandName    = CommonGlobalCache.GetBrandName(OneresultList[0].Costume.BrandID);
                    OneresultList[0].Costume.SupplierName = CommonGlobalCache.GetSupplierName(OneresultList[0].Costume.SupplierID);
                    if (OneresultList[0].CostumeStoreList != null)
                    {
                        foreach (var item in OneresultList[0].CostumeStoreList)
                        {
                            item.CostumeName = OneresultList[0].Costume.Name;
                            item.BrandName   = OneresultList[0].Costume.BrandName;
                            item.Price       = OneresultList[0].Costume.Price;
                        }
                    }


                    if (!isBarCode)
                    {
                        this.SkinTxt.Text = OneresultList[0].Costume.ID;
                    }
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(OneresultList[0]);
                    }
                }
                else
                {
                    PfCostumeFromShopForm costumeForm = new PfCostumeFromShopForm(resultList, costumeID, CustomerID, filterValid);
                    //   costumeForm.Hide();
                    // costumeForm.CostumeSelected += CostumeForm_CostumeSelected;
                    if (costumeForm.ShowDialog() == DialogResult.OK)
                    {
                        if (costumeForm.Result == null)
                        {
                            return;
                        }
                        this.SkinTxt.Text = costumeForm.Result.Costume.ID;
                        CostumeSelected?.Invoke(costumeForm.Result);
                    }
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemplo n.º 5
0
        public void Search()
        {
            try
            {
                isBarCode = false;
                string costumeID = this.Text.Trim();
                if (string.IsNullOrEmpty(costumeID))
                {
                    if (this.CostumeSelected != null)
                    {
                        curItem = null;
                        this.CostumeSelected(curItem, true);
                    }
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                //条形码,先根据条形码获取款号
                //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper()));

                ////,条形码为一条,找到这个款号
                //if (barCodes != null && barCodes.Count == 1)
                //{
                //    costumeID = barCodes[0].CostumeID;
                //    this.Text = barCodes[0].BarCodeValue;
                //    isBarCode = true;
                //}
                if (costumeID.Length == 15)
                {
                    BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID);
                    if (costume != null)
                    {
                        costumeID    = costume.CostumeID;
                        SkinTxt.Text = costume.BarCode;
                        isBarCode    = true;
                    }
                }

                List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => (t.ID.ToUpper().Contains(costumeID.ToUpper())));
                if (filterValid)
                {
                    resultList = resultList.FindAll(t => t.IsValid);
                }

                /*  CostumeItem t = new CostumeItem();
                 *
                 * List<CostumeItem> resultList = CommonGlobalCache.ServerProxy.GetCostumeStoreList(new CostumeStoreListPara()
                 * {
                 *    CostumeID = costumeID,
                 *    ShopID = this.ShopID,
                 *    IsOnlyShowValid = filterValid
                 * });
                 *
                 *
                 * //有供应商则过滤供应商
                 * if (SupplierID != null && resultList != null)
                 * {
                 *    resultList = resultList.FindAll(i => i.Costume.SupplierID == SupplierID);
                 * }*/
                if (resultList == null || resultList.Count == 0)
                {
                    if (this.CostumeSelected != null)
                    {
                        curItem = null;
                        this.CostumeSelected(curItem, true);
                    }
                    this.Text = "";
                    return;
                }
                if (resultList.Count == 1)
                {
                    if (!isBarCode)
                    {
                        this.Text = resultList[0].ID;
                    }
                    if (this.CostumeSelected != null)
                    {
                        Costume curCostume = resultList[0];
                        curItem = null; //根据条件获取库存信息

                        List <CostumeItem> selectResultItem = CommonGlobalCache.ServerProxy.GetCostumeStoreList(new CostumeStoreListPara()
                        {
                            CostumeID       = resultList[0].ID,
                            ShopID          = this.ShopID,
                            IsOnlyShowValid = filterValid,
                            IsAccurateQuery = true,
                        });

                        if (SupplierID != null && resultList != null)
                        {
                            selectResultItem = selectResultItem.FindAll(i => i.Costume.SupplierID == SupplierID);
                        }
                        if (selectResultItem.Count > 0)
                        {
                            this.CostumeSelected(selectResultItem[0], true);
                        }
                        else
                        {
                            this.Text = "";
                        }
                    }
                }
                else
                {
                    CostumeFromShopForm costumeForm = new CostumeFromShopForm(resultList, costumeID, ShopID, FilterValid, SupplierID);

                    if (costumeForm.ShowDialog() == DialogResult.OK)
                    {
                        if (costumeForm.Result == null)
                        {
                            return;
                        }
                        this.Text = costumeForm.Result.Costume.ID;
                        curItem   = costumeForm.Result;
                        CostumeSelected?.Invoke(curItem, true);
                    }
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemplo n.º 6
0
        public void Search()
        {
            try
            {
                isBarCode = false;
                string costumeID = this.SkinTxt.Text.Trim();
                if (string.IsNullOrEmpty(costumeID))
                {
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(null);
                    }
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                //条形码,先根据条形码获取款号
                //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper()));

                ////,条形码为一条,找到这个款号
                //if (barCodes != null && barCodes.Count == 1)
                //{
                //    costumeID = barCodes[0].CostumeID;
                //    this.SkinTxt.Text = barCodes[0].BarCodeValue;
                //    isBarCode = true;
                //}

                if (costumeID.Length == 15)
                {
                    BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID);
                    if (costume != null)
                    {
                        costumeID    = costume.CostumeID;
                        SkinTxt.Text = costume.BarCode;
                        isBarCode    = true;
                    }
                }
                List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => t.SupplierID == this.SupplierID &&
                                                                                  t.ID.ToUpper().Contains(costumeID.ToUpper()));
                if (filterValid)
                {
                    resultList = resultList.FindAll(t => t.IsValid);
                }

                if (this.BrandID != -1 && resultList != null)
                {
                    resultList = resultList.FindAll(t => t.BrandID == this.BrandID);
                }

                if (resultList == null || resultList.Count == 0)
                {
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(null);
                    }
                    this.SkinTxt.Text = "";
                    return;
                }
                if (resultList.Count == 1)
                {
                    resultList[0].BrandName    = CommonGlobalCache.GetBrandName(resultList[0].BrandID);
                    resultList[0].SupplierName = CommonGlobalCache.GetSupplierName(resultList[0].SupplierID);
                    if (!isBarCode)
                    {
                        this.SkinTxt.Text = resultList[0].ID;
                    }
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(resultList[0]);
                    }
                }
                else
                {
                    CostumeFromSupplierForm costumeForm = new CostumeFromSupplierForm(resultList, costumeID, SupplierID, BrandID, filterValid);
                    //  costumeForm.Hide();
                    //   costumeForm.CostumeSelected += CostumeForm_CostumeSelected;
                    if (costumeForm.ShowDialog() == DialogResult.OK)
                    {
                        this.SkinTxt.Text = costumeForm.Result.ID;
                        CostumeSelected?.Invoke(costumeForm.Result);
                    }
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemplo n.º 7
0
        private void BaseButton1_Click(object sender, EventArgs e)
        {
            try
            {
                string costumeID = this.skinTextBox1.SkinTxt.Text.Trim();
                if (string.IsNullOrEmpty(costumeID))
                {
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                //条形码,先根据条形码获取款号
                //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper()));

                ////,条形码为一条,找到这个款号
                //if (barCodes != null && barCodes.Count == 1)
                //{
                //    costumeID = barCodes[0].CostumeID;
                //    this.skinTextBox1.SkinTxt.Text = barCodes[0].BarCodeValue;
                //}
                if (costumeID.Length == 15)
                {
                    BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID);
                    if (costume != null)
                    {
                        costumeID = costume.CostumeID;
                        skinTextBox1.SkinTxt.Text = costume.BarCode;
                        //  isBarCode = true;
                    }
                }

                /*  List<Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => (t.ID.ToUpper().Contains(costumeID.ToUpper())));
                 * if (filterValid)
                 * {
                 *    resultList = resultList.FindAll(t => t.IsValid);
                 * }*/
                List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => t.ID.ToUpper().Contains(costumeID.ToUpper()) && t.IsValid == true);
                //  List<CostumeItem> resultList = currentCostumeitems.FindAll(t => t.Costume.ID.ToUpper().Contains(costumeID.ToUpper()));

                /*   List<CostumeItem> resultList = CommonGlobalCache.ServerProxy.GetCostumeStoreList(
                 *     new CostumeStoreListPara() { CostumeID = costumeID, ShopID = this.ShopID,
                 *         IsOnlyShowValid = filterValid,
                 *        // IsAccurateQuery = true,
                 *     });*/

                // this.currentSource.Clear();
                // this.currentSource = resultList;

                /* foreach (CostumeItem cItem in resultList)
                 * {
                 *   currentSource.Add(cItem.Costume);
                 * }*/

                this.SetDataSource(resultList);
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }

            finally
            {
                UnLockPage();
            }
        }
Exemplo n.º 8
0
        private void SkinTxt_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)

        {
            if (e.KeyCode != Keys.Enter)
            {
                return;
            }
            try
            {
                string costumeID = this.SkinTxt.Text.Trim();
                if (string.IsNullOrEmpty(costumeID))
                {
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(null);
                    }
                    return;
                }

                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                //条形码,先根据条形码获取款号
                //List<BarCode> barCodes = GlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Contains(costumeID.ToUpper()));

                ////,条形码为一条,找到这个款号
                //if (barCodes != null && barCodes.Count == 1)
                //{
                //    costumeID = barCodes[0].CostumeID;
                //    this.SkinTxt.Text = barCodes[0].BarCodeValue;
                //    isBarCode = true;
                //}
                if (costumeID.Length == 15)
                {
                    BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID);
                    if (costume != null)
                    {
                        costumeID    = costume.CostumeID;
                        SkinTxt.Text = costume.BarCode;
                        isBarCode    = true;
                    }
                }
                List <Costume> resultList = GlobalCache.CostumeList.FindAll(t => (t.ID.ToUpper().Contains(costumeID.ToUpper()) || t.Name.ToUpper().Contains(costumeID.ToUpper())) && t.PfShowOnline == EmOnline);
                if (filterValid)
                {
                    resultList = resultList.FindAll(t => t.IsValid);
                }
                if (resultList == null || resultList.Count == 0)
                {
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(null);
                    }
                    this.SkinTxt.Text = "";
                    return;
                }
                if (resultList.Count == 1)
                {
                    resultList[0].BrandName    = GlobalCache.GetBrandName(resultList[0].BrandID);
                    resultList[0].SupplierName = GlobalCache.GetSupplierName(resultList[0].SupplierID);
                    if (!isBarCode)
                    {
                        this.SkinTxt.Text = resultList[0].ID;
                    }
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(resultList[0]);
                    }
                }
                else
                {
                    EmPfCostumeForm costumeForm = new EmPfCostumeForm(resultList, costumeID, filterValid, EmOnline);
                    costumeForm.CostumeSelected += CostumeForm_CostumeSelected;
                    costumeForm.ShowDialog();
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }