public ActionResult BaseOutPutRate(BaseOutPutRateModels model) { string PublicMsg = ""; string error_str = ""; //목록 버튼 클릭 if (model.act_type == "list") { BaseOutPutTypeModels returlModel = new BaseOutPutTypeModels(); returlModel.schType = model.schType; return(RedirectToAction("BaseOutPutType", returlModel)); } if (model.act_type == "excel") { act.setBaseOutPutRate(model, out error_str); if (error_str != "") { ViewBag.PublicMsg = error_str; } model = act.GetBaseOutPutRateView(model); return(View(model)); } //시퀸스 넘버 오류 일경우 return(RedirectToAction("BaseOutPutType", new { Msg = "잘못된 경로입니다." })); }
//요율표 저장 public string setBaseOutPutRate(BaseOutPutRateModels model, out string error_str) { error_str = ""; GlobalFunction comModel = new GlobalFunction(); DataTable data = comModel.getUploadExcelData(model.File.FILE, out error_str); if (error_str != "") { return(error_str); } //유효성 검사 double test = 0; if (data != null && data.Rows.Count != 0) { for (int i = 0; i < data.Rows.Count; i++) { try { test = Convert.ToDouble(data.Rows[i][0].ToString().Trim()); test = Convert.ToDouble(data.Rows[i][1].ToString().Trim()); } catch { error_str = "[" + i + "] 행에 문제가 있습니다."; return(error_str); } } } List <string> exeQueryList = new List <string>(); List <string> linqList = new List <string>(); string exeQueryStr = " INSERT INTO conf_customs_fee (EST_CODE, NATION_CODE, RELEASE_CODE, WEIGHT, CUSTOMS_FEE ) VALUES "; if (data != null && data.Rows.Count != 0) { for (int i = 0; i < data.Rows.Count; i++) { linqList.Add("( '00000', '" + model.Item.NATION_CODE + "', '" + model.Item.RELEASE_CODE + "', " + data.Rows[i][0].ToString().Trim() + " , " + data.Rows[i][1].ToString().Trim() + " )"); } } exeQueryStr += string.Join(",", linqList); exeQueryList.Add("DELETE FROM conf_customs_fee WHERE EST_CODE = '00000' AND NATION_CODE = '" + model.Item.NATION_CODE + "' AND RELEASE_CODE = '" + model.Item.RELEASE_CODE + "'"); exeQueryList.Add(exeQueryStr); exeQuery(exeQueryList, out error_str); return(error_str); }
public ActionResult BaseOutPutRate(string seqNo, string schType) { BaseOutPutRateModels model = new BaseOutPutRateModels(); model.schType = schType; model.act_type = "list"; int pSeqNo = 0; if (int.TryParse(seqNo, out pSeqNo)) { model.act_key = pSeqNo; model = act.GetBaseOutPutRateView(model); return(View(model)); } //시퀸스 넘버 오류 일경우 return(RedirectToAction("BaseOutPutType", new { Msg = "잘못된 경로입니다." })); }
public BaseOutPutRateModels GetBaseOutPutRateView(BaseOutPutRateModels model) { string errorStr = ""; string listQuery = " SELECT SEQNO , " + string.Join(",", column_BaseOutPutType) + " FROM conf_release_type WHERE SEQNO = " + model.act_key; DataTable listDt = getQueryResult(listQuery, out errorStr); if (listDt != null && listDt.Rows.Count != 0) { model.Item.SEQNO = int.Parse(listDt.Rows[0]["SEQNO"].ToString().Trim()); model.Item.NATION_CODE = listDt.Rows[0]["NATION_CODE"].ToString().Trim(); model.Item.RELEASE_NAME = listDt.Rows[0]["RELEASE_NAME"].ToString().Trim(); model.Item.RELEASE_CODE = listDt.Rows[0]["RELEASE_CODE"].ToString().Trim(); model.Item.MEMO = listDt.Rows[0]["MEMO"].ToString().Trim(); model.Item.DELV_CODE = listDt.Rows[0]["DELV_CODE"].ToString().Trim(); } listQuery = " SELECT WEIGHT , CUSTOMS_FEE FROM conf_customs_fee WHERE EST_CODE = '00000' AND NATION_CODE = '" + model.Item.NATION_CODE + "' AND RELEASE_CODE = '" + model.Item.RELEASE_CODE + "' order by WEIGHT "; listDt = getQueryResult(listQuery, out errorStr); if (listDt != null && listDt.Rows.Count != 0) { for (int i = 0; i < listDt.Rows.Count; i++) { ConfCustomsFee temp = new ConfCustomsFee(); if (listDt.Rows[i]["WEIGHT"].ToString().Trim() != "") { temp.WEIGHT = Convert.ToDouble(listDt.Rows[i]["WEIGHT"].ToString().Trim()); } if (listDt.Rows[i]["CUSTOMS_FEE"].ToString().Trim() != "") { temp.CUSTOMS_FEE = Convert.ToDouble(listDt.Rows[i]["CUSTOMS_FEE"].ToString().Trim()); } model.Items.Add(temp); } } return(model); }