Пример #1
0
        protected void gvPayment_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            PaymentBiz bizPay = new PaymentBiz();

            DTO.ResponseMessage <bool> res = new DTO.ResponseMessage <bool>();
            List <string> lsRegNo          = new List <string>();

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if (gvPayment.DataSource != null)
                {
                    Label lblApproveDoc = (Label)e.Row.FindControl("lblApproveDoc");
                    if (lblApproveDoc != null)
                    {
                        if (lblApproveDoc.Text.Equals(SysMessage.LicenseApproveW) || lblApproveDoc.Text.Equals(SysMessage.LicenseApproveN))
                        {
                            e.Row.Enabled = false;
                        }
                        else
                        {
                            e.Row.Enabled = true;

                            #region สร้างใบสั่งจ่ายย่อย > NewCreatePayment

                            //Label lblRequestNo = (Label)e.Row.FindControl("lblHeadRequestNo");
                            //if (lblRequestNo != null)
                            //{

                            //    lsRegNo.Add(lblRequestNo.Text);

                            //    string ref1 = string.Empty;
                            //    //res = bizPay.NewCreatePayment(lsRegNo.ToArray(), "", this.MasterLicense.UserProfile.Id, "", Convert.ToString(this.MasterLicense.UserProfile.MemberType), );
                            //    res = bizPay.NewCreatePayment(lsRegNo.ToArray(), "", this.MasterLicense.UserProfile.Id, "", Convert.ToString(this.MasterLicense.UserProfile.MemberType), out ref1);


                            //    //Get RefNo
                            //    string refNo = ref1;
                            //    ImageButton btnPayment = (ImageButton)e.Row.FindControl("btnPayment");
                            //    btnPayment.Attributes.Add("onclick", string.Format("OpenPopup('{0}')", refNo));

                            //    if ((res.IsError) || (res.ResultMessage == false))
                            //    {

                            //        this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg;
                            //        this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError();
                            //    }
                            //    else
                            //    {
                            //        //this.MasterLicense.UCLicenseModelSuccess.ShowMessageSuccess = SysMessage.CreatePaymentSuccess;
                            //        //this.MasterLicense.UCLicenseModelSuccess.ShowModalSuccess();
                            //    }

                            //}

                            #endregion
                        }
                    }
                }
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                ReportDocument report = new ReportDocument();
                PaymentBiz     biz    = new PaymentBiz();

                report.Load(Server.MapPath("../Reports/RptCheckFileSize.rpt"));
                report.SetDataSource(biz.GetCheckFileSize(Request.QueryString["TypePay"].ToString(), Request.QueryString["DateStart"].ToString(), Request.QueryString["DateEnd"].ToString()).DataResponse.Tables[0]);
                report.SetParameterValue("startdate", Request.QueryString["DateStart"].ToString());
                report.SetParameterValue("enddate", Request.QueryString["DateEnd"].ToString());
                if (Request.QueryString["DateStart"].ToString() == "" && Request.QueryString["DateEnd"].ToString() == "")
                {
                    report.SetParameterValue("lblSDate", "");
                    report.SetParameterValue("lblEDate", "");
                }
                else
                {
                    report.SetParameterValue("lblSDate", "วันที่สร้างใบเสร็จ(เริ่ม) :");
                    report.SetParameterValue("lblEDate", "วันที่สร้างใบเสร็จ(สิ้นสุด) :");
                }
                CrystalReportViewer1.ReportSource = report;
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Пример #3
0
        private int GetSumConfigViewBillPayment()
        {
            int        SumAllPayment = 0;
            PaymentBiz biz           = new PaymentBiz();

            DTO.ResponseService <DataSet> ViewBillPayment = biz.GetConfigViewBillPayment();
            //SumAllPayment = ViewBillPayment.DataResponse.Tables[0].Rows.Count;

            if (ViewBillPayment.DataResponse.Tables[0].Rows.Count > 0)
            {
                DataRow drTran = ViewBillPayment.DataResponse.Tables[0].Rows[0];
                SumAllPayment = Convert.ToInt16(drTran["ITEM_VALUE"]);
            }
            return(SumAllPayment);
        }
Пример #4
0
        public PaymentOrderItemT SetPaymentOrderItem(PaymentRequestInfoT orgPaymentRequestInfo, PaymentRequestInfoT paymentRequestInfo)
        {
            PaymentBiz paymentBiz = new PaymentBiz();
            PaymentOrderItemT paymentOrderItem = new PaymentOrderItemT();

            string paymentGoodsCode, paymentAmount, paymentPrice;
            string paymentGdSelNo, paymentBasketPID, paymentOrderIdx;
            string paymentSelItemPrice, paymentDeliveryFee, paymentCostPrice;
            string paymentDeliveryGroupNo;

            string plGdNo = string.Empty, plOrderCnt = string.Empty, plOrderPrice = string.Empty, plGdNm = string.Empty, plGdEngNm = string.Empty, plGdKind = string.Empty, plGdOrigin = string.Empty, plGdOrigin2 = string.Empty, plGdlcCd = string.Empty, plGdmcCd = string.Empty, plGdscCd = string.Empty, plMakerNm = string.Empty;
            string plBrandNm = string.Empty, plDealPriceKind = string.Empty, plDealPrice = string.Empty, plOpGd = string.Empty, plAsYn = string.Empty, plSellCustNo = string.Empty, plGdShopkind = string.Empty, plGdShopkind2 = string.Empty, plGdShopkind3 = string.Empty, plTradWay = string.Empty;
            string plTemplateType = string.Empty, plAdultYn = string.Empty, plHasaddedfile = string.Empty, plInventoryNo = string.Empty, plInventorytype = string.Empty, plOptInventoryno = string.Empty, plOptInventorytype = string.Empty, plGdMadeSdt = string.Empty;
            string plAttribEndDt = string.Empty, plGdBuyerMlRate = string.Empty, plGdBuddyMlRate = string.Empty, plUseGubun = string.Empty, plBundleType = string.Empty, plDangolChanceAmt = string.Empty, plDangolChanceKind = string.Empty;
            string plDntNo = string.Empty, plDntWhoFee = string.Empty, plDntSaveMoney = string.Empty, plMaxLimit = string.Empty, plTotalSaveMoney = string.Empty, plFreecSellerchargeyn = string.Empty, plJehuRsvServiceType = string.Empty;
            string plJehuEstType = string.Empty, plGoodsRegDt = string.Empty, plDeliveryGroupNo = string.Empty, plDeliveryFee = string.Empty, plBuyUnitCnt = string.Empty, plMinBuyCnt = string.Empty, plTemplateUrl = string.Empty;
            string plShopGroupCd = string.Empty, plShopGdlcCd = string.Empty, plShopGdmcCd = string.Empty, plShopGdscCd = string.Empty;

            string paramXml = string.Empty;
            //string xmlParams, xmlValues;

            //string paymentOrderType;

            paymentBasketPID = orgPaymentRequestInfo.BasketPid;

            paymentOrderIdx = orgPaymentRequestInfo.SelectedOrderIdxs.Replace(" ", string.Empty).Replace("|",",");
            paymentGdSelNo = PaymentUtil.AddComma(orgPaymentRequestInfo.GdSelNo).Replace(" ", string.Empty);
            paymentGoodsCode = PaymentUtil.AddComma(orgPaymentRequestInfo.ItemNo).Replace(" ", string.Empty);
            paymentAmount = PaymentUtil.AddComma(orgPaymentRequestInfo.OrderCounts).Replace(" ", string.Empty);
            paymentPrice = PaymentUtil.AddComma(orgPaymentRequestInfo.OrderPrice).Replace(" ", string.Empty);
            paymentSelItemPrice = PaymentUtil.AddComma(orgPaymentRequestInfo.SelItemPrice).Replace(" ", string.Empty);
            paymentDeliveryFee = PaymentUtil.AddComma(orgPaymentRequestInfo.DeliveryFee).Replace(" ", string.Empty);
            paymentCostPrice = PaymentUtil.AddComma(orgPaymentRequestInfo.RealCostPrice).Replace(" ", string.Empty);
            paymentDeliveryGroupNo = PaymentUtil.AddComma(orgPaymentRequestInfo.DeliveryGroupNo).Replace(" ", string.Empty);

            if (string.IsNullOrEmpty(paymentBasketPID))
                paymentBasketPID = Guid.NewGuid().ToString();

            if (string.IsNullOrEmpty(paymentGdSelNo))
            {
                paymentGdSelNo = orgPaymentRequestInfo.RemoteAddress.Replace(".", string.Empty) + DateTime.Now.Day.ToString().PadRight(2, '0') + DateTime.Now.Hour.ToString().PadRight(2, '0') + DateTime.Now.Minute.ToString().PadRight(2, '0') + DateTime.Now.Second.ToString().PadRight(2, '0');
            }

            if (string.IsNullOrEmpty(paymentOrderIdx))
            {
                string[] icntArr = paymentGoodsCode.Split(PaymentConstant.CommaSeperator);

                for (int iloopCnt = 0, icntArrLength = icntArr.Length; iloopCnt < icntArrLength; iloopCnt++)
                {
                    PaymentOrderIndexT paymentOrderIndex = paymentBiz.GetPaymentOrderIndex();
                    if (paymentOrderIndex != null)
                    {
                        paymentOrderIdx = PaymentUtil.AddComma(paymentOrderIdx + paymentOrderIndex.OrderIdx.ToString());
                    }
                }
            }

            if (!paymentOrderIdx.Trim().EndsWith(PaymentConstant.Comma)) { paymentOrderIdx = PaymentUtil.AddComma(paymentOrderIdx); }
            if (!paymentGdSelNo.Trim().EndsWith(PaymentConstant.Comma)) { paymentGdSelNo = PaymentUtil.AddComma(paymentGdSelNo); }
            if (!paymentGoodsCode.Trim().EndsWith(PaymentConstant.Comma)) { paymentGoodsCode = PaymentUtil.AddComma(paymentGoodsCode); }
            if (!paymentAmount.Trim().EndsWith(PaymentConstant.Comma)) { paymentAmount = PaymentUtil.AddComma(paymentAmount); }
            if (!paymentPrice.Trim().EndsWith(PaymentConstant.Comma)) { paymentPrice = PaymentUtil.AddComma(paymentPrice); }
            if (!paymentSelItemPrice.Trim().EndsWith(PaymentConstant.Comma)) { paymentSelItemPrice = PaymentUtil.AddComma(paymentSelItemPrice); }
            if (!paymentDeliveryFee.Trim().EndsWith(PaymentConstant.Comma)) { paymentDeliveryFee = PaymentUtil.AddComma(paymentDeliveryFee); }
            if (!paymentCostPrice.Trim().EndsWith(PaymentConstant.Comma)) { paymentCostPrice = PaymentUtil.AddComma(paymentCostPrice); }
            if (!paymentDeliveryGroupNo.Trim().EndsWith(PaymentConstant.Comma)) { paymentDeliveryGroupNo = PaymentUtil.AddComma(paymentDeliveryGroupNo); }

            //paymentOrderType = "DM";

            //XQueryUtil xQueryUtil = new XQueryUtil();

            //xmlParams = "gd_no,order_cnt,order_price,";
            //xmlValues = xQueryUtil.ParamCheckComma(strPaymentGoodsCode) + PaymentConstant.MainDelimiter +
            //    xQueryUtil.ParamCheckComma(strPaymentAmount) + PaymentConstant.MainDelimiter +
            //    xQueryUtil.ParamCheckComma(strPaymentPrice);

            //isRtnValue = xQueryUtil.BuildXQueryXml(xmlParams, xmlValues, 0);

            //if (isRtnValue)
            //{
            //    paramXml = xQueryUtil.GetParamXml();
            //}

            paramXml = MakeXQuery(new List<string> { "gd_no", "order_cnt", "order_price" },
                new List<string> { paymentGoodsCode, paymentAmount, paymentPrice }
                );

            //string[] arrPaymentDeliveryGroupNo = strPaymentDeliveryGroupNo.Split(PaymentConstant.CommaSeperator);
            //string[] arrPaymentDeliveryFee = strPaymentDeliveryFee.Split(PaymentConstant.CommaSeperator);

            //int packNo = 0;
            //List<PaymentInsertPolicyItemInfoT> policyItemInfoList = new List<PaymentInsertPolicyItemInfoT>();
            List<PaymentItemInfoPolicyT> paymentItemInfoPolicy = paymentBiz.GetPaymentItemInfoPolicy(paymentBasketPID, paramXml);

            if (paymentItemInfoPolicy != null)
            {
                if (paymentItemInfoPolicy.Count > 0)
                {
                    //packNo = paymentBiz.GetNewPackNo();

                    Dictionary<string, KeyValuePair<int, string[]>> dicPolicyItemInfoParam = GetPolicyItemInfoParam(paymentItemInfoPolicy.Count
                        , paymentGdSelNo, paymentOrderIdx, paymentPrice, paymentDeliveryFee, paymentCostPrice, paymentDeliveryGroupNo);

                    for (int i = 0, paymentItemInfoPolicyLength = paymentItemInfoPolicy.Count; i < paymentItemInfoPolicyLength; i++)
                    {
                        /*
                        policyItemInfoList.Add(new PaymentInsertPolicyItemInfoT()
                        {
                            PackNo = packNo,
                            Pid = paymentBasketPID,
                            ItemNo = paymentItemInfoPolicy[i].ItemNo.Trim(),
                            GdSelNo = dicPolicyItemInfoParam["GdSelNo"].Value[i],
                            OrderIdx = Util.GetSafeLong(dicPolicyItemInfoParam["OrderIdx"].Value[i]),
                            ItemName = Util.StripHtmlTags(paymentItemInfoPolicy[i].ItemName).Replace(",", ".").Replace("'", "`").Replace(",", "."),
                            GdEngNm = Util.StripHtmlTags(paymentItemInfoPolicy[i].GdEngNm).Replace(",", ".").Replace("'", "`").Replace(",", "."),
                            GdKind = paymentItemInfoPolicy[i].GdKind,
                            GdOrigin = Util.StripHtmlTags(paymentItemInfoPolicy[i].GdOrigin).Replace(",", ".").Replace("'", "`").Replace(",", "."),
                            GdlcCd = paymentItemInfoPolicy[i].GdlcCd.Trim(),
                            GdmcCd = paymentItemInfoPolicy[i].GdmcCd.Trim(),
                            GdscCd = paymentItemInfoPolicy[i].GdscCd.Trim(),
                            MakerName = Util.StripHtmlTags(paymentItemInfoPolicy[i].MakerName).Replace(",", ".").Replace("'", "`").Replace(",", "."),
                            BrandName = Util.StripHtmlTags(paymentItemInfoPolicy[i].BrandName).Replace(",", ".").Replace("'", "`").Replace(",", "."),
                            DealPriceKind = paymentItemInfoPolicy[i].DealPriceKind.Trim(),
                            DealPrice = paymentItemInfoPolicy[i].DealPrice,
                            OpGd = Util.StripHtmlTags(paymentItemInfoPolicy[i].OpGd).Replace(",", ".").Replace("'", "`").Replace(",", "."),
                            AsYn = paymentItemInfoPolicy[i].AsYn.Trim(),
                            SellCustNo = paymentItemInfoPolicy[i].SellCustNo.Trim(),
                            GdShopkind = paymentItemInfoPolicy[i].GdShopkind.Trim(),
                            GdShopkind2 = paymentItemInfoPolicy[i].GdShopkind2.Trim(),
                            GdShopkind3 = paymentItemInfoPolicy[i].GdShopkind3.Trim(),
                            TradWay = paymentItemInfoPolicy[i].TradWay.Trim(),
                            TemplateType = paymentItemInfoPolicy[i].TemplateType.Trim(),
                            AdultYn = paymentItemInfoPolicy[i].AdultYn.Trim(),
                            Hasaddedfile = paymentItemInfoPolicy[i].Hasaddedfile.Trim(),
                            InventoryNo = paymentItemInfoPolicy[i].InventoryNo.Trim(),
                            Inventorytype = paymentItemInfoPolicy[i].Inventorytype.Trim(),
                            OptInventoryno = paymentItemInfoPolicy[i].OptInventoryno.Trim(),
                            OptInventorytype = paymentItemInfoPolicy[i].OptInventorytype.Trim(),
                            GdMadeSdt = Convert.ToDateTime(paymentItemInfoPolicy[i].GdMadeSdt),
                            AttribEndDt = Convert.ToDateTime(paymentItemInfoPolicy[i].AttribEndDt),
                            GdBuyerMlRate = paymentItemInfoPolicy[i].GdBuyerMlRate,
                            GdBuddyMlRate = paymentItemInfoPolicy[i].GdBuddyMlRate,
                            UseGubun = paymentItemInfoPolicy[i].UseGubun.Trim(),
                            BundleType = paymentItemInfoPolicy[i].BundleType.Trim(),
                            MinBuyCnt = paymentItemInfoPolicy[i].BuyUnitCnt,
                            BuyUnitCnt = paymentItemInfoPolicy[i].MinBuyCnt,
                            DangolChanceAmt = paymentItemInfoPolicy[i].DangolChanceAmt,
                            DangolChanceKind = paymentItemInfoPolicy[i].DangolChanceKind.Trim(),
                            JehuRsvServiceType = paymentItemInfoPolicy[i].JehuRsvServiceType.Trim(),
                            JehuEstType = paymentItemInfoPolicy[i].JehuEstType.Trim(),
                            DntNo = paymentItemInfoPolicy[i].DntNo,
                            DntWhoFee = paymentItemInfoPolicy[i].DntWhoFee.Trim(),
                            DntSaveMoney = paymentItemInfoPolicy[i].DntSaveMoney,
                            FreecSellerchargeyn = paymentItemInfoPolicy[i].FreecSellerchargeyn.Trim(),
                            OrderPrice = paymentItemInfoPolicy[i].OrderPrice,
                            SelItemPrice = Util.GetSafeDecimal(dicPolicyItemInfoParam["SelItemPrice"].Value[i]),
                            OrderCnt = paymentItemInfoPolicy[i].OrderCnt,
                            DelFee = Util.GetSafeDecimal(dicPolicyItemInfoParam["DelFee"].Value[i]),
                            CostPrice = Util.GetSafeDecimal(dicPolicyItemInfoParam["CostPrice"].Value[i]),
                            DeliveryGroupNo = Util.GetSafeInt(dicPolicyItemInfoParam["DeliveryGroupNo"].Value[i]),
                            ShopGroupCd = paymentItemInfoPolicy[i].ShopGroupCd,
                            ShopGdlcCd = paymentItemInfoPolicy[i].ShopGdlcCd,
                            ShopGdmcCd = paymentItemInfoPolicy[i].ShopGdmcCd,
                            ShopGdscCd = paymentItemInfoPolicy[i].ShopGdscCd
                        });
                        */

                        plGdNo = plGdNo + PaymentUtil.AddComma(paymentItemInfoPolicy[i].ItemNo.Trim());
                        plOrderCnt = plOrderCnt + PaymentUtil.AddComma( paymentItemInfoPolicy[i].OrderCnt.ToString());
                        plOrderPrice = plOrderPrice + PaymentUtil.AddComma( paymentItemInfoPolicy[i].OrderPrice.ToString());
                        plGdNm = plGdNm + PaymentUtil.AddComma( Util.StripHtmlTags(paymentItemInfoPolicy[i].ItemName).Replace(",", ".").Replace("'", "`").Replace(",", "."));
                        plGdEngNm = plGdEngNm + PaymentUtil.AddComma( Util.StripHtmlTags(paymentItemInfoPolicy[i].GdEngNm).Replace(",", ".").Replace("'", "`").Replace(",", "."));
                        plGdKind = plGdKind + PaymentUtil.AddComma( paymentItemInfoPolicy[i].GdKind.ToString().Trim());
                        plGdOrigin = plGdOrigin + PaymentUtil.AddComma( Util.StripHtmlTags(paymentItemInfoPolicy[i].GdOrigin).Replace(",", ".").Replace("'", "`").Replace(",", "."));
                        plGdOrigin2 = plGdOrigin2 + PaymentUtil.AddComma( Util.StripHtmlTags(paymentItemInfoPolicy[i].GdOrigin2).Replace(",", ".").Replace("'", "`").Replace(",", "."));
                        plGdlcCd = plGdlcCd + PaymentUtil.AddComma( paymentItemInfoPolicy[i].GdlcCd.Trim());
                        plGdmcCd = plGdmcCd + PaymentUtil.AddComma( paymentItemInfoPolicy[i].GdmcCd.Trim());
                        plGdscCd = plGdscCd + PaymentUtil.AddComma( paymentItemInfoPolicy[i].GdscCd.Trim());
                        plMakerNm = plMakerNm + PaymentUtil.AddComma( Util.StripHtmlTags(paymentItemInfoPolicy[i].MakerName).Replace(",", ".").Replace("'", "`").Replace(",", "."));
                        plBrandNm = plBrandNm + PaymentUtil.AddComma( Util.StripHtmlTags(paymentItemInfoPolicy[i].BrandName).Replace(",", ".").Replace("'", "`").Replace(",", "."));
                        plDealPriceKind = plDealPriceKind + PaymentUtil.AddComma( paymentItemInfoPolicy[i].DealPriceKind.Trim());
                        plDealPrice = plDealPrice + PaymentUtil.AddComma( paymentItemInfoPolicy[i].DealPrice.ToString());
                        plOpGd = plOpGd + PaymentUtil.AddComma( Util.StripHtmlTags(paymentItemInfoPolicy[i].OpGd).Replace(",", ".").Replace("'", "`").Replace(",", "."));
                        plAsYn = plAsYn + PaymentUtil.AddComma( paymentItemInfoPolicy[i].AsYn.Trim());
                        plSellCustNo = plSellCustNo + PaymentUtil.AddComma( paymentItemInfoPolicy[i].SellCustNo.Trim());
                        plGdShopkind = plGdShopkind + PaymentUtil.AddComma( paymentItemInfoPolicy[i].GdShopkind.Trim());
                        plGdShopkind2 = plGdShopkind2 + PaymentUtil.AddComma( paymentItemInfoPolicy[i].GdShopkind2.Trim());
                        plGdShopkind3 = plGdShopkind3 + PaymentUtil.AddComma( paymentItemInfoPolicy[i].GdShopkind3.Trim());
                        plTradWay = plTradWay + PaymentUtil.AddComma( paymentItemInfoPolicy[i].TradWay.Trim());
                        plTemplateType = plTemplateType + PaymentUtil.AddComma( paymentItemInfoPolicy[i].TemplateType.Trim());
                        plAdultYn = plAdultYn + PaymentUtil.AddComma( paymentItemInfoPolicy[i].AdultYn.Trim());
                        plHasaddedfile = plHasaddedfile + PaymentUtil.AddComma( paymentItemInfoPolicy[i].Hasaddedfile.Trim());
                        plInventoryNo = plInventoryNo + PaymentUtil.AddComma( paymentItemInfoPolicy[i].InventoryNo.Trim());
                        plInventorytype = plInventorytype + PaymentUtil.AddComma( paymentItemInfoPolicy[i].Inventorytype.Trim());
                        plOptInventoryno = plOptInventoryno + PaymentUtil.AddComma( paymentItemInfoPolicy[i].OptInventoryno.Trim());
                        plOptInventorytype = plOptInventorytype + PaymentUtil.AddComma( paymentItemInfoPolicy[i].OptInventorytype.Trim());
                        plGdMadeSdt = plGdMadeSdt + PaymentUtil.AddComma( paymentItemInfoPolicy[i].GdMadeSdt.Trim());
                        plAttribEndDt = plAttribEndDt + PaymentUtil.AddComma( paymentItemInfoPolicy[i].AttribEndDt.Trim());
                        plGdBuyerMlRate = plGdBuyerMlRate + PaymentUtil.AddComma( paymentItemInfoPolicy[i].GdBuyerMlRate.ToString());
                        plGdBuddyMlRate = plGdBuddyMlRate + PaymentUtil.AddComma( paymentItemInfoPolicy[i].GdBuddyMlRate.ToString());
                        plUseGubun = plUseGubun + PaymentUtil.AddComma( paymentItemInfoPolicy[i].UseGubun.Trim());
                        plBundleType = plBundleType + PaymentUtil.AddComma( paymentItemInfoPolicy[i].BundleType.Trim());
                        plDangolChanceAmt = plDangolChanceAmt + PaymentUtil.AddComma( paymentItemInfoPolicy[i].DangolChanceAmt.ToString());
                        plDangolChanceKind = plDangolChanceKind + PaymentUtil.AddComma( paymentItemInfoPolicy[i].DangolChanceKind.Trim());
                        plDntNo = plDntNo + PaymentUtil.AddComma( paymentItemInfoPolicy[i].DntNo.ToString());
                        plDntWhoFee = plDntWhoFee + PaymentUtil.AddComma( paymentItemInfoPolicy[i].DntWhoFee.Trim());
                        plDntSaveMoney = plDntSaveMoney + PaymentUtil.AddComma( paymentItemInfoPolicy[i].DntSaveMoney.ToString());
                        plMaxLimit = plMaxLimit + PaymentUtil.AddComma( paymentItemInfoPolicy[i].MaxLimit.ToString());
                        plTotalSaveMoney = plTotalSaveMoney + PaymentUtil.AddComma( paymentItemInfoPolicy[i].TotalSaveMoney.ToString());
                        plFreecSellerchargeyn = plFreecSellerchargeyn + PaymentUtil.AddComma( paymentItemInfoPolicy[i].FreecSellerchargeyn.Trim());
                        plJehuRsvServiceType = plJehuRsvServiceType + PaymentUtil.AddComma( paymentItemInfoPolicy[i].JehuRsvServiceType.Trim());
                        plJehuEstType = plJehuEstType + PaymentUtil.AddComma( paymentItemInfoPolicy[i].JehuEstType.Trim());
                        plGoodsRegDt = plGoodsRegDt + PaymentUtil.AddComma( paymentItemInfoPolicy[i].GoodsRegDt.Trim());
                        plBuyUnitCnt = plBuyUnitCnt + PaymentUtil.AddComma( paymentItemInfoPolicy[i].BuyUnitCnt.ToString());
                        plMinBuyCnt = plMinBuyCnt + PaymentUtil.AddComma( paymentItemInfoPolicy[i].MinBuyCnt.ToString());
                        plTemplateUrl = plTemplateUrl + PaymentUtil.AddComma( paymentItemInfoPolicy[i].TemplateUrl.Trim());
                        plShopGroupCd = plShopGroupCd + PaymentUtil.AddComma( paymentItemInfoPolicy[i].ShopGroupCd.ToString());
                        plShopGdlcCd = plShopGdlcCd + PaymentUtil.AddComma( paymentItemInfoPolicy[i].ShopGdlcCd.ToString());
                        plShopGdmcCd = plShopGdmcCd + PaymentUtil.AddComma( paymentItemInfoPolicy[i].ShopGdmcCd.ToString());
                        plShopGdscCd = plShopGdscCd + PaymentUtil.AddComma(paymentItemInfoPolicy[i].ShopGdscCd.ToString());

                    }
                }
            }
            else
            {
                throw new PaymentProcessBizException(-638, "상품 정보에 문제가 있습니다. 확인후 다시 주문해 주시기 바랍니다.");
            }

            PaymentInsertPolicyMultiParamT param = new PaymentInsertPolicyMultiParamT();

            #region set param

            param.OrderWayKind = paymentRequestInfo.OrderWayKind ;
            param.PaymentBasketPID = paymentBasketPID;
            param.PaymentDeliveryGroupNo = paymentDeliveryGroupNo;
            param.PaymentAmount = paymentAmount;
            param.ReceiverZipCode = paymentRequestInfo.ReceiverZipCode;
            param.Gbank = paymentRequestInfo.Gbank;
            param.Vaccount = paymentRequestInfo.Vaccount;
            param.Installmonth = paymentRequestInfo.Installmonth;
            param.SellerCustNo = paymentRequestInfo.SellerCustNo;
            param.PaymentOrderType = paymentRequestInfo.PaymentOrderType;
            param.CardCash = paymentRequestInfo.CardCash;
            param.AcntType = paymentRequestInfo.AcntType;
            //param.PackNo = packNo;

            param.ItemNo = plGdNo;
            param.PaymentGdSelNo = paymentGdSelNo;
            param.PaymentOrderIdx = paymentOrderIdx;
            param.GdNm = plGdNm;
            param.GdEngNm = plGdEngNm;
            param.GdKind = plGdKind;
            param.GdOrigin = plGdOrigin;
            param.GdlcCd = plGdlcCd;
            param.GdmcCd = plGdmcCd;
            param.GdscCd = plGdscCd;
            param.MakerNm = plMakerNm;
            param.BrandNm = plBrandNm;
            param.DealPriceKind = plDealPriceKind;
            param.DealPrice = plDealPrice;
            param.OpGd = plOpGd;
            param.AsYn = plAsYn;
            param.SellCustNo = plSellCustNo;
            param.GdShopkind = plGdShopkind;
            param.GdShopkind2 = plGdShopkind2;
            param.GdShopkind3 = plGdShopkind3;
            param.TradWay = plTradWay;
            param.TemplateType = plTemplateType;
            param.AdultYn = plAdultYn;
            param.Hasaddedfile = plHasaddedfile;
            param.InventoryNo = plInventoryNo;
            param.Inventorytype = plInventorytype;
            param.OptInventoryno = plOptInventoryno;
            param.OptInventorytype = plOptInventorytype;
            param.GdMadeSdt = plGdMadeSdt;
            param.AttribEndDt = plAttribEndDt;
            param.GdBuyerMlRate = plGdBuyerMlRate;
            param.GdBuddyMlRate = plGdBuddyMlRate;
            param.UseGubun = plUseGubun;
            param.BundleType = plBundleType;
            param.MinBuyCnt = plMinBuyCnt;
            param.BuyUnitCnt = plBuyUnitCnt;
            param.DangolChanceAmt = plDangolChanceAmt;
            param.DangolChanceKind = plDangolChanceKind;
            param.JehuRsvServiceType = plJehuRsvServiceType;
            param.JehuEstType = plJehuEstType;
            param.DntNo = plDntNo;
            param.DntWhoFee = plDntWhoFee;
            param.DntSaveMoney = plDntSaveMoney;
            param.FreecSellerchargeyn = plFreecSellerchargeyn;
            param.PaymentPrice = paymentPrice;
            param.PaymentSelItemPrice = paymentSelItemPrice;
            param.PaymentAmount = paymentAmount;
            param.PaymentDeliveryFee = paymentDeliveryFee;
            param.PaymentCostPrice = paymentCostPrice;
            param.PaymentDeliveryGroupNo = paymentDeliveryGroupNo;
            param.ShopGroupCd = plShopGroupCd;
            param.ShopGdlcCd = plShopGdlcCd;
            param.ShopGdmcCd = plShopGdmcCd;
            param.ShopGdscCd = plShopGdscCd;

            #endregion

            //int policyCount = paymentBiz.InsertGEPPaymentPolicyItemInfo(policyItemInfoList);

            List<PaymentInsertPolicyMultiResultT> paymentInsertPolicyMultiResult = paymentBiz.SetPaymentInsertPolicyMulti(param);

            if (paymentInsertPolicyMultiResult != null)
            {
                if (paymentInsertPolicyMultiResult.Count > 0)
                {
                    int retCode = paymentInsertPolicyMultiResult[0].RetCode;

                    if (retCode < 0)
                    {
                        throw new PaymentProcessBizException(retCode, "상품 정보에 문제가 있습니다. 확인후 다시 주문해 주시기 바랍니다.");
                    }

                    paymentOrderItem.OrderNo = string.Empty;

                    foreach (PaymentInsertPolicyMultiResultT item in paymentInsertPolicyMultiResult)
                    {
                        paymentOrderItem.PolicyInfoList.Add(item);

                        paymentOrderItem.OrderNo = PaymentUtil.AddComma(paymentOrderItem.OrderNo + item.OrderNo.ToString());
                    }
                }
            }

            return paymentOrderItem;
        }
Пример #5
0
        protected void btnPayment_Click(object sender, EventArgs e)
        {
            PaymentBiz    biz           = new PaymentBiz();
            LicenseBiz    bizLicense    = new LicenseBiz();
            string        ref1          = string.Empty;
            string        group         = string.Empty;
            string        headrequestNo = string.Empty;
            StringBuilder ChkUpload     = new StringBuilder();

            this.MasterLicense.lsLicensePayment.Clear();

            if (this.gvLicenseD.Rows.Count <= 0)
            {
                this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = SysMessage.LicenseYNotFound;
                this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError();
                this.MasterLicense.UpdatePanelLicense.Update();
            }
            else
            {
                #region Get UploadGroupNo

                for (int i = 0; i < gvLicenseD.Rows.Count; i++)
                {
                    HiddenField hf = (HiddenField)gvLicenseD.Rows[i].Cells[0].FindControl("hdfGroupUpLoadNo");

                    if (hf.Value != null)
                    {
                        //Get PersonLicenseTransaction from List
                        //var resD = this.CurrentSessionListDT.FirstOrDefault(idx => idx.UPLOAD_GROUP_NO.Equals(hf.Value));
                        var resD = this.SessionListDT.FirstOrDefault(idx => idx.UPLOAD_GROUP_NO.Equals(hf.Value));
                        if (resD != null)
                        {
                            ///Get & Set SubGroupPayment
                            this.MasterLicense.lsLicensePayment.Add(new DTO.SubGroupPayment
                            {
                                RUN_NO      = resD.RUN_NO,
                                uploadG     = resD.UPLOAD_GROUP_NO,
                                LicenseNo   = resD.LICENSE_NO,
                                RenewTime   = resD.RENEW_TIMES,
                                seqNo       = resD.SEQ_NO,
                                PaymentType = resD.PETITION_TYPE_CODE
                            });

                            this.MasterLicense.ListUploadGroupNo.Add(hf.Value);
                        }
                    }
                }
                #endregion

                #region สร้างใบสั่งจ่ายย่อย > NewCreatePayment

                DTO.ResponseService <string> res = biz.SetSubGroupSingleLicense(this.MasterLicense.lsLicensePayment.ToArray(), this.UserProfile.Id, this.UserProfile.Id, out ref1);
                if ((res.DataResponse != null) && (!res.IsError))
                {
                    this.PaymentStatus = true;
                    this.MasterLicense.UCLicenseUCLicenseModelSuccess.ShowMessageSuccess = SysMessage.CreatePaymentSuccess;
                    this.MasterLicense.UCLicenseUCLicenseModelSuccess.ShowModalSuccess();
                    this.MasterLicense.UpdatePanelLicense.Update();
                    group = ref1;

                    ChkUpload.Append(group);
                    ChkUpload.Append(" ");
                    ChkUpload.Append(this.UserProfile.Id);

                    GetAllLicense();
                    GetLicenseY();
                    //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopup('" + group + "')", true);
                }
                else
                {
                    this.PaymentStatus = false;
                    this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg;
                    this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError();
                    this.MasterLicense.UpdatePanelLicense.Update();
                    return;
                    //udpMain.Update();
                }

                if (this.PaymentStatus == true)
                {
                    ListPrintPayment.Add(group);
                    var resPrint = biz.UpdatePrintGroupRequestNo(ListPrintPayment.ToArray());
                    //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopup('" + group + "')", true);
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopup('" + ChkUpload.ToString() + "')", true);
                }

                #endregion
            }
        }
Пример #6
0
        protected void btnPayment_Click(object sender, EventArgs e)
        {
            PaymentBiz    biz           = new PaymentBiz();
            LicenseBiz    bizLicense    = new LicenseBiz();
            string        ref1          = string.Empty;
            string        group         = string.Empty;
            string        headrequestNo = string.Empty;
            StringBuilder ChkUpload     = new StringBuilder();

            if (this.ucLicensePaymentY.GridPayment.Rows.Count <= 0)
            {
                this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = SysMessage.LicenseYNotFound;
                this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError();
                this.MasterLicense.UpdatePanelLicense.Update();
                return;
            }
            else
            {
                #region Get UploadGroupNo

                for (int i = 0; i < ucLicensePaymentY.GridPayment.Rows.Count; i++)
                {
                    CheckBox chkDelete = (CheckBox)ucLicensePaymentY.GridPayment.Rows[i].Cells[0].FindControl("chkBxSelect");
                    if (chkDelete != null)
                    {
                        if (chkDelete.Checked)
                        {
                            HiddenField hf = (HiddenField)ucLicensePaymentY.GridPayment.Rows[i].Cells[0].FindControl("HiddenField1");

                            if (hf.Value != null)
                            {
                                //Get
                                DTO.ResponseService <DTO.PersonLicenseTransaction> resD = bizLicense.GetLicenseDetailByUploadGroupNo(hf.Value);
                                if ((resD.DataResponse != null) && (!resD.IsError))
                                {
                                    ///Get & Set SubGroupPayment
                                    var resLS = this.MasterLicense.lsLicensePayment.Where(ls => ls.uploadG == resD.DataResponse.UPLOAD_GROUP_NO).FirstOrDefault();
                                    if (resLS == null)
                                    {
                                        this.MasterLicense.lsLicensePayment.Add(new DTO.SubGroupPayment
                                        {
                                            uploadG     = resD.DataResponse.UPLOAD_GROUP_NO,
                                            LicenseNo   = resD.DataResponse.LICENSE_NO,
                                            RenewTime   = resD.DataResponse.RENEW_TIMES,
                                            seqNo       = resD.DataResponse.SEQ_NO,
                                            PaymentType = resD.DataResponse.PETITION_TYPE_CODE
                                        });

                                        this.MasterLicense.ListUploadGroupNo.Add(hf.Value);
                                    }
                                }
                            }
                        }
                    }
                }
                #endregion

                //ตรวจสอบรายการต่อใบสั่งจ่าย @1/7/2557
                int getSumConfig = GetSumConfigViewBillPayment();
                if (this.MasterLicense.ListUploadGroupNo.Count > getSumConfig)
                {
                    this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = "กรุณาตรวจสอบจำนวนรายการใบอนุญาตที่ต้องการออกใบสั่งจ่าย";
                    this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError();
                    this.MasterLicense.UpdatePanelLicense.Update();
                    return;
                }

                #region สร้างใบสั่งจ่ายย่อย > NewCreatePayment

                DTO.ResponseService <string> res = biz.SetSubGroupSingleLicense(this.MasterLicense.lsLicensePayment.ToArray(), this.UserProfile.Id, this.UserProfile.Id, out ref1);
                if ((res.DataResponse != null) && (!res.IsError))
                {
                    this.MasterLicense.UCLicenseUCLicenseModelSuccess.ShowMessageSuccess = SysMessage.CreatePaymentSuccess;
                    this.MasterLicense.UCLicenseUCLicenseModelSuccess.ShowModalSuccess();
                    this.MasterLicense.UpdatePanelLicense.Update();
                    group = ref1;

                    ChkUpload.Append(group);
                    ChkUpload.Append(" ");
                    ChkUpload.Append(this.UserProfile.Id);

                    //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopup('" + group + "')", true);
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopup('" + ChkUpload.ToString() + "')", true);

                    this.MasterLicense.lsLicensePayment.Clear();
                    this.MasterLicense.ListUploadGroupNo.Clear();
                    this.MasterLicense.PersonLicenseD.Clear();
                    this.MasterLicense.PersonLicenseH.Clear();
                    this.GetLicenseDetail();
                }
                else
                {
                    this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = res.ErrorMsg;
                    this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError();
                    this.MasterLicense.UpdatePanelLicense.Update();
                    return;
                }
                //this.MasterLicense.lsLicensePayment.Clear();
                //this.MasterLicense.ListUploadGroupNo.Clear();
                #endregion
            }
        }
Пример #7
0
        /// <summary>
        /// 주문 실행 전 주문건별 Validation 및 주문정보 생성
        /// </summary>
        /// <returns></returns>
        private void PaymentPrepare()
        {
            PaymentBiz paymentBiz = new PaymentBiz();
            PaymentProcessQueryBiz paymentProcessQueryBiz = new PaymentProcessQueryBiz();

            List<PaymentOrderItemCostInfoT> paymentOrderItemCostInfoList = new List<PaymentOrderItemCostInfoT>();
            List<PaymentDataOrderInfoT> paymentDataOrderInfoList = new List<PaymentDataOrderInfoT>();
            List<PaymentDataCostBasisInfoT> paymentDataCostBasisInfoList = new List<PaymentDataCostBasisInfoT>();

            List<string> exItem = new List<string>();
            bool isExistCartOptionInfo = false;
            string orderSrc = string.Empty;
            string deliveryHopeDay = string.Empty;
            string orderKind = "O";
            long sellOrderNo = 0;
            int costBasisNo = 0;
            int jaehuCostPrice = 0;
            decimal itemDiscountPrice = 0;
            decimal itemDiscountLastCost = 0;
            decimal itemCurrentCostPrice = 0;

            #region 구매자 이메일

            if (this._orderParam.MemberWay.Equals("MEM", StringComparison.InvariantCultureIgnoreCase) && string.IsNullOrEmpty(this._orderParam.BuyerEmail))
            {
                PaymentCustomInfoT paymentCustomInfo = paymentBiz.GetPaymentCustomInfo(this._orderParam.CustNo);

                this._orderParam.BuyerEmail = paymentCustomInfo.EMail;
            }

            #endregion

            #region 현금 영수증 발급 자동화

            if (this._orderParam.CashReceiptYN.Equals("Y", StringComparison.InvariantCultureIgnoreCase))
            {
                try
                {
                    PaymentAutoCashReceiptInfoT autoCashReceiptInfo = paymentProcessQueryBiz.GetAutoCashReceiptInfo(this._orderParam);

                    this._orderParam.CashUseType = autoCashReceiptInfo.ReceiptType;
                    this._orderParam.CashRegNo = autoCashReceiptInfo.IDNumber;
                    this._orderParam.CashName = autoCashReceiptInfo.Demander;
                    this._orderParam.CashPhone = autoCashReceiptInfo.Contact;
                    this._orderParam.CashEmail = autoCashReceiptInfo.Email;
                    this._orderParam.IdFlag = autoCashReceiptInfo.IDFlag;
                }
                catch
                {
                    throw new PaymentProcessBizException(-418, "주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                }
            }

            #endregion

            #region 주문을 위한 조건들 확인

            try
            {
                PaymentInfoCheckT paymentInfoCheck = paymentProcessQueryBiz.GetPaymentInfoCheck(this._orderParam.CardCash, this._orderParam.BuyerName, this._orderParam.MemberWay
                                , this._orderParam.AcntType, this._orderParam.VirtualCardKind, string.Empty, this._orderParam.CardNumber
                                , this._orderParam.CardYear, this._orderParam.CardMonth, this._orderParam.CardPwd, this._orderParam.SocialNo2
                                , this._orderParam.Xid, this._orderParam.Cavv, this._orderParam.KVPSessionkey, this._orderParam.KVPEncdata
                                , this._orderParam.Gbank, this._orderParam.DepositNm, this._orderParam.Eci);

                if (paymentInfoCheck.RetCode < 0)
                {
                    throw new PaymentProcessBizException(paymentInfoCheck.RetCode, "주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                }

                this._orderParam.Gbank = paymentInfoCheck.Gbank;
                this._orderParam.DepositNm = paymentInfoCheck.DepositName;

                this._paymenPayMethodtInfo = paymentInfoCheck;
            }
            catch
            {
                throw new PaymentProcessBizException(-372, "주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
            }

            #endregion

            #region 장바구니 주문건에 필수선택/추가구성 존재여부 조회

            isExistCartOptionInfo = paymentProcessQueryBiz.GetExistCartOptionInfo(this._orderParam.BasketPID).IsExist;

            #endregion

            #region 장바구니에 담긴 주문 건별로 점검

            foreach (PaymentGEPItemInfoT item in this._paymentGEPItemInfoList)
            {
                #region 변수 초기화

                sellOrderNo = 0;
                jaehuCostPrice = 0;

                #endregion

                #region 상품별 정책 조회

                PaymentDscontrPolicyInfoT dscontrPolicyInfo = paymentProcessQueryBiz.GetDscontrPolicyInfo(item.ItemNo, item.OrderNo);

                #endregion

                #region 내용 보정

                // 주문 수량 보전
                if (item.OrderCnt <= 0)
                    item.OrderCnt = 1;

                #endregion

                #region 판매시장 정상여부 확인

                if (string.IsNullOrEmpty(dscontrPolicyInfo.TradWay))
                {
                    throw new PaymentProcessBizException(-607, "주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                }

                #endregion

                #region GlinkNation 체크

                // 이거 이상한 코드일세..
                if (!item.GlinkNation.Equals("SG", StringComparison.InvariantCultureIgnoreCase) &&
                    !item.GlinkNation.Equals("JP", StringComparison.InvariantCultureIgnoreCase))
                {
                    item.GlinkNation = string.Empty;
                }

                if (!item.GlinkNation.Equals("SG", StringComparison.InvariantCultureIgnoreCase) &&
                    !item.GlinkNation.Equals("JP", StringComparison.InvariantCultureIgnoreCase) &&
                    !item.GlinkNation.Equals("AC", StringComparison.InvariantCultureIgnoreCase))
                {
                    item.GlinkNation = string.Empty;
                }

                #endregion

                #region 샵주문 정보 입력

                if (!string.IsNullOrEmpty(this._orderParam.PrimaryCheckValue) && !this._orderParam.PrimaryCheckValue.Equals("KOR", StringComparison.InvariantCultureIgnoreCase))
                {
                    try
                    {
                        int retCode = paymentProcessQueryBiz.SetOrderSiteInfo(this._orderParam.PrimaryCheckValue
                            , item.ItemNo, dscontrPolicyInfo.OrderNo, this._orderParam.OrderDateTime, dscontrPolicyInfo.ShopGroupCd
                            , dscontrPolicyInfo.ShopGdlcCd, dscontrPolicyInfo.ShopGdmcCd, dscontrPolicyInfo.ShopGdscCd);

                        if (retCode != 0)
                        {
                            //throw new PaymentProcessBizException(-729, "주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                            throw new PaymentProcessBizException(-729, retCode.ToString());
                        }
                    }
                    catch (Exception ex)
                    {
                        //throw new PaymentProcessBizException(-729, "주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                        throw new PaymentProcessBizException(-729, ex.Message);
                    }
                }

                #endregion

                #region 공동구매 상품 존재 여부 체크

                PaymentExistResultT existGroupGoods = paymentProcessQueryBiz.GetExistGroupGoods(item.ItemNo);

                if (existGroupGoods.IsExist)
                {
                    throw new PaymentProcessBizException(-627, "공동구매 상품은 장바구니 주문을 하실 수 없습니다. 확인후 다시 주문해 주시기 바랍니다.");
                }

                if (dscontrPolicyInfo.GdShopkind == "8" || dscontrPolicyInfo.GdShopkind2 == "8" || dscontrPolicyInfo.GdShopkind3 == "8")
                {
                    throw new PaymentProcessBizException(-628, "공동구매 상품은 장바구니 주문을 하실 수 없습니다. 확인후 다시 주문해 주시기 바랍니다.");
                }

                #endregion

                #region GMall, 공구, 오픈마켓 상품에 대해 품절 체크

                if (dscontrPolicyInfo.TradWay.Equals("T1", StringComparison.InvariantCultureIgnoreCase) ||
                    dscontrPolicyInfo.TradWay.Equals("T4", StringComparison.InvariantCultureIgnoreCase) ||
                    dscontrPolicyInfo.TradWay.Equals("T6", StringComparison.InvariantCultureIgnoreCase))
                {
                    PaymentExistResultT existDsprice = paymentProcessQueryBiz.GetExistDsprice(item.ItemNo, item.OrderCnt, (decimal)item.OrderPrice);

                    if (!existDsprice.IsExist)
                    {
                        paymentProcessQueryBiz.UpdateCartOrderFail(this._orderParam.BasketPID, this._orderParam.CustNo, item.ItemNo);

                        exItem.Add(item.ItemNo);
                    }
                }

                if (exItem.Count > 0)
                {
                    throw new PaymentProcessBizException(-509, "상품의 재고가 부족합니다.");
                }

                #endregion

                #region 판매자 직결제 정보 조회

                PaymentAccountmDirectInfoT accountmDirectInfo = paymentProcessQueryBiz.GetAccountmDirectInfo(dscontrPolicyInfo.SellCustNo);

                if (accountmDirectInfo == null)
                {
                    accountmDirectInfo = new PaymentAccountmDirectInfoT
                    {
                        SCustNo = string.Empty,
                        Seqno = 0
                    };
                }

                #endregion

                #region 스탬프 발급 수량 조회

                PaymentStickerGoodsInfoT stickerGoodsInfo = paymentProcessQueryBiz.GetStickerGoodsInfo(item.ItemNo, this._orderParam.OrderDateTime);

                if (stickerGoodsInfo == null)
                {
                    stickerGoodsInfo = new PaymentStickerGoodsInfoT
                    {
                        StickerCnt = 0,
                        WhoFee = string.Empty
                    };
                }

                stickerGoodsInfo.StickerCnt = stickerGoodsInfo.StickerCnt * item.OrderCnt;

                #endregion

                #region 선택정보 및 옵션상품에 대한 체크 기능 변경/옵션상품값 체크 (선택옵션의 합을 구함)

                PaymentCartOptionInfoSumT cartOptionInfoSum;
                if (isExistCartOptionInfo)
                {
                    try
                    {
                        cartOptionInfoSum = paymentProcessQueryBiz.GetCartOptionInfoSum(this._orderParam.BasketPID, item.OrderIdx);
                    }
                    catch
                    {
                        throw new PaymentProcessBizException(-505, "옵션상품가격 처리 시 에러 발생.");
                    }
                }
                else
                {
                    cartOptionInfoSum = new PaymentCartOptionInfoSumT();
                }

                #endregion

                #region 복수구매할인 주문인 경우 0원 주문 가능

                if (item.BundCondNo > 0 ||
                    (dscontrPolicyInfo.GdShopkind.Equals("U", StringComparison.InvariantCultureIgnoreCase) ||
                    dscontrPolicyInfo.GdShopkind2.Equals("U", StringComparison.InvariantCultureIgnoreCase) ||
                    dscontrPolicyInfo.GdShopkind3.Equals("U", StringComparison.InvariantCultureIgnoreCase)))
                {
                    if ((item.OrderPrice * item.OrderCnt) + cartOptionInfoSum.SelItemPrice - item.CostPrice < 0)
                    {
                        throw new PaymentProcessBizException(-608, "0원 미만 주문.");
                    }
                }
                else
                {
                    if ((item.OrderPrice * item.OrderCnt) + cartOptionInfoSum.SelItemPrice - item.CostPrice <= 0)
                    {
                        throw new PaymentProcessBizException(-123, "0원 이하 주문.");
                    }
                }

                #endregion

                #region 제휴ID에 따른 제휴사 SET

                if (Validate.IsNumeric(item.Jaehuid) && item.Jaehuid.Length == 9)
                {
                    if (!paymentProcessQueryBiz.GetExistBannerContract(item.Jaehuid, this._orderParam.OrderDateTime).IsExist)
                    {
                        orderSrc = "F";
                    }
                }

                orderSrc = item.Jaehuid == "200002328" ? "F" : item.Jaehuid;

                #endregion

                #region 할인금액이 넘어왔을 경우 실제로 장바구니 할인 테이블에 할인 내역 존재하는지 체크

                if (item.CostPrice > 0 && !paymentProcessQueryBiz.GetExistCartCostInfo(this._orderParam.BasketPID, item.OrderIdx).IsExist)
                {
                    throw new PaymentProcessBizException(-112, "주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                }

                if (item.DealerCostPrice > 0 && item.DealerCostBasisNo <= 0)
                {
                    throw new PaymentProcessBizException(-128, "주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                }

                #endregion

                #region 배송비에 따른 배송비 그룹 번호 확인

                if (dscontrPolicyInfo.DeliveryFee != 0 && dscontrPolicyInfo.DeliveryGroupNo == 0)
                {
                    throw new PaymentProcessBizException(-209, "주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                }

                #endregion

                #region 최소구매수량, 구매단위 확인

                if (item.OrderCnt < dscontrPolicyInfo.MinBuyCnt)
                {
                    throw new PaymentProcessBizException(-605, "주문 수량은 최소 구매 수량보다 많아야 합니다. 주문은 접수되지 않았습니다.");
                }

                if ((item.OrderCnt % (dscontrPolicyInfo.BuyUnitCnt > 0 ? dscontrPolicyInfo.BuyUnitCnt : 1)) != 0)
                {
                    throw new PaymentProcessBizException(-606, "주문 수량은 구매단위의 배수이어야 합니다. 주문은 접수되지 않았습니다.");
                }

                #endregion

                #region PDF 할인 정보 조회

                PaymentPdcDiscountPriceT pdcDiscountPrice = paymentProcessQueryBiz.GetPdcDiscountPrice(item.Jaehuid, item.ItemNo);

                if (pdcDiscountPrice == null)
                {
                    pdcDiscountPrice = new PaymentPdcDiscountPriceT { PdcDiscountPrice = 0 };
                }
                else
                {
                    if (!pdcDiscountPrice.PdcDiscountPriceSpecified)
                        pdcDiscountPrice.PdcDiscountPrice = 0;
                }

                #endregion

                #region 할인 정보

                List<PaymentDataCostBasisInfoT> costBasisInfo = paymentProcessQueryBiz.GetCostBasisInfo(this._orderParam.PackNo, dscontrPolicyInfo.OrderNo, item.ItemNo, item.OrderCnt, item.OrderPrice, this._orderParam.BasketPID
                                    , item.OrderIdx, pdcDiscountPrice.PdcDiscountPrice, item.BundSatisCnt, item.PackSatisCnt, dscontrPolicyInfo.GdShopkind
                                    , dscontrPolicyInfo.GdShopkind2, dscontrPolicyInfo.GdShopkind3, dscontrPolicyInfo.DeliveryFee
                                    , dscontrPolicyInfo.DeliveryFeeCondition, dscontrPolicyInfo.DeliveryFeePolicy, cartOptionInfoSum.SelItemPrice, this._orderParam.OrderDateTime);

                if (costBasisInfo != null && costBasisInfo.Count > 0)
                {
                    // 판매자 공제금 처리를 위한 제휴할인액
                    jaehuCostPrice = Util.GetSafeInt(costBasisInfo.Sum(x => x.JaehuCostPrice));

                    //복수구매할인 원단위 절삭
                    if (costBasisInfo.Any(x => x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("BDC", StringComparison.InvariantCultureIgnoreCase)))
                    {
                        itemDiscountPrice = 0;
                        itemDiscountLastCost = 0;

                        itemDiscountPrice =
                            (from x in costBasisInfo
                             where x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("BDC", StringComparison.InvariantCultureIgnoreCase)
                             select x).Sum(x => x.CostPrice);
                        itemDiscountLastCost = itemDiscountPrice > 0 ? itemDiscountPrice % 10 : 0;

                        if (itemDiscountLastCost != 0)
                        {
                            if (costBasisInfo.Any(x => x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("BDC", StringComparison.InvariantCultureIgnoreCase) && x.WhoFee.Equals("GD", StringComparison.InvariantCultureIgnoreCase)))
                            {
                                (from x in costBasisInfo
                                 where x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("BDC", StringComparison.InvariantCultureIgnoreCase) && x.WhoFee.Equals("GD", StringComparison.InvariantCultureIgnoreCase)
                                 select x).ToList().ForEach(x=> x.CostPrice = x.CostPrice - itemDiscountLastCost);
                            }
                            else
                            {
                                (from x in costBasisInfo
                                 where x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("BDC", StringComparison.InvariantCultureIgnoreCase) && x.WhoFee.Equals("ME", StringComparison.InvariantCultureIgnoreCase)
                                 select x).ToList().ForEach(x=> x.CostPrice = x.CostPrice - itemDiscountLastCost);
                            }
                        }
                    }

                    // 세트구매할인 원단위 절삭
                    if (costBasisInfo.Any(x => x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("SET", StringComparison.InvariantCultureIgnoreCase)))
                    {
                        itemDiscountPrice = 0;
                        itemDiscountLastCost = 0;

                        itemDiscountPrice =
                            (from x in costBasisInfo
                             where x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("SET", StringComparison.InvariantCultureIgnoreCase)
                             select x).Sum(x => x.CostPrice);
                        itemDiscountLastCost = itemDiscountPrice > 0 ? itemDiscountPrice % 10 : 0;

                        if (itemDiscountLastCost != 0)
                        {
                            if (costBasisInfo.Any(x => x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("SET", StringComparison.InvariantCultureIgnoreCase) && x.WhoFee.Equals("GD", StringComparison.InvariantCultureIgnoreCase)))
                            {
                                (from x in costBasisInfo
                                 where x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("SET", StringComparison.InvariantCultureIgnoreCase) && x.WhoFee.Equals("GD", StringComparison.InvariantCultureIgnoreCase)
                                 select x).ToList().ForEach(x=> x.CostPrice = x.CostPrice - itemDiscountLastCost);
                            }
                            else
                            {
                                (from x in costBasisInfo
                                 where x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("SET", StringComparison.InvariantCultureIgnoreCase) && x.WhoFee.Equals("ME", StringComparison.InvariantCultureIgnoreCase)
                                 select x).ToList().ForEach(x=> x.CostPrice = x.CostPrice - itemDiscountLastCost);
                            }
                        }
                    }

                    // Pack할인 원단위 절삭
                    if (costBasisInfo.Any(x => x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("CBD", StringComparison.InvariantCultureIgnoreCase)))
                    {
                        itemDiscountPrice = 0;
                        itemDiscountLastCost = 0;

                        itemDiscountPrice =
                            (from x in costBasisInfo
                             where x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("CBD", StringComparison.InvariantCultureIgnoreCase)
                             select x).Sum(x => x.CostPrice);
                        itemDiscountLastCost = itemDiscountPrice > 0 ? itemDiscountPrice % 10 : 0;

                        if (itemDiscountLastCost != 0)
                        {
                            if (costBasisInfo.Any(x => x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("CBD", StringComparison.InvariantCultureIgnoreCase) && x.WhoFee.Equals("GD", StringComparison.InvariantCultureIgnoreCase)))
                            {
                                (from x in costBasisInfo
                                 where x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("CBD", StringComparison.InvariantCultureIgnoreCase) && x.WhoFee.Equals("GD", StringComparison.InvariantCultureIgnoreCase)
                                 select x).ToList().ForEach(x => x.CostPrice = x.CostPrice - itemDiscountLastCost);
                            }
                            else
                            {
                                (from x in costBasisInfo
                                 where x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("CBD", StringComparison.InvariantCultureIgnoreCase) && x.WhoFee.Equals("ME", StringComparison.InvariantCultureIgnoreCase)
                                 select x).ToList().ForEach(x => x.CostPrice = x.CostPrice - itemDiscountLastCost);
                            }
                        }
                    }

                    // fix : 나중에 해결하자.
                    // 카테고리 할인 확인
                    if (costBasisInfo.Any(x => x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.BasisKind.Equals("CPD", StringComparison.InvariantCultureIgnoreCase)))
                    {

                    }

                    // 주문별 할인 총액 계산
                    itemCurrentCostPrice = 0;
                    itemCurrentCostPrice = Util.GetSafeInt(costBasisInfo.Sum(x => x.CostPrice));

                    if (itemCurrentCostPrice != item.CostPrice)
                    {
                        if (costBasisInfo.Any(x => x.ItemNo == item.ItemNo && x.BuyOrderNo == dscontrPolicyInfo.OrderNo && x.CostBasisNo == 2238819))
                        {
                            throw new PaymentProcessBizException(-124, "할인 금액 오류입니다. 주문은 접수되지 않았습니다.");
                        }
                        else
                        {
                            throw new PaymentProcessBizException(-122, "할인 금액 오류입니다. 주문은 접수되지 않았습니다.");
                        }
                    }

                    costBasisNo = item.CostPrice > 0 ? -1 : 0;

                    paymentDataCostBasisInfoList.AddRange(costBasisInfo);
                }
                #endregion

                #region 변수들 SET

                if (this._orderParam.CardCash.Equals("DIRECT", StringComparison.InvariantCultureIgnoreCase))
                {
                    orderSrc = "F";
                    orderKind = "D";
                }

                #endregion

                #region 팔자주문 번호 처리

                if (!this._orderParam.OrderWayKind.Equals("BAR", StringComparison.InvariantCultureIgnoreCase))
                {
                    try
                    {
                        PaymentSellOrderInfoT sellOrderInfo = paymentProcessQueryBiz.GetSellOrderInfo(this._orderParam.OrderWayKind
                                            , item.ItemNo, item.OrderPrice, item.OrderCnt, "Y");

                        if (sellOrderInfo == null)
                        {
                            sellOrderInfo = new PaymentSellOrderInfoT
                            {
                                ContrOrderNo = 0,
                                ContrSellCustNo = string.Empty,
                                SellStat = string.Empty
                            };
                        }

                        sellOrderInfo.ContrSellCustNo = string.IsNullOrEmpty(sellOrderInfo.ContrSellCustNo) ? string.Empty : sellOrderInfo.ContrSellCustNo.Trim();

                        if (sellOrderInfo.ContrOrderNo == 0 && string.IsNullOrEmpty(sellOrderInfo.ContrSellCustNo))
                        {
                            paymentProcessQueryBiz.UpdateCartOrderFail(this._orderParam.BasketPID, this._orderParam.CustNo, item.ItemNo);

                            throw new PaymentProcessBizException(-739, string.Format("재고 부족(상품번호 : {0})", item.ItemNo));
                        }

                        if (sellOrderInfo.ContrOrderNo == -1)
                        {
                            throw new PaymentProcessBizException(-753, "주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                        }

                        sellOrderNo = sellOrderInfo.ContrOrderNo;
                        dscontrPolicyInfo.SellCustNo = sellOrderInfo.ContrSellCustNo;
                    }
                    catch
                    {
                        throw new PaymentProcessBizException(-738, "주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                    }
                }

                #endregion

                #region 공급원가 기록

                if (!this._orderParam.OrderWayKind.Equals("BAR", StringComparison.InvariantCultureIgnoreCase))
                {
                    try
                    {
                        PaymentItemCostCalculateInfoT itemCostCalculateInfo = paymentProcessQueryBiz.GetItemCostCalculateInfo(item.ItemNo, dscontrPolicyInfo.OrderNo, dscontrPolicyInfo.SellCustNo
                                                , this._orderParam.OrderWayKind, item.OrderPrice, item.OrderCnt, orderKind, dscontrPolicyInfo.TradWay
                                                , dscontrPolicyInfo.GdShopkind, dscontrPolicyInfo.GdShopkind2, dscontrPolicyInfo.GdShopkind3
                                                , this._orderParam.LoginID, 0, 0, 0, string.Empty, sellOrderNo);

                        if (itemCostCalculateInfo == null)
                        {
                            throw new PaymentProcessBizException(-743, "주문주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                        }

                        if (itemCostCalculateInfo.RetCode < 0)
                        {
                            throw new PaymentProcessBizException(itemCostCalculateInfo.RetCode, "주문주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                        }

                        paymentOrderItemCostInfoList.Add(new PaymentOrderItemCostInfoT
                        {
                            ItemNo = item.ItemNo,
                            OrderNo = dscontrPolicyInfo.OrderNo,
                            SellerCustNo = dscontrPolicyInfo.SellCustNo,
                            SellerType = itemCostCalculateInfo.SellerType,
                            SellerCustType = itemCostCalculateInfo.SellerCustType,
                            OrderWayKind = this._orderParam.OrderWayKind,
                            OrderKind = orderKind,
                            ContrWay = dscontrPolicyInfo.TradWay,
                            GdShopKind1 = dscontrPolicyInfo.GdShopkind,
                            GdShopKind2 = dscontrPolicyInfo.GdShopkind2,
                            GdShopKind3 = dscontrPolicyInfo.GdShopkind3,
                            SettleFlag = itemCostCalculateInfo.SettleFlag,
                            WhoFee = itemCostCalculateInfo.WhoFee,
                            HowFee = itemCostCalculateInfo.HowFee,
                            SettleUom = itemCostCalculateInfo.SettleUom,
                            ItemCost = itemCostCalculateInfo.ItemCost,
                            ItemRate = itemCostCalculateInfo.ItemRate,
                            TransPrice = itemCostCalculateInfo.TransPrice,
                            SettleType = itemCostCalculateInfo.SettleType,
                            RegDt = this._orderParam.OrderDateTime,
                            RegId = this._orderParam.LoginID,
                            ChgDt = this._orderParam.OrderDateTime,
                            ChgId = this._orderParam.LoginID
                        });
                    }
                    catch
                    {
                        throw new PaymentProcessBizException(-736, "주문주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                    }
                }

                #endregion

                #region 상품에 대한 주문 정보

                try
                {
                    paymentDataOrderInfoList.Add(new PaymentDataOrderInfoT
                    {
                        PackNo = this._orderParam.PackNo,
                        OrderNo = dscontrPolicyInfo.OrderNo,
                        ItemNo = item.ItemNo,
                        OrderPrice = item.OrderPrice,
                        OrderCnt = item.OrderCnt,
                        OrderIdx = item.OrderIdx,
                        Interval = item.Interval,
                        TradWay = dscontrPolicyInfo.TradWay,
                        GdBuyerMlRate = dscontrPolicyInfo.GdBuyerMlRate,
                        GdBuddyMlRate = dscontrPolicyInfo.GdBuddyMlRate,
                        OrderWayKind = this._orderParam.OrderWayKind,
                        DeliveryFee = dscontrPolicyInfo.DeliveryFee,
                        DeliveryGroupNo = dscontrPolicyInfo.DeliveryGroupNo,
                        CostPrice = item.CostPrice,
                        CostBasisNo = costBasisNo,
                        DelMemo = item.DelMemo,
                        DealerCostPrice = item.DealerCostPrice,
                        DealerCostBasisNo = item.DealerCostBasisNo,
                        DntNo = dscontrPolicyInfo.DntNo,
                        DntSaveMoney = dscontrPolicyInfo.DntSaveMoney,
                        MinSellOrderNo = sellOrderNo,
                        CouponNo = "0",
                        StickerCnt = stickerGoodsInfo.StickerCnt,
                        StickerWhofee = stickerGoodsInfo.WhoFee,
                        OrderSrc = orderSrc,
                        PolicyNo = item.PolicyNo,
                        JaehuCostPrice = jaehuCostPrice,
                        BundCondNo = item.BundCondNo,
                        BundSatisCnt = item.BundSatisCnt,
                        TaxIssueYn = item.TaxIssueYn,
                        CashIssueYn = item.CashIssueYn,
                        SCustNo = accountmDirectInfo.SCustNo,
                        AdNo = accountmDirectInfo.Seqno,
                        SetCostNo = item.SetCostNo,
                        SetCondNo = item.SetCondNo,
                        GlinkNation = item.GlinkNation,
                        PackCostNo = item.PackCostNo,
                        PackCondNo = item.PackCondNo,
                        PackSatisCnt = item.PackSatisCnt,
                        OutOrderNo = item.OutOrderNo,
                        SelItemPrice = cartOptionInfoSum.SelItemPrice,
                        OptSelPrice = cartOptionInfoSum.OptSelPrice,
                        OptAddPrice = cartOptionInfoSum.OptAddPrice,
                        GepOrderNo = Convert.ToInt64(item.OutOrderNo),
                    });
                }
                catch
                {
                    throw new PaymentProcessBizException(-1102, "주문주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                }

                #endregion

            }

            #endregion

            #region 상품수량 맞는지 확인

            if (this._paymentGEPItemInfoList.Count != paymentDataOrderInfoList.Count)
            {
                throw new PaymentProcessBizException(-1103, "주문주문 접수중에 문제가 발생했습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
            }

            #endregion

            // fix : 아래는 주문 데이터 입력전까지 중간에 행해지는데 마땅한데가 없어서 일단 여기 넣음

            #region 구매 제한 수량 초과 여부 점검

            if (paymentProcessQueryBiz.GetOrderLimitItemCount(this._orderParam.CustNo, this._orderParam.PackNo, this._orderParam.OrderDateTime) > 0)
            {
                throw new PaymentProcessBizException(-609, "구매 제한 수량을 초과한 상품이 존재합니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
            }

            #endregion

            #region 개인별 할인쿠폰의 사용여부를 체크

            if (paymentDataCostBasisInfoList.Any(x => x.PackNo == this._orderParam.PackNo && x.BasisKind.Equals("PCP", StringComparison.InvariantCultureIgnoreCase)))
            {
                var groupedCostBasisInfo =
                    (from x in paymentDataCostBasisInfoList
                     where x.PackNo == this._orderParam.PackNo && x.BasisKind.Equals("PCP", StringComparison.InvariantCultureIgnoreCase)
                     group x by x.CouponNo into g
                     select new { CouponNo = g.Key, Count = g.Count() }
                    );

                if (groupedCostBasisInfo.Max(x=>x.Count) > 1)
                {
                    throw new PaymentProcessBizException(-107, "중복 할인쿠폰이 존재합니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                }

                if (paymentProcessQueryBiz.GetExistUsedCoupon(this._orderParam.CustNo, this._orderParam.PackNo).IsExist)
                {
                    throw new PaymentProcessBizException(-107, "이미 사용한 할인쿠폰이 존재합니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                }

                if (paymentProcessQueryBiz.GetNotExistCoupon(this._orderParam.CustNo, this._orderParam.PackNo, this._orderParam.OrderDateTime).IsExist)
                {
                    throw new PaymentProcessBizException(-120, "받으신 할인쿠폰이 존재하지 않습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
                }
            }

            #endregion

            #region 주문 유입 채널정보

            // 주문시 직방 체크 공통
            PaymentJaehuTypeInfoT jaehuTypeCheck = paymentProcessQueryBiz.GetJaehuTypeCheck(this._orderParam.JaehuID, this._orderParam.OrderDateTime);

            // 주문 유입 채널정보
            if (Validate.IsNumeric(this._orderParam.JaehuID) && this._orderParam.JaehuID.Length == 9)
            {
                if (this._orderParam.JaehuID == "200002328" || paymentProcessQueryBiz.GetNotExistContractInfo(this._orderParam.JaehuID, this._orderParam.OrderDateTime).IsExist)
                {
                    this._orderParamEtc.OrderJaehuID = "F";
                }
                else
                {
                    this._orderParamEtc.OrderJaehuID = this._orderParam.JaehuID;
                }
            }
            else if (string.IsNullOrEmpty(this._orderParam.JaehuID))
            {
                this._orderParamEtc.OrderJaehuID = "D";
            }

            this._orderParamEtc.DirectYN = jaehuTypeCheck.DirectYN;

            #endregion

            // [끝] 아래는 주문 데이터 입력전까지 중간에 행해지는데 마땅한데가 없어서 일단 여기 넣음

            this._paymentOrderItemCostInfoList = paymentOrderItemCostInfoList;
            this._paymentDataOrderInfoList = paymentDataOrderInfoList;
            this._paymentDataCostBasisInfoList = paymentDataCostBasisInfoList;
        }
Пример #8
0
        /// <summary>
        /// 주문 실행
        /// </summary>
        /// <param name="orderParam"></param>
        /// <param name="orderParamEtc"></param>
        /// <param name="paymenPayMethodtInfo"></param>
        /// <param name="paymentDataOrderInfoList"></param>
        /// <param name="paymentDataCostBasisInfoList"></param>
        /// <param name="paymentOrderItemCostInfoList"></param>
        /// <returns></returns>
        //private List<PaymentGEPOrderMultiResultT> PaymentStartOrder()
        private PaymentGEPPaymentProcessResultT PaymentExecuteOrder(PaymentOrderMultiParamT orderParam
			, PaymentOrderMultiParamEtcT orderParamEtc
			, PaymentInfoCheckT paymenPayMethodtInfo
			, List<PaymentDataOrderInfoT> paymentDataOrderInfoList
			, List<PaymentDataCostBasisInfoT> paymentDataCostBasisInfoList
			, List<PaymentOrderItemCostInfoT> paymentOrderItemCostInfoList)
        {
            PaymentGEPPaymentProcessResultT orderResult = new PaymentGEPPaymentProcessResultT();

            PaymentBiz paymentBiz = new PaymentBiz();
            PaymentProcessQueryBiz paymentProcessQueryBiz = new PaymentProcessQueryBiz();

            orderResult.Result = new GEPBaseResultT();

            #region 주문

            #region 주문 실행

            PaymentGEPPaymentProcessResultT paymentExecuteOrderResult = paymentProcessQueryBiz.PaymentExecuteOrder(
                orderParam
                , orderParamEtc
                , paymenPayMethodtInfo
                , paymentDataOrderInfoList
                , paymentDataCostBasisInfoList
                , paymentOrderItemCostInfoList);

            #endregion

            #region 주문 이후 처리

            GEPBaseResultT followUpResult = PaymentExecuteOrderFollowUp(orderParam);

            if (followUpResult.RetCode != 0)
            {
                orderResult.Result = followUpResult;
            }

            #endregion

            #region 주문 내역 조회

            List<PaymentGEPOrderMultiResultT> orderItemList = GetExecuteOrderItemList(paymentDataOrderInfoList);

            #endregion

            #region 주문 CleanUp

            try
            {
                PaymentExecuteOrderCleanUp(orderParam);
            }
            catch
            {

            }

            #endregion

            paymentExecuteOrderResult.OrderResultList.AddRange(orderItemList);

            #endregion

            #region 주문 결과 처리

            if (paymentExecuteOrderResult.OrderResultList == null)
            {
                orderResult.Result.RetCode = -1107;
                orderResult.Result.RetMessage = "주문 접수중에 문제가 발생하여 결제가 이루어지지 않았습니다. 확인후 다시 주문해 주시기 바랍니다";
            }
            else
            {
                if (paymentExecuteOrderResult.OrderResultList.Count <= 0)
                {
                    orderResult.Result.RetCode = -1108;
                    orderResult.Result.RetMessage = "주문 접수중에 문제가 발생하여 결제가 이루어지지 않았습니다. 확인후 다시 주문해 주시기 바랍니다";
                }
                else
                {
                    orderResult.Result.RetCode = paymentExecuteOrderResult.OrderResultList[0].RetCode;
                    orderResult.Result.RetMessage = paymentExecuteOrderResult.OrderResultList[0].RetReason;

                    orderResult.OrderResultList.AddRange(paymentExecuteOrderResult.OrderResultList);
                }
            }

            #endregion

            return orderResult;
        }
Пример #9
0
        /// <summary>
        /// 주문 Parameter Validator
        /// </summary>
        private void PaymentValidateParameter()
        {
            // pid 확인
            Guid basketPid = new Guid();
            if (!Guid.TryParse(_orderParam.BasketPID, out basketPid))
            {
                throw new PaymentProcessBizException(-8, "주문 접수중에 문제가 발생하여 결제가 이루어지지 않았습니다. 확인후 다시 주문해 주시기 바랍니다.");
            }

            // 회원만 가능
            if (string.IsNullOrEmpty(_orderParam.MemberWay) || !_orderParam.MemberWay.Equals("MEM", StringComparison.InvariantCultureIgnoreCase))
            {
                throw new PaymentProcessBizException(-404, "회원 구분을 알 수 없습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
            }

            // 회원번호 확인
            if (string.IsNullOrEmpty(_orderParam.CustNo))
            {
                throw new PaymentProcessBizException(-409, "회원 구분을 알 수 없습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
            }

            // custNo로 비회원 여부 확인
            if (this._orderParam.CustNo.Equals("100543129", StringComparison.InvariantCultureIgnoreCase))
            {
                this._orderParam.MemberWay = "NON";
            }

            PaymentCustomInfoT paymentCustomInfo = new PaymentBiz().GetPaymentCustomInfo(_orderParam.CustNo);

            if (!paymentCustomInfo.LoginID.Equals(_orderParam.LoginID, StringComparison.InvariantCultureIgnoreCase))
            {
                throw new PaymentProcessBizException(-420, "회원 정보가 올바르지 않습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
            }

            if (string.IsNullOrEmpty(_orderParam.OrderWayKind) || _orderParam.OrderWayKind.Length < 2)
            {
                throw new PaymentProcessBizException(-3, "주문유형을 알 수 없습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
            }

            #region 결제 수단

            if (_orderParam.AcntType.Equals("A3", StringComparison.InvariantCultureIgnoreCase)
                && _orderParam.CardCash.Equals("CASH", StringComparison.InvariantCultureIgnoreCase)
                && (string.IsNullOrEmpty(_orderParam.Vaccount) || _orderParam.Vaccount.Length < 3)
                && !_orderParam.OnCreditYN.Equals("N", StringComparison.InvariantCultureIgnoreCase)
                && !_orderParam.OnCreditYN.Equals("M", StringComparison.InvariantCultureIgnoreCase))
            {
                throw new PaymentProcessBizException(-344, "계좌정보를 찾을 수 없습니다. 주문은 접수되지 않았습니다.");
            }

            if ((!_orderParam.AcntType.Equals("I1", StringComparison.InvariantCultureIgnoreCase) && _orderParam.CardCash.Equals("GBANK_PAYPAL", StringComparison.InvariantCultureIgnoreCase))
                || (_orderParam.AcntType.Equals("I1", StringComparison.InvariantCultureIgnoreCase) && !_orderParam.CardCash.Equals("GBANK_PAYPAL", StringComparison.InvariantCultureIgnoreCase)))
            {
                throw new PaymentProcessBizException(-341, "PAYPAL EXPRESS CHECKOUT 정보가 누락되었습니다. 주문은 접수되지 않았습니다.");
            }

            if (_orderParam.AcntType.Equals("I1", StringComparison.InvariantCultureIgnoreCase)
                && _orderParam.CardCash.Equals("GBANK_PAYPAL", StringComparison.InvariantCultureIgnoreCase)
                && (string.IsNullOrEmpty(_orderParam.PaypalToken) || _orderParam.PaypalToken.Length < 3)
                && _orderParam.PaypalNo <= 0)
            {
                throw new PaymentProcessBizException(-342, "PAYPAL EXPRESS CHECKOUT 정보가 누락되었습니다. 주문은 접수되지 않았습니다.");
            }

            if (_orderParam.AcntType.Equals("I2", StringComparison.InvariantCultureIgnoreCase)
                && _orderParam.CardCash.Equals("FOREIGN_CARD", StringComparison.InvariantCultureIgnoreCase)
                && _orderParam.BibitNo <= 0)
            {
                throw new PaymentProcessBizException(-354, "해외카드 결제 정보가 누락되었습니다. 결제가 이루어지지 않았으니, 확인후 다시 주문해 주시기 바랍니다.");
            }

            if (_orderParam.AcntType.Equals("I1", StringComparison.InvariantCultureIgnoreCase)
                && string.IsNullOrEmpty(_orderParam.SettleLimitKey))
            {
                throw new PaymentProcessBizException(-364, "PAYPAL EXPRESS CHECKOUT 정보가 누락되었습니다. 주문은 접수되지 않았습니다.");
            }

            if (_orderParam.AcntType.Equals("I2", StringComparison.InvariantCultureIgnoreCase)
                && string.IsNullOrEmpty(_orderParam.SettleLimitKey))
            {
                throw new PaymentProcessBizException(-365, "해외카드 결제 정보가 누락되었습니다. 결제가 이루어지지 않았으니, 확인후 다시 주문해 주시기 바랍니다.");
            }

            #endregion

            #region 배송 정보

            if (string.IsNullOrEmpty(_orderParam.ReceiverZipCode.Trim()) || string.IsNullOrEmpty(_orderParam.ReceiverAddr1.Trim())
                || string.IsNullOrEmpty(_orderParam.ReceiverAddr2.Trim()) || string.IsNullOrEmpty(_orderParam.ReceiverName.Trim())
                || string.IsNullOrEmpty(_orderParam.ReceiverPhoneNo.Trim())
                || _orderParam.ReceiverZipCode.Equals("N/A", StringComparison.InvariantCultureIgnoreCase)
                || _orderParam.ReceiverAddr1.Equals("N/A", StringComparison.InvariantCultureIgnoreCase)
                || _orderParam.ReceiverAddr2.Equals("N/A", StringComparison.InvariantCultureIgnoreCase)
                || _orderParam.ReceiverName.Equals("N/A", StringComparison.InvariantCultureIgnoreCase)
                || _orderParam.ReceiverPhoneNo.Equals("N/A", StringComparison.InvariantCultureIgnoreCase))
            {
                throw new PaymentProcessBizException(-202, "배송지 정보에 문제가 있습니다. 다시 주문해 주세요. 주문은 접수되지 않았습니다.");
            }

            #endregion
        }