Example #1
0
        void SplitDealAndInsertExcelData(COrderData pExcelData, Int32[] arr)
        {
            pExcelData.ExData_Option_ = Regex.Replace(pExcelData.ExData_Option_, @"[^a-zA-Z0-9가-힣]", "");
            Int32 nTotalcount = 0;
            for (Int32 i = 0; i < arr.Length; i++)
            {
                for (Int32 j = 0; j < arr[i]; j++)
                {
                    nTotalcount++;
                    COrderData tempExcelData = new COrderData();
                    tempExcelData.CopyFrom(pExcelData);
                    tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);
                    tempExcelData.ExData_Option_ = pExcelData.ExData_Option_;
                    tempExcelData.ExData_GoodsName_ = pExcelData.ExData_GoodsName_;
                    tempExcelData.ExData_GoodsNick_ = pExcelData.ExData_GoodsNick_;
                    tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);

                    if (Excel_List_.ContainsKey(tempExcelData.channelOrderCode_) == false)
                    {
                        Excel_List_.Add(tempExcelData.channelOrderCode_, tempExcelData);
                    }
                }
            }
        }
Example #2
0
        protected override Int32 SplitDealAndInsertExcelData(COrderData pExcelData, string comparesitename = "")
        {
            if (string.IsNullOrEmpty(comparesitename) == true)
                return 0;

            if (comparesitename.IndexOf(str_sitecompare_) < 0)
                return 0;

            string optionstring = Regex.Replace(pExcelData.ExData_Option_, @" ", "");
            Int32 nBuycount = 0;
            Int32 nTotalcount = 0;
            string optionnickname = "";
            pExcelData.ExData_GoodsNick_ = Convert.ToString(Regex.Replace(pExcelData.ExData_GoodsName_, @"[^a-zA-Z0-9가-힣]", ""));
            string regstring = @"(?<OptionName>\S+)/\S+/\d+개|(?<OptionName>\S+)/\d+개";

            // 옵션명 개수 빼기
            Regex re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline);
            MatchCollection oe = re.Matches(optionstring);

            optionnickname = Convert.ToString(Regex.Replace(oe[0].Groups["OptionName"].Value, @"[^a-zA-Z0-9가-힣]", ""));
            nBuycount = pExcelData.BuyCount_;
            for (Int32 i = 0; i < nBuycount; i++)
            {
                nTotalcount++;
                COrderData tempExcelData = new COrderData();
                tempExcelData.CopyFrom(pExcelData);
                tempExcelData.ExData_GoodsName_ = pExcelData.ExData_GoodsName_;
                tempExcelData.ExData_GoodsNick_ = pExcelData.ExData_GoodsNick_;
                tempExcelData.ExData_Option_ = optionnickname;
                tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);
                if (Excel_List_.ContainsKey(tempExcelData.channelOrderCode_) == false)
                {
                    Excel_List_.Add(tempExcelData.channelOrderCode_, tempExcelData);
                }
            }

            return nTotalcount;
        }
Example #3
0
        // 하나의 딜을 여러개로 나눌 필요가 있는가? 있다면 나눠서 넣고 없다면 그냥 넣는다.
        protected override Int32 SplitDealAndInsertExcelData(COrderData pExcelData, string comparesitename = "")
        {
            pExcelData.ExData_Option_ = Regex.Replace(pExcelData.ExData_Option_, @"[^a-zA-Z0-9가-힣]", "");
            pExcelData.ExData_GoodsNick_ = Regex.Replace(pExcelData.ExData_GoodsName_, @"[^a-zA-Z0-9가-힣]", "");
            Int32 nTotalcount = 0;
            Int32 nBuycount = 0;
            nBuycount = pExcelData.BuyCount_;

            for (int i = 0; i < nBuycount; i++)
            {
                nTotalcount++;
                COrderData tempExcelData = new COrderData();
                tempExcelData.CopyFrom(pExcelData);
                tempExcelData.ExData_Option_ = pExcelData.ExData_Option_;
                tempExcelData.ExData_GoodsName_ = pExcelData.ExData_GoodsName_;
                tempExcelData.ExData_GoodsNick_ = pExcelData.ExData_GoodsNick_;

                tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);
                if (Excel_List_.ContainsKey(tempExcelData.channelOrderCode_) == false)
                {
                    Excel_List_.Add(tempExcelData.channelOrderCode_, tempExcelData);
                }

            }

            return 1;
        }
Example #4
0
        protected override Int32 SplitDealAndInsertExcelData(COrderData pExcelData, string comparesitename = "")
        {
            string optionstring = pExcelData.ExData_Option_;
            Int32 nBuycount = 0;
            Int32 nTotalcount = 0;
            string optionname = "";
            string regstring = @"(?<OptionName>\S+)-\S+개";
            optionstring = optionstring.Replace(" ", "");
            pExcelData.ExData_GoodsNick_ = Regex.Replace(pExcelData.ExData_GoodsName_, @"[^a-zA-Z0-9가-힣]", "");
            Regex re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline);
            MatchCollection oe = re.Matches(optionstring);

            foreach (Match mat in oe)
            {
                GroupCollection group = mat.Groups;
                optionname = Convert.ToString(group["OptionName"].Value);
                optionname = Regex.Replace(optionname, @"[^a-zA-Z0-9가-힣]", "");
                nBuycount = pExcelData.BuyCount_;

                for (Int32 i = 0; i < nBuycount; i++)
                {
                    nTotalcount++;
                    COrderData tempExcelData = new COrderData();
                    tempExcelData.CopyFrom(pExcelData);
                    tempExcelData.ExData_Option_ = optionname;
                    tempExcelData.ExData_GoodsName_ = pExcelData.ExData_GoodsName_;
                    tempExcelData.ExData_GoodsNick_ = pExcelData.ExData_GoodsNick_;
                    tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);

                    if (Excel_List_.ContainsKey(tempExcelData.channelOrderCode_) == false)
                    {
                        Excel_List_.Add(tempExcelData.channelOrderCode_, tempExcelData);
                    }
                }
            }

            return nTotalcount;
        }
Example #5
0
        protected override Int32 SplitDealAndInsertExcelData(COrderData pExcelData, string comparesitename = "")
        {
            string optionstring = pExcelData.ExData_Option_;
            Int32 nBuycount = 0;
            Int32 nTotalcount = 0;
            string optionname = "";
            pExcelData.ExData_GoodsNick_ = Convert.ToString(Regex.Replace(pExcelData.ExData_GoodsName_, @"[^a-zA-Z0-9가-힣]", ""));
            string regstring = "";

            if (pExcelData.authoritySeq_ != 26)
            {
                regstring = @"(?<OptionName>\S+),\S+수량(?<Count>\d+)개";
            }
            else
            {
                regstring = @"(?<OptionName>\S+)";
            }

            string[] optionarray = System.Text.RegularExpressions.Regex.Split(optionstring, "(],)");

            foreach (string curoption in optionarray)
            {
                optionstring = curoption.Replace("],", "]");
                optionstring = optionstring.Replace(" ", "");
                Regex re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                MatchCollection oe = re.Matches(optionstring);

                foreach (Match mat in oe)
                {
                    GroupCollection group = mat.Groups;
                    optionname = Convert.ToString(group["OptionName"].Value);
                    optionname = Regex.Replace(optionname, @"[^a-zA-Z0-9가-힣]", "");

                    if (pExcelData.BuyCount_ != 0)
                    {
                        nBuycount = pExcelData.BuyCount_;
                    }
                    else
                    {
                        nBuycount = Convert.ToInt32(group["Count"].Value);
                    }

                    for (Int32 i = 0; i < nBuycount; i++)
                    {
                        nTotalcount++;
                        COrderData tempExcelData = new COrderData();
                        tempExcelData.CopyFrom(pExcelData);
                        tempExcelData.ExData_Option_ = optionname;
                        tempExcelData.ExData_GoodsName_ = pExcelData.ExData_GoodsName_;
                        tempExcelData.ExData_GoodsNick_ = pExcelData.ExData_GoodsNick_;

                        tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);
                        if (Excel_List_.ContainsKey(tempExcelData.channelOrderCode_) == false)
                        {
                            Excel_List_.Add(tempExcelData.channelOrderCode_, tempExcelData);
                        }
                    }
                }
            }

            return nTotalcount;
        }
Example #6
0
        // 하나의 딜을 여러개로 나눌 필요가 있는가? 있다면 나눠서 넣고 없다면 그냥 넣는다.
        protected override Int32 SplitDealAndInsertExcelData(COrderData pExcelData, string comparesitename = "")
        {
            pExcelData.ExData_Option_ = Regex.Replace(pExcelData.ExData_Option_, @"[^a-zA-Z0-9가-힣]", "");
            pExcelData.ExData_GoodsNick_ = Regex.Replace(pExcelData.ExData_GoodsName_, @"[^a-zA-Z0-9가-힣]", "");
            string regstring = @"(?<CouponCode>\S+)\(\S+\)";

            Int32 nTotalcount = 0;
            Int32 nBuycount = 0;
            string[] splitArray = pExcelData.channelOrderCode_.Split(',');
            nBuycount = splitArray.Length;

            for (int i = 0; i < nBuycount; i++)
            {
                string couponString = splitArray[i].Replace(" ", "");
                Regex re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                MatchCollection oe = re.Matches(couponString);

                foreach (Match mat in oe)
                {
                    GroupCollection group = mat.Groups;
                    couponString = Convert.ToString(group["CouponCode"].Value);

                    nTotalcount++;
                    COrderData tempExcelData = new COrderData();
                    tempExcelData.CopyFrom(pExcelData);
                    tempExcelData.ExData_Option_ = pExcelData.ExData_Option_;
                    tempExcelData.ExData_GoodsName_ = pExcelData.ExData_GoodsName_;
                    tempExcelData.ExData_GoodsNick_ = pExcelData.ExData_GoodsNick_;

                    tempExcelData.channelOrderCode_ = couponString;
                    if (Excel_List_.ContainsKey(tempExcelData.channelOrderCode_) == false)
                    {
                        Excel_List_.Add(tempExcelData.channelOrderCode_, tempExcelData);
                    }
                }

            }

            return 1;
        }