public override Int32 SplitDealAndInsertExcelData(tblOrderData 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_, @"[^a-zA-Z0-9가-힣]", ""); string optionstring = Regex.Replace(pExcelData.ExData_Option_, @" ", ""); Int32 nBuycount = 0; Int32 nTotalcount = 0; string optionname = ""; string regstring = @"(?<OptionName>\S+)/\S+/(?<Count>\d+)개|(?<OptionName>\S+)/(?<Count>\d+)개"; // 옵션명 개수 빼기 Regex re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline); MatchCollection oe = re.Matches(optionstring); optionname = Convert.ToString(Regex.Replace(oe[0].Groups["OptionName"].Value, @"[^a-zA-Z0-9가-힣]", "")); nBuycount = Convert.ToInt32(oe[0].Groups["Count"].Value); for (Int32 i = 0; i < nBuycount; i++) { nTotalcount++; tblOrderData tempExcelData = new tblOrderData(); tempExcelData.CopyFrom(pExcelData); tempExcelData.ExData_Option_ = optionname; tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount); tempExcelData.bFindInExcel_ = true; OrderManager.Instance.AddExcelData(tempExcelData); } return nTotalcount; }
public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "") { string optionstring = pExcelData.ExData_Option_; string optionPhone = pExcelData.orderPhone_.Replace(" ", ""); Int32 nBuycount = 0; Int32 nTotalcount = 0; string optionname = ""; string regstring = @"(?<OptionName>\S+)"; string[] optionarray = System.Text.RegularExpressions.Regex.Split(optionstring, "\n"); foreach (string curoption in optionarray) { optionstring = curoption.Replace(" ", ""); Regex re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline); MatchCollection oe = re.Matches(optionstring); nBuycount = pExcelData.BuyCount_; foreach (Match mat in oe) { GroupCollection group = mat.Groups; optionname = Convert.ToString(group["OptionName"].Value); optionname = Regex.Replace(optionname, @"[^a-zA-Z0-9가-힣]", ""); for (Int32 i = 0; i < nBuycount; i++) { nTotalcount++; tblOrderData tempExcelData = new tblOrderData(); tempExcelData.CopyFrom(pExcelData); tempExcelData.bFindInExcel_ = true; tempExcelData.ExData_Option_ = optionname; tempExcelData.orderPhone_ = optionPhone; tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount); OrderManager.Instance.AddExcelData(tempExcelData); } } } return nTotalcount; }
public override Int32 SplitDealAndInsertExcelData(tblOrderData 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_, @"[^a-zA-Z0-9가-힣]", ""); string optionstring = Regex.Replace(pExcelData.ExData_Option_, @" ", ""); Int32 nBuycount = 0; Int32 nTotalcount = 0; string optionname = ""; optionname = Convert.ToString(Regex.Replace(pExcelData.ExData_Option_, @"[^a-zA-Z0-9가-힣]", "")); nBuycount = pExcelData.BuyCount_; for (Int32 i = 0; i < nBuycount; i++) { nTotalcount++; tblOrderData tempExcelData = new tblOrderData(); tempExcelData.CopyFrom(pExcelData); tempExcelData.ExData_Option_ = optionname; tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount); tempExcelData.bFindInExcel_ = true; OrderManager.Instance.AddExcelData(tempExcelData); } return nTotalcount; }
public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "") { Int32 nBuycount = 0; Int32 nTotalcount = 0; nBuycount = pExcelData.BuyCount_; pExcelData.ExData_Option_ = Regex.Replace(pExcelData.ExData_Option_, @"[^a-zA-Z0-9가-힣]", ""); for (Int32 i = 0; i < nBuycount; i++) { nTotalcount++; tblOrderData tempExcelData = new tblOrderData(); tempExcelData.CopyFrom(pExcelData); tempExcelData.bFindInExcel_ = true; tempExcelData.ExData_Option_ = pExcelData.ExData_Option_; tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount); OrderManager.Instance.AddExcelData(tempExcelData); } return nTotalcount; }
public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "") { string optionstring = pExcelData.ExData_Option_; Int32 nBuycount = 0; Int32 nTotalcount = 0; string tempString = ""; string optionname = ""; string regstring = @"(?<OptionName>\S+)\((?<Price>\S+)원\)"; //string regstring = @"(?<OptionName>\S+)\(\S+\)(?<Count>\d+)개"; 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가-힣]", ""); tempString = Convert.ToString(group["Price"].Value); nBuycount = pExcelData.BuyCount_; if (tempString != null) {// 돈에 , 가 있으면 제거하자. tempString = tempString.Replace(",", ""); pExcelData.orderSettlePrice_ = Convert.ToInt32(tempString); } for (Int32 i = 0; i < nBuycount; i++) { nTotalcount++; tblOrderData tempExcelData = new tblOrderData(); tempExcelData.CopyFrom(pExcelData); tempExcelData.bFindInExcel_ = true; tempExcelData.ExData_Option_ = optionname; tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount); OrderManager.Instance.AddExcelData(tempExcelData); } } return nTotalcount; }
public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "") { string optionstring = pExcelData.ExData_Option_; string optionPhone = pExcelData.orderPhone_.Replace(" ",""); Int32 nBuycount = 0; Int32 nTotalcount = 0; string optionname = ""; // string regstring = @"(?<OptionName>\S+),\S+(?<Count>\d+)개"; string regstring = @"(?<OptionName>\S+)"; string regstringPhone = @"연락처\:(?<OrderPhone>\S+)|MS\S+\(\S+\):(?<OrderPhone>\S+)"; string[] optionarray = System.Text.RegularExpressions.Regex.Split(optionstring, "\n"); foreach (string curoption in optionarray) { optionstring = curoption.Replace(" ", ""); Regex re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline); Regex rePhone = new Regex(regstringPhone, RegexOptions.IgnoreCase | RegexOptions.Singleline); MatchCollection oe = re.Matches(optionstring); if (optionPhone.Contains("MMS") == true) { MatchCollection oePhone = rePhone.Matches(optionPhone); GroupCollection group2 = oePhone[0].Groups; optionPhone = Convert.ToString(group2["OrderPhone"].Value); } nBuycount = pExcelData.BuyCount_; foreach (Match mat in oe) { GroupCollection group = mat.Groups; optionname = Convert.ToString(group["OptionName"].Value); optionname = Regex.Replace(optionname, @"[^a-zA-Z0-9가-힣]", ""); optionPhone = Regex.Replace(optionPhone, @"^(01[016789]{1}|02|0[3-9]{1}[0-9]{1})-?([0-9]{3,4})-?([0-9]{4})$", @"$1-$2-$3"); for (Int32 i = 0; i < nBuycount; i++) { nTotalcount++; tblOrderData tempExcelData = new tblOrderData(); tempExcelData.CopyFrom(pExcelData); tempExcelData.bFindInExcel_ = true; tempExcelData.ExData_Option_ = optionname; tempExcelData.orderPhone_ = optionPhone; tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount); OrderManager.Instance.AddExcelData(tempExcelData); } } } return nTotalcount; }
public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "") { string optionstring = pExcelData.ExData_Option_; string optionPhone = pExcelData.orderPhone_.Replace(" ", ""); Int32 nBuycount = 0; Int32 nTotalcount = 0; string optionname = ""; // string regstring = @"(?<OptionName>\S+),\S+(?<Count>\d+)개"; string[] optionarray = System.Text.RegularExpressions.Regex.Split(optionstring, "\n"); foreach (string curoption in optionarray) { optionstring = curoption.Replace(" ", ""); optionname = optionstring; nBuycount = pExcelData.BuyCount_; optionname = Regex.Replace(optionname, @"[^a-zA-Z0-9가-힣]", ""); for (Int32 i = 0; i < nBuycount; i++) { nTotalcount++; tblOrderData tempExcelData = new tblOrderData(); tempExcelData.CopyFrom(pExcelData); tempExcelData.bFindInExcel_ = true; tempExcelData.ExData_Option_ = optionname; tempExcelData.orderPhone_ = optionPhone; tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount); OrderManager.Instance.AddExcelData(tempExcelData); } } return nTotalcount; }