// MAR 환불 신청 =================================================================== // GET: Mar MAR 환불 신청 public ActionResult MarOutReq() { //권한 체크=================================================== if (!chk.chkPermission("MarOutReq", "PER_SELECT")) { return(RedirectToAction("Index", "Home", new { msg = chk.alertStr })); } //=========================================================== MarOutReqModels model = new MarOutReqModels(); model = act.GetMarOutReqBase(model); //계좌정보 입력값 확인 if (model.CHK_DATA == false) { string PublicPopupMsg = "환불 계좌정보가 없습니다."; return(View(model)); //return RedirectToAction("MarOutReq","Mar", new { msg = PublicPopupMsg }); } return(View(model)); }
public ActionResult MarOutReq(MarOutReqModels model) { //권한 체크=================================================== if (!chk.chkPermission("MarOutReq", "PER_UPDATE")) { return(RedirectToAction("Index", "Home", new { msg = chk.alertStr })); } //=========================================================== string PublicPopupMsg = act.SetMarOutReq(model); return(RedirectToAction("MarInOut", new { msg = PublicPopupMsg, type = 2 })); }
// MAR 환불 신청 ======================================================== public MarOutReqModels GetMarOutReqBase(MarOutReqModels model) { HttpContext context = HttpContext.Current; string eseCode = context.Session["ESE_CODE"].ToString(); string estCode = context.Session["EST_CODE"].ToString(); model.MY_MAR = 0.0; string errorStr = ""; string listQuery = " SELECT SEQNO , MAR FROM est_sender WHERE ESE_CODE = '" + eseCode + "' AND EST_CODE = '" + estCode + "'"; DataTable listDt = getQueryResult(listQuery, out errorStr); if (listDt != null && listDt.Rows.Count != 0) { model.Item.SEQNO = int.Parse(listDt.Rows[0]["SEQNO"].ToString().Trim()); if (!string.IsNullOrEmpty(listDt.Rows[0]["MAR"].ToString().Trim())) { model.Item.Mar = double.Parse(listDt.Rows[0]["MAR"].ToString().Trim()); } } model.MY_MAR = model.Item.Mar; listQuery = " SELECT st.SET_KEY, st.SET_VALUE "; listQuery += " FROM est_sender es left outer join ese_settings st on es.ESE_CODE = st.ESE_CODE WHERE es.ESE_CODE = '" + eseCode + "' "; listDt = getQueryResult(listQuery, out errorStr); model.CHK_DATA = true; if (listDt != null && listDt.Rows.Count != 0) { EseSettings temp = new EseSettings(); for (int i = 0; i < listDt.Rows.Count; i++) { temp.SET_KEY = listDt.Rows[i]["SET_KEY"].ToString().Trim(); if (string.IsNullOrEmpty(listDt.Rows[i]["SET_VALUE"].ToString().Trim()) && temp.SET_KEY != "setting_Memo") { model.CHK_DATA = false; return(model); } } } return(model); }
public string SetMarOutReq(MarOutReqModels model) { string resultStr = ""; HttpContext context = HttpContext.Current; string eseCode = context.Session["ESE_CODE"].ToString(); string estCode = context.Session["EST_CODE"].ToString(); //환불 계좌정보 가져오기============================= string errorStr = ""; string BaseQuery = ""; BaseQuery = " SELECT SET_KEY , SET_VALUE "; BaseQuery += " FROM ese_settings WHERE ESE_CODE = '" + eseCode + "' AND SET_KEY in ('setting_SwiftCode' , 'setting_BankAddr' , 'setting_AccountNum' , 'setting_ReceiverName_en' )"; string exeQueryStr = ""; DataTable listDt = getQueryResult(BaseQuery, out errorStr); string setting_SwiftCode = ""; string setting_BankAddr = ""; string tmp_key = ""; string tmp_value = ""; if (listDt != null && listDt.Rows.Count != 0) { for (int i = 0; i < listDt.Rows.Count; i++) { tmp_key = listDt.Rows[i]["SET_KEY"].ToString().Trim(); tmp_value = listDt.Rows[i]["SET_VALUE"].ToString().Trim(); switch (tmp_key) { case "setting_SwiftCode": setting_SwiftCode = tmp_value; break; case "setting_BankAddr": setting_BankAddr = tmp_value; break; case "setting_AccountNum": model.Item.BANK_ACCOUNT = tmp_value; break; case "setting_ReceiverName_en": model.Item.HOLDER_NAME = tmp_value; break; } } } //입력 받은 값 세팅 model.Item.REQ_AMOUNT = model.REQ_AMOUNT; //소수점 둘째 자리 까지만 허용 model.Item.MEMO = model.REQ_MEMO; // 환불 요청 메모 model.Item.BANK_NAME = setting_SwiftCode + "|" + setting_BankAddr; model.Item.STATUS = 10; exeQueryStr = " INSERT INTO mar_withdraw_req ( ESE_CODE, EST_CODE, REQ_AMOUNT , MEMO, BANK_NAME, BANK_ACCOUNT , HOLDER_NAME, STATUS )VALUES( "; exeQueryStr += " '" + eseCode + "' "; exeQueryStr += ", '" + estCode + "' "; exeQueryStr += ", " + model.Item.REQ_AMOUNT + ""; exeQueryStr += ", '" + model.Item.MEMO + "' "; exeQueryStr += ", '" + model.Item.BANK_NAME + "' "; exeQueryStr += ", '" + model.Item.BANK_ACCOUNT + "' "; exeQueryStr += ", '" + model.Item.HOLDER_NAME + "' "; exeQueryStr += ", " + model.Item.STATUS + ""; exeQueryStr += " ) "; if (exeQuery(exeQueryStr, out errorStr)) { resultStr = "성공."; } else { resultStr = "실패."; } return(resultStr); }