private void GetDataFromDataSource() { oMatrix.Clear(); oMatrix.AutoResizeColumns(); oDBDataSource.Query(null); oUserDataSource.Value = "Telefone com prefixo"; oMatrix.LoadFromDataSource(); }
}//fin FormEvent private void Distribuir() { Int64 iFolio; Int64 iDesde; Int64 iHasta; Int32 i; SAPbouiCOM.EditText oEditText; try { oMtx.Clear(); oMtx.FlushToDataSource(); oEditText = (EditText)(oForm.Items.Item("Desde").Specific); iDesde = Convert.ToInt64((System.String)(oEditText.Value), _nf); oEditText = (EditText)(oForm.Items.Item("Hasta").Specific); iHasta = Convert.ToInt64((System.String)(oEditText.Value), _nf); if (iDesde <= 0) { FSBOApp.StatusBar.SetText("Debe ingresar Folio desde", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } else if (iHasta <= 0) { FSBOApp.StatusBar.SetText("Debe ingresar Folio hasta", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } else if (iDesde >= iHasta) { FSBOApp.StatusBar.SetText("Ingrese rango Folio correcto", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } else { i = 0; for (iFolio = iDesde; iFolio <= iHasta; iFolio++) { oDBDSD.InsertRecord(i); oDBDSD.SetValue("U_Folio", i, Convert.ToString(iFolio)); oDBDSD.SetValue("U_Estado", i, "D"); i++; } if (Convert.ToDouble((System.String)(oDBDSD.GetValue("U_Folio", i)), _nf) == 0) { oDBDSD.RemoveRecord(i); } oMtx.LoadFromDataSource(); oColumn = oMtx.Columns.Item("Folio"); oColumn.TitleObject.Sortable = true; oColumn.TitleObject.Sort(SAPbouiCOM.BoGridSortType.gst_Ascending); } } catch (Exception e) { FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); OutLog("Distribuir: " + e.Message + " ** Trace: " + e.StackTrace); } }//fin Distribuir
private void SetSystemDataTable(SAPbouiCOM.Form oForm) { try { oDB1_O = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00301_HRD"); oDB2_O = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00302_HRD"); oDB1_Z = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00301Z_HRD"); oDB1_Z.Clear(); //if (gDs.Tables[oForm.UniqueID + "_Deliver"] != null) // gDs.Tables[oForm.UniqueID + "_Deliver"].Clear(); //else // gDs.Tables[oForm.UniqueID + "_Deliver"] = SetParameterDataTableSchema(oForm.UniqueID+"Deliver"); if (gDs.Tables.Contains(oForm.UniqueID + "_Deliver")) { gDs.Tables[oForm.UniqueID + "_Deliver"].Rows.Clear(); } else { System.Data.DataTable dt = SetParameterDataTableSchema(oForm.UniqueID + "_Deliver"); gDs.Tables.Add(dt); } if (oDB1_O.Size > 0 && oDB1_O.GetValue("U_DELVCD", 0).ToString().Trim() != "") { for (int i = 0; i < oDB1_O.Size; i++) { System.Data.DataRow dr; // 데이터 필터를 위해 DataTable에 담는다. dr = gDs.Tables[oForm.UniqueID + "_Deliver"].NewRow(); dr["IDX"] = i; // "DataTable 고유ID" dr["LINEID"] = oDB1_O.GetValue("LineId", i);//"원본라인번호"; dr["DELVCD"] = oDB1_O.GetValue("U_DELVCD", i).Trim(); //"배달코드"; dr["RDEPT"] = oDB1_O.GetValue("U_RDEPT", i).Trim(); //"부서"; dr["PAPERTP"] = oDB1_O.GetValue("U_PAPERTP", i).Trim(); //"지종"; dr["PAYCD"] = oDB1_O.GetValue("U_PAYCD", i).Trim(); //"요금제코드"; dr["PAYNM"] = oDB1_O.GetValue("U_PAYNM", i).Trim(); //"요금제명"; dr["TEL"] = oDB1_O.GetValue("U_TEL", i).Trim(); //"연락처"; dr["MOBILE"] = oDB1_O.GetValue("U_MOBILE", i).Trim(); //"휴대폰"; dr["ADDR1"] = oDB1_O.GetValue("U_ADDR1", i).Trim(); //"주소1"; dr["ADDR2"] = oDB1_O.GetValue("U_ADDR2", i).Trim(); //"주소2"; dr["ADDR1_D"] = oDB1_O.GetValue("U_ADDR1_D", i).Trim(); //"주소1상세"; dr["ADDR2_D"] = oDB1_O.GetValue("U_ADDR2_D", i).Trim(); //"주소2상세"; dr["CENTCD"] = oDB1_O.GetValue("U_CENTCD", i).Trim(); //"지국"; dr["CENTNM"] = oDB1_O.GetValue("U_CENTNM", i).Trim(); //"지국명"; dr["DELVFR"] = oDB1_O.GetValue("U_DELVFR", i).Trim(); //"배달시작일"; dr["DELVTO"] = oDB1_O.GetValue("U_DELVTO", i).Trim(); //"배달종료일"; dr["DELVCNT"] = oDB1_O.GetValue("U_DELVCNT", i).Trim(); //"배달부수"; dr["METHOD"] = oDB1_O.GetValue("U_METHOD", i).Trim(); //"가입방법"; dr["SAILCD"] = oDB1_O.GetValue("U_SAILCD", i).Trim(); //"유치자"; dr["SAILNM"] = oDB1_O.GetValue("U_SAILNM", i).Trim(); //"유치자"; dr["STATUS"] = oDB1_O.GetValue("U_STATUS", i).Trim(); //"배달상태"; dr["SDEPT"] = oDB1_O.GetValue("U_SDEPT", i).Trim(); //"유치부서"; dr["NOTE"] = oDB1_O.GetValue("U_NOTE", i).Trim(); //"배달상세"; dr["JOINDT"] = oDB1_O.GetValue("U_JOINDT", i).Trim(); //"가입일자"; dr["CLOSEDT"] = oDB1_O.GetValue("U_CLOSEDT", i).Trim(); //"해지일자"; dr["USERSG1"] = oDB1_O.GetValue("U_USERSG1", i).Trim(); //"등록자"; dr["READTP"] = oDB1_O.GetValue("U_READTP", i).Trim(); //"독자구분"; dr["BTEL1"] = oDB1_O.GetValue("U_BTEL1", i).Trim(); //"분국전화1"; dr["BTEL2"] = oDB1_O.GetValue("U_BTEL2", i).Trim(); //"분국전화1"; dr["ROWSTATE"] = ""; // 기본: "", 수정: M, 신규: I, 삭제: D gDs.Tables[oForm.UniqueID + "_Deliver"].Rows.Add(dr); oDB1_Z.InsertRecord(i); oDB1_Z.SetValue("U_NO", i, (i + 1).ToString());//"번호"; oDB1_Z.SetValue("U_IDX", i, (i).ToString());//"DataTable 고유ID"; oDB1_Z.SetValue("LineId", i, oDB1_O.GetValue("LineId", i));//"원본라인번호"; oDB1_Z.SetValue("U_DELVCD", i, oDB1_O.GetValue("U_DELVCD", i).Trim()); //"배달코드"; oDB1_Z.SetValue("U_RDEPT", i, oDB1_O.GetValue("U_RDEPT", i).Trim()); //"부서"; oDB1_Z.SetValue("U_PAPERTP", i, oDB1_O.GetValue("U_PAPERTP", i).Trim()); //"지종"; oDB1_Z.SetValue("U_PAYCD", i, oDB1_O.GetValue("U_PAYCD", i).Trim()); //"요금제코드"; oDB1_Z.SetValue("U_PAYNM", i, oDB1_O.GetValue("U_PAYNM", i).Trim()); //"요금제명"; oDB1_Z.SetValue("U_TEL", i, oDB1_O.GetValue("U_TEL", i).Trim()); //"연락처"; oDB1_Z.SetValue("U_MOBILE", i, oDB1_O.GetValue("U_MOBILE", i).Trim()); //"휴대폰"; oDB1_Z.SetValue("U_ADDR1", i, oDB1_O.GetValue("U_ADDR1", i).Trim()); //"주소1"; oDB1_Z.SetValue("U_ADDR2", i, oDB1_O.GetValue("U_ADDR2", i).Trim()); //"주소2"; oDB1_Z.SetValue("U_ADDR1_D", i, oDB1_O.GetValue("U_ADDR1_D", i).Trim()); //"주소1"; oDB1_Z.SetValue("U_ADDR2_D", i, oDB1_O.GetValue("U_ADDR2_D", i).Trim()); //"주소2"; oDB1_Z.SetValue("U_CENTCD", i, oDB1_O.GetValue("U_CENTCD", i).Trim()); //"지국"; oDB1_Z.SetValue("U_CENTNM", i, oDB1_O.GetValue("U_CENTNM", i).Trim()); //"지국명"; oDB1_Z.SetValue("U_DELVFR", i, oDB1_O.GetValue("U_DELVFR", i).Trim()); //"배달시작일"; oDB1_Z.SetValue("U_DELVTO", i, oDB1_O.GetValue("U_DELVTO", i).Trim()); //"배달종료일"; oDB1_Z.SetValue("U_DELVCNT", i, oDB1_O.GetValue("U_DELVCNT", i).Trim()); //"배달부수"; oDB1_Z.SetValue("U_METHOD", i, oDB1_O.GetValue("U_METHOD", i).Trim()); //"가입방법"; oDB1_Z.SetValue("U_SAILCD", i, oDB1_O.GetValue("U_SAILCD", i).Trim()); //"유치자"; oDB1_Z.SetValue("U_SAILNM", i, oDB1_O.GetValue("U_SAILNM", i).Trim()); //"유치자"; oDB1_Z.SetValue("U_STATUS", i, oDB1_O.GetValue("U_STATUS", i).Trim()); //"배달상태"; oDB1_Z.SetValue("U_SDEPT", i, oDB1_O.GetValue("U_SDEPT", i).Trim()); //"유치부서"; oDB1_Z.SetValue("U_NOTE", i, oDB1_O.GetValue("U_NOTE", i).Trim()); //"배달상세"; oDB1_Z.SetValue("U_JOINDT", i, oDB1_O.GetValue("U_JOINDT", i).Trim()); //"가입일자"; oDB1_Z.SetValue("U_CLOSEDT", i, oDB1_O.GetValue("U_CLOSEDT", i).Trim()); //"해지일자"; oDB1_Z.SetValue("U_USERSG1", i, oDB1_O.GetValue("U_USERSG1", i).Trim()); //"등록자"; oDB1_Z.SetValue("U_READTP", i, oDB1_O.GetValue("U_READTP", i).Trim()); //"등록자"; oDB1_Z.SetValue("U_BTEL1", i, oDB1_O.GetValue("U_BTEL1", i).Trim()); //"분국전화1"; oDB1_Z.SetValue("U_BTEL2", i, oDB1_O.GetValue("U_BTEL2", i).Trim()); //"분국전화2"; } } //if (gDs.Tables[oForm.UniqueID + "_Call"] != null) // gDs.Tables[oForm.UniqueID + "_Call"].Clear(); //else // gDs.Tables[oForm.UniqueID + "_Call"] = SetParameterDataTableSchema(oForm.UniqueID+"Call"); if (gDs.Tables.Contains(oForm.UniqueID + "_Call")) { gDs.Tables[oForm.UniqueID + "_Call"].Rows.Clear(); } else { System.Data.DataTable dt = SetParameterDataTableSchema(oForm.UniqueID + "_Call"); gDs.Tables.Add(dt); } if (oDB2_O.Size > 0 && oDB2_O.GetValue("U_DELVCD", 0).ToString().Trim() != "") { for (int i = 0; i < oDB2_O.Size; i++) { System.Data.DataRow dr; // 데이터 필터를 위해 DataTable에 담는다. dr = gDs.Tables[oForm.UniqueID + "_Call"].NewRow(); dr["IDX"] = i; //"DataTable 고유ID"; dr["LINEID"] = oDB2_O.GetValue("LineId", i);//"원본라인번호"; dr["DELVCD"] = oDB2_O.GetValue("U_DELVCD", i).Trim(); //"배달코드" dr["CALLTP"] = oDB2_O.GetValue("U_CALLTP", i).Trim(); //"콜유형" dr["MEMO"] = oDB2_O.GetValue("U_MEMO", i).Trim(); //"접수내용" dr["RECVID"] = oDB2_O.GetValue("U_RECVID", i).Trim(); //"접수자ID" dr["RECVNM"] = oDB2_O.GetValue("U_RECVNM", i).Trim(); //"접수자명" dr["RECVDT"] = oDB2_O.GetValue("U_RECVDT", i).Trim(); //"접수일자" dr["RECVTI"] = oDB2_O.GetValue("U_RECVTI", i).Trim(); //"접수시간" dr["RECVTI"] = oDB2_O.GetValue("U_RECVTI", i).Trim(); //"접수시간" dr["PROCID"] = oDB2_O.GetValue("U_PROCID", i).Trim(); //"처리자ID" dr["PROCNM"] = oDB2_O.GetValue("U_PROCNM", i).Trim(); //"처리자명" dr["PROCDT"] = oDB2_O.GetValue("U_PROCDT", i).Trim(); //"처리일자" dr["PROSTAT"] = oDB2_O.GetValue("U_PROSTAT", i).Trim(); //"처리상태" dr["ROWSTATE"] = ""; // 기본: "", 수정: M, 신규: I, 삭제: D gDs.Tables[oForm.UniqueID + "_Call"].Rows.Add(dr); } } //else //{ // gDs.Tables[oForm.UniqueID + "_Call"].Rows.Clear(); //} oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific; oMatrix.LoadFromDataSource(); oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_DUMY").Specific; oMatrix.Clear(); //oMatrix.LoadFromDataSource(); // 데이터 로드하면 메트릭스 선택된행 값 초기화 함.(중요) gDeliverySelect = -1; } catch (Exception) { throw; } }
private void DBDataSourcesBindingData(SAPbouiCOM.Form oForm, System.Data.DataTable dt, int sIndex) { try { System.Collections.Hashtable hashTable = new System.Collections.Hashtable(); SetHashTable_Seq(ref hashTable, dt); oMatrix = oForm.Items.Item("mtx").Specific; oForm.Freeze(true); oMatrix.Clear(); string U_RDCD = string.Empty; string U_DELVCD = string.Empty; int seq; for (int i = sIndex; i < dt.Rows.Count; i++) { oMatrix.AddRow(); U_RDCD = dt.Rows[i]["U_RDCD"].ToString(); seq = GetHashTable_NextSeq(ref hashTable, U_RDCD); U_DELVCD = U_RDCD + "_" + seq.ToString().PadLeft(4, '0'); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_RDCD", U_RDCD); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_RDNM", dt.Rows[i]["U_RDNM"].ToString()); //oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_DELVCD", dt.Rows[i]["U_DELVCD"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_DELVCD", U_DELVCD); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_RDEPT", dt.Rows[i]["U_RDEPT"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_PAPERTP", dt.Rows[i]["U_PAPERTP"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_TYPE", dt.Rows[i]["U_TYPE"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_PAYCD", dt.Rows[i]["U_PAYCD"].ToString()); //oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_PAYNM", dt.Rows[i][6].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_TEL", dt.Rows[i]["U_TEL"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ADDR1", dt.Rows[i]["U_ADDR1"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ADDR1_D", dt.Rows[i]["U_ADDR1_D"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ADDR2", dt.Rows[i]["U_ADDR2"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ADDR2_D", dt.Rows[i]["U_ADDR2_D"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_CENTCD", dt.Rows[i]["U_CENTCD"].ToString()); //oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_CENTNM", dt.Rows[i][11].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_DELVFR", dt.Rows[i]["U_DELVFR"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_DELVCNT", dt.Rows[i]["U_DELVCNT"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_METHOD", dt.Rows[i]["U_METHOD"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_SDEPT", dt.Rows[i]["U_SDEPT"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_SAILCD", dt.Rows[i]["U_SAILCD"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_SAILNM", dt.Rows[i]["U_SAILNM"].ToString()); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_STATUS", "UO"); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_NOTE", ""); } oMatrix.FlushToDataSource(); } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); //throw; } finally { oForm.Freeze(false); } }
public static void clsSupplierPurchaseHistory_ItemEvent(ref SAPbouiCOM.Application oApplication, ref SAPbobsCOM.Company oCompany, SAPbouiCOM.Form oSetupForm, ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent) { if (oForm != null) { oForm = oSetupForm; SAPbouiCOM.Grid oGrid; oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("4").Specific; oMatrix = (SAPbouiCOM.Matrix)oSOForm.Items.Item("38").Specific; if (pVal.BeforeAction) { switch (pVal.EventType) { //case BoEventTypes.et_FORM_CLOSE: // BubbleEvent = false; // oForm.Visible = false; // break; case BoEventTypes.et_DOUBLE_CLICK: if (pVal.ItemUID == "4") { string strSelCol = ""; strSelCol = oGrid.Columns.Item(pVal.ColUID).TitleObject.Caption.ToString(); string[] words = strSelCol.Split('-'); string[] words1; if (words.Length == 2) { oForm.Freeze(true); for (int i = 0; i < oGrid.Rows.Count; i++) { if (oGrid.DataTable.GetValue(strSelCol, i).ToString().Trim() != "") { if (oGrid.DataTable.GetValue(strSelCol, i).ToString().Trim() != "0") { words1 = oGrid.DataTable.GetValue(strSelCol, i).ToString().Trim().Split(' '); if (words1[0].Trim() != "") { oGrid.DataTable.SetValue("Order Qty", i, words1[0].Trim()); } } } } oForm.Freeze(false); } } break; case BoEventTypes.et_ITEM_PRESSED: if (pVal.ItemUID == "2") { BubbleEvent = false; oForm.Visible = false; } if (pVal.ItemUID == "3") { flushAll(); BubbleEvent = false; oForm.Visible = false; return; oMatrix.Clear(); int j = oMatrix.RowCount; if (j == 0) { oMatrix.AddRow(1, -1); } j = oMatrix.RowCount; for (int i = 0; i < oGrid.Rows.Count; i++) { if (oGrid.DataTable.GetValue("Order Qty", i).ToString().Trim() != "") { if (oGrid.DataTable.GetValue("Order Qty", i).ToString().Trim() != "0") { string strItemCode = oGrid.DataTable.GetValue("ItemCode", i).ToString().Trim(); string strQty = oGrid.DataTable.GetValue("Order Qty", i).ToString().Trim(); string strPrice = oGrid.DataTable.GetValue("Current Purchase Price", i).ToString().Trim(); string strUoM = oGrid.DataTable.GetValue("UoM", i).ToString().Trim(); try { ((SAPbouiCOM.EditText)oMatrix.Columns.Item("1").Cells.Item(j).Specific).Value = strItemCode; ((SAPbouiCOM.EditText)oMatrix.Columns.Item("11").Cells.Item(j).Specific).Value = strQty; try { ((SAPbouiCOM.EditText)oMatrix.Columns.Item("1470002145").Cells.Item(j).Specific).Value = strUoM; } catch (Exception) { } try { ((SAPbouiCOM.EditText)oMatrix.Columns.Item("14").Cells.Item(j).Specific).Value = strPrice; } catch (Exception) { } j++; } catch (Exception) { j++; } } } } //oForm.Close(); oForm.Visible = false; } break; case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST: if (pVal.ItemUID == "4") { if (pVal.ColUID == "UoM") { if (oGrid.DataTable.GetValue("ItemCode", pVal.Row).ToString().Trim() != "") { string squery = "Select T2.\"UomCode\",T2.\"UomName\" From OITM T0 Inner Join UGP1 T1 On T0.\"UgpEntry\" = T1.\"UgpEntry\" Inner Join OUOM T2 On T1.\"UomEntry\" = T2.\"UomEntry\" Where T0.\"ItemCode\" = '" + oGrid.DataTable.GetValue("ItemCode", pVal.Row).ToString().Trim() + "'"; Utilities.UtilitiesCls.CFLConditionQuery(ref oApplication, ref oCompany, oForm, ref pVal, squery, "UomCode", "10010198", "UomCode", false, true, "4", "UoM", false); } } if (pVal.ColUID == "ItemCode") { SAPbouiCOM.ChooseFromListCollection oCFLs = null; SAPbouiCOM.Conditions oCons = null; SAPbouiCOM.Condition oCon = null; oCFLs = oForm.ChooseFromLists; SAPbouiCOM.ChooseFromList oCFL = null; oCFL = oCFLs.Item("CFL_2"); oCons = new Conditions(); oCFL.SetConditions(oCons); oCons = oCFL.GetConditions(); oCon = oCons.Add(); oCon.Alias = "PrchseItem"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "frozenFor"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_NOT_EQUAL; oCon.CondVal = "Y"; int intCnt = 2; for (int i = 0; i < oGrid.Rows.Count; i++) { if (oGrid.DataTable.GetValue("ItemCode", i).ToString().Trim() != "") { if (intCnt > 0) { oCon.Relationship = BoConditionRelationship.cr_AND; } oCon = oCons.Add(); oCon.Alias = "ItemCode"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_NOT_EQUAL; oCon.CondVal = oGrid.DataTable.GetValue("ItemCode", i).ToString().Trim(); intCnt += 1; } } oCFL.SetConditions(oCons); } } break; default: break; } } else if (pVal.BeforeAction == false) { switch (pVal.EventType) { case BoEventTypes.et_ITEM_PRESSED: break; case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST: if (oForm.Mode != SAPbouiCOM.BoFormMode.fm_FIND_MODE) { if (pVal.ItemUID == "4") { if (pVal.ColUID == "ItemCode") { oRecordSet = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(BoObjectTypes.BoRecordset); string strQry = ""; string strItemCode = ""; oDataTable = UtilitiesCls.DataTable(ref oApplication, ref oCompany, oForm, ref pVal); if (oDataTable != null) { strItemCode = oDataTable.GetValue("ItemCode", 0).ToString(); } if (strItemCode != "") { strQry = " Exec EJ_LoadBPItemDetails '" + ((SAPbouiCOM.EditText)oForm.Items.Item("6").Specific).Value.Trim() + "', '" + strItemCode + "'"; oRecordSet.DoQuery(strQry); if (!oRecordSet.EoF) { oGrid.DataTable.SetValue("ItemCode", pVal.Row, strItemCode); oGrid.DataTable.SetValue("ItemName", pVal.Row, oRecordSet.Fields.Item("ItemName").Value.ToString()); oGrid.DataTable.SetValue("Order Qty", pVal.Row, ""); oGrid.DataTable.SetValue("UoM", pVal.Row, oRecordSet.Fields.Item("UoM").Value.ToString()); oGrid.DataTable.SetValue("Current Purchase Price", pVal.Row, oRecordSet.Fields.Item("Current Price").Value.ToString()); } } oGrid.DataTable.SetValue("ItemCode", pVal.Row, strItemCode); int j = oGrid.Rows.Count; if (j == oGrid.Rows.Count) { oGrid.DataTable.Rows.Add(); } } if (pVal.ColUID == "UoM") { oRecordSet = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(BoObjectTypes.BoRecordset); string strUoMCode = ""; oDataTable = UtilitiesCls.DataTable(ref oApplication, ref oCompany, oForm, ref pVal); if (oDataTable != null) { strUoMCode = oDataTable.GetValue("UomCode", 0).ToString(); } oGrid.DataTable.SetValue("UoM", pVal.Row, strUoMCode); string strQry = " Exec EJ_LoadUoMPrice '" + ((SAPbouiCOM.EditText)oForm.Items.Item("6").Specific).Value.Trim() + "','" + oGrid.DataTable.GetValue("ItemCode", pVal.Row).ToString().Trim() + "' ,'" + strUoMCode + "'"; oRecordSet.DoQuery(strQry); if (!oRecordSet.EoF) { oGrid.DataTable.SetValue("Current Purchase Price", pVal.Row, oRecordSet.Fields.Item("Current Price").Value.ToString()); } } } } break; case BoEventTypes.et_COMBO_SELECT: break; case BoEventTypes.et_FORM_CLOSE: oForm = null; break; default: break; } } } }
private void GetCostCenterList() { StringBuilder sb = new StringBuilder(); SAPbobsCOM.Recordset oRS = null; string expression = string.Empty; System.Data.DataRow[] foundRows; int iRow; bool bModify = false; try { oForm.Freeze(true); oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0010M_HRD"); oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00101_HRD"); oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx").Specific; //oMatrix.LoadFromDataSource(); oMatrix.Clear(); FN.SetMatrixIsNullOrEmptDeleteRow(ref oForm, ref oMatrix, "U_PRCCD"); sDataTable = FN.SapDBDataSourceToSystemDataTable(oDB_1); oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); sb.Append(" SELECT Code,Name FROM [@KIS_CO0110M] \r"); if (FN.GetItemValue(ref oForm, "edtCOSTFR") != "" && FN.GetItemValue(ref oForm, "edtCOSTTO") != "") sb.Append(" WHERE Code BETWEEN '" + FN.GetItemValue(ref oForm, "edtCOSTFR") + "' AND '" + FN.GetItemValue(ref oForm, "edtCOSTTO") + "' \r"); B1Connections.theAppl.StatusBar.SetText("불러오기를 시작합니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); oRS.DoQuery(sb.ToString()); iRow = oMatrix.VisualRowCount; if (!oRS.EoF) { for (int i = 0; i < oRS.RecordCount; i++) { expression = "U_PRCCD = '" + oRS.Fields.Item("Code").Value.ToString() + "'"; foundRows = sDataTable.Select(expression); if (foundRows.Length < 1) { if (iRow != 0) oDB_1.InsertRecord(iRow-1); //oDB_1.SetValue("U_LINENUM", iRow, (iRow+1).ToString()); oDB_1.SetValue("U_PRCCD", iRow, oRS.Fields.Item("Code").Value.ToString()); oDB_1.SetValue("U_PRCNM", iRow, oRS.Fields.Item("Name").Value.ToString()); iRow += 1; bModify = true; } oRS.MoveNext(); } if (bModify) { oMatrix.LoadFromDataSource(); if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE; } } B1Connections.theAppl.StatusBar.SetText("불러오기가 완료 되었습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 } catch (Exception ex) { oForm.Freeze(false); B1Connections.theAppl.StatusBar.SetText("GetCostCenterList " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { if (oRS != null) { oForm.Freeze(false); System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS); oRS = null; } } }
private bool GetMonth() { int iRow; bool bModify = false; try { oForm.Freeze(true); oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0020M_HRD"); oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00201_HRD"); oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx").Specific; //oMatrix.LoadFromDataSource(); oMatrix.Clear(); string Year = oForm.Items.Item("Code").Specific.value.Trim(); YYYYCode = Year; int Month = 1; string YYYYMM = ""; iRow = oMatrix.VisualRowCount; for (int i = 0; i < 12; i++) { if (Month.ToString().Length == 1) { YYYYMM = Year + "0" + Month.ToString(); } else { YYYYMM = Year + Month.ToString(); } oDB_1.InsertRecord(iRow); oDB_1.SetValue("U_YYYYMM", iRow, YYYYMM); Month = Month + 1; iRow += 1; bModify = true; if (i == 11) oDB_1.RemoveRecord(iRow); } if (bModify) { oMatrix.LoadFromDataSource(); } //B1Connections.theAppl.StatusBar.SetText("저장이 완료 되었습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 } catch (Exception ex) { oForm.Freeze(false); B1Connections.theAppl.StatusBar.SetText("GetCostCenterList " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); return false; } finally { oForm.Freeze(false); oRS = null; } return true; }
private void SetItemEnabled(SAPbouiCOM.Form oForm) { string strTransID = string.Empty; string strRejTran = string.Empty; string strStatus = string.Empty; string strAcctCd = string.Empty; string strTYPE = string.Empty; try { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0320T_HRD"); strTransID = oDB_M.GetValue("U_JDTDOC", 0).Trim(); strRejTran = oDB_M.GetValue("U_RJDTDOC", 0).Trim(); strTYPE = oDB_M.GetValue("U_TYPE", 0).Trim(); oCheckBox = (SAPbouiCOM.CheckBox)oForm.Items.Item("chkACCTIN").Specific; oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx").Specific; FN.SetAutoManagedAttribute(ref oForm, "edtDOCNUM,cboTYPE,edtCENTCD,edtCENTNM,cboSTATUS,edtDOCDT,cboMETHOD,cboACCTCD,edtBNKACCT,edtBNKBRCH,edtBNKHOLD,edtAMT,edtJDTDOC,edtRJDTDOC,btnTRAN,btnCANCTR,btnPOPUP,chkACCTIN,mtx", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False); FN.SetAutoManagedAttribute(ref oForm, "edtDOCNUM,cboTYPE,edtCENTCD,edtCENTNM,cboSTATUS,edtDOCDT,cboMETHOD,cboACCTCD,edtBNKACCT,edtBNKBRCH,edtBNKHOLD,edtAMT,chkACCTIN", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True); // 분개처리 상태 if (string.IsNullOrEmpty(strTransID) == false && string.IsNullOrEmpty(strRejTran)) { FN.SetAutoManagedAttribute(ref oForm, "btnCANCTR", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True); } // 일반문서상태 else if (string.IsNullOrEmpty(strTransID)) { //FN.SetItemEnable(oForm, "btnCANCTR", false); if (oCheckBox.Checked || strTYPE == "O") { //strAcctCd = FN.GetRecordsetValue(" SELECT U_RMK1 FROM [@KIS_AD00201] WHERE Code = 'SO19' AND U_SMLCD = 'U204' "); //oDB_M.SetValue("U_ACCTCD", 0, strAcctCd); FN.SetAutoManagedAttribute(ref oForm, "edtDOCDT,cboMETHOD,cboACCTCD,edtBNKACCT,edtBNKHOLD,edtAMT,btnTRAN,chkACCTIN,cboACCTCD", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True); FN.SetAutoManagedAttribute(ref oForm, "cboTYPE,edtCENTCD,edtCENTNM,edtDOCDT,cboMETHOD,edtBNKACCT,edtBNKHOLD,edtAMT,chkACCTIN,cboACCTCD", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True); oMatrix.Clear(); oMatrix.FlushToDataSource(); } else { //oDB_M.SetValue("U_ACCTCD", 0, ""); FN.SetAutoManagedAttribute(ref oForm, "edtDOCDT,cboMETHOD,cboACCTCD,edtBNKACCT,edtBNKHOLD,mtx,btnPOPUP,btnTRAN,chkACCTIN", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True); FN.SetAutoManagedAttribute(ref oForm, "cboTYPE,edtCENTCD,edtCENTNM,edtDOCDT,cboMETHOD,edtBNKACCT,edtBNKHOLD,btnPOPUP,chkACCTIN,mtx", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True); } } } catch (Exception) { throw; } }
private void FindData2(SAPbouiCOM.Form oForm) { oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd1").Specific; oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific)); SAPbouiCOM.DBDataSource oKIS_HR00203_HRD = oForm.DataSources.DBDataSources.Item("@KIS_HR00203_HRD"); StringBuilder pQuery = new StringBuilder(); string sQry = string.Empty; oForm.Freeze(true); oMatrix.Clear(); oKIS_HR00203_HRD.Clear(); oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); try { #region 조회Query pQuery.Clear(); pQuery.AppendLine(" SELECT "); pQuery.AppendLine(" U_CHEKER AS U_CHEKER "); pQuery.AppendLine(" ,U_EMPNO AS U_EMPNO "); pQuery.AppendLine(" ,U_EMPNM AS U_EMPNM "); pQuery.AppendLine(" ,U_JIKGBCD AS U_JIKGBCD "); pQuery.AppendLine(" ,U_JIKCHKCD AS U_JIKCHKCD "); pQuery.AppendLine(" ,U_DEPTCD AS U_DEPTCD "); pQuery.AppendLine(" ,U_CHKRATE AS U_CHKRATE "); pQuery.AppendLine(" FROM [@KIS_HR00203_HRD] "); pQuery.AppendLine(" WHERE Code = '{0}' AND U_EMPCD <> 'L' "); pQuery.AppendLine(" ORDER BY U_CHEKER "); sQry = string.Format(pQuery.ToString(), GRIDCODE); #endregion oRS.DoQuery(sQry); B1Connections.theAppl.StatusBar.SetText("데이터 조회중입니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 if (oRS.RecordCount > 0) { for (int i = 0; i < oRS.RecordCount; i++) { if (i < oRS.RecordCount) { oKIS_HR00203_HRD.InsertRecord(i); } oKIS_HR00203_HRD.SetValue("U_CHEKER", i, oRS.Fields.Item("U_CHEKER").Value); oKIS_HR00203_HRD.SetValue("U_EMPNO", i, oRS.Fields.Item("U_EMPNO").Value); oKIS_HR00203_HRD.SetValue("U_EMPNM", i, oRS.Fields.Item("U_EMPNM").Value); oKIS_HR00203_HRD.SetValue("U_JIKGBCD", i, oRS.Fields.Item("U_JIKGBCD").Value); oKIS_HR00203_HRD.SetValue("U_JIKCHKCD", i, oRS.Fields.Item("U_JIKCHKCD").Value); oKIS_HR00203_HRD.SetValue("U_DEPTCD", i, oRS.Fields.Item("U_DEPTCD").Value); oKIS_HR00203_HRD.SetValue("U_CHKRATE", i, oRS.Fields.Item("U_CHKRATE").Value); oRS.MoveNext(); } oMatrix.LoadFromDataSource(); B1Connections.theAppl.StatusBar.SetText("조회완료", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); //조회완료 } else { FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oKIS_HR00203_HRD, FN.RowSelectMode.None, "U_CHEKER"); B1Connections.theAppl.StatusBar.SetText("데이터가 없습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터가 없습니다. } } catch (Exception ex) { oForm.Freeze(false); B1Connections.theAppl.StatusBar.SetText("btnFIND_OnAfterItemPressed " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oGrid = null; oMatrix = null; oRS = null; oKIS_HR00203_HRD = null; } }
private void DBDataSourcesBindingData(SAPbouiCOM.Form oForm, System.Data.DataTable dt, string strFileName) { try { //string U_RELDT = B1Connections.diCompany.GetCompanyDate().ToString("yyyy-MM-dd");//임포트 실행일 string U_RELDT = B1Connections.diCompany.GetCompanyDate().ToString("yyyyMMdd");//임포트 실행일 string U_RELUSER = B1Connections.diCompany.UserName;//임포트 실행 사용자 oMatrix = oForm.Items.Item("mtx").Specific; oForm.Freeze(true); oMatrix.Clear(); oMatrix.FlushToDataSource(); heDataTable.Clear(); boDataTable.Clear(); trDataTable.Clear(); for (int i = 0; i < dt.Rows.Count; i++) { //oMatrix.AddRow(); //oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ERRCD", dt.Rows[i][0].ToString()); //oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ERRMSG", dt.Rows[i][0].ToString()); string upRowText = dt.Rows[i][0].ToString(); string dataType = string.Empty; // dataType - 11 : 헤더, 22 : 바디, 33 : 합계 dataType = dt.Rows[i][0].ToString().Substring(0, 2); switch (dataType) { case "11": SetGiroTable(ref heDataTable, upRowText, dataType); break; case "22": SetGiroTable(ref boDataTable, upRowText, dataType); break; case "33": SetGiroTable(ref trDataTable, upRowText, dataType); break; default: break; } } // 수납자료의 고객관리번호를 Concat var linqTable = (from a in boDataTable.AsEnumerable() select new { U_RDNO = "'" + a.Field<string>("0140").Trim() + "'" }); string output = String.Join(",", linqTable.AsEnumerable().Select(a => a.U_RDNO).ToArray()); #region 유효성 체크 - 지로청구 자료가 삭제된 고객관리번호 표시 (개별입금에서 처리하기로 함) DBDataSourcesBindingData(oForm, output.Replace("'", "")); #endregion // 수납자료의 고객관리번호에 해당하는 청구자료 조회 //output = "14030000000040204118"; System.Data.DataTable sKIS_SO01601_HRD = null; System.Data.DataTable sKIS_SO0220M_HRD = null; sKIS_SO01601_HRD = FN.GetRecordsetToDataTable(string.Format("SELECT * FROM [@KIS_SO01601_HRD] WHERE U_RDNO IN ({0})", output)); // 지로청구 테이블 sKIS_SO0220M_HRD = FN.GetRecordsetToDataTable(string.Format("SELECT * FROM [@KIS_SO0220M_HRD] WHERE U_RDNO IN ({0})", output)); // 지로개별인쇄 테이블 #region 헤더 string U_GIRONO = heDataTable.Rows[0]["0020"].ToString().Substring(2, 7); FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_TRNSDT", heDataTable.Rows[0]["0050"].ToString()); FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_RELUSER", U_RELUSER); FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_RELDT", U_RELDT); FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_FILENM", Path.GetFileName(strFileName)); //FN.SetItemValue(ref oForm, "edtTRNSDT", heDataTable.Rows[0]["0050"].ToString()); //이체일자 //FN.SetItemValue(ref oForm, "edtRELUSER", U_RELUSER); //실행자 //FN.SetItemValue(ref oForm, "edtRELDT", U_RELDT); //실행일 //FN.SetItemValue(ref oForm, "edtFILENM", Path.GetFileName(strFileName)); //업로드파일 #endregion #region 바디 string U_RDNO = string.Empty; string U_DEPAMT = string.Empty; string U_CMMAMT = string.Empty; string U_DEPDT = string.Empty; string U_ERRCD = string.Empty; string U_ERRMSG = string.Empty; string U_PREQYM = string.Empty; string U_CENTGBN = string.Empty; string U_BPPER = string.Empty; int U_NOMCNT_S = 0; int U_UNSCNT_S = 0; int U_TOTCNT_S = boDataTable.Rows.Count; int U_NOMAMT_S = 0; int U_UNSAMT_S = 0; int U_TOTAMT_S = 0; int U_CMMAMT_S = 0; DataRow[] errDr = null; DataRow[] dataDr = null; System.Data.DataTable sDataTable = null; for (int boidx = 0; boidx < boDataTable.Rows.Count; boidx++) { U_RDNO = boDataTable.Rows[boidx]["0140"].ToString(); U_DEPAMT = boDataTable.Rows[boidx]["0150"].ToString(); U_CMMAMT = boDataTable.Rows[boidx]["0170"].ToString(); U_DEPDT = boDataTable.Rows[boidx]["0100"].ToString(); U_ERRCD = boDataTable.Rows[boidx]["0160"].ToString(); U_TOTAMT_S = U_TOTAMT_S + int.Parse(U_DEPAMT); U_CMMAMT_S = U_CMMAMT_S + int.Parse(U_CMMAMT); errDr = ErrorDataTable.Select(string.Format("U_CD='{0}'", U_ERRCD)); if (errDr.Length > 0) { U_ERRMSG = errDr[0]["U_SMLNM"].ToString(); U_UNSCNT_S++; U_UNSAMT_S = U_UNSAMT_S + int.Parse(U_DEPAMT); } #region linq datarow //IEnumerable<DataRow> sDataRows = (from a in sKIS_SO01601_HRD.AsEnumerable() // where a.Field<string>("U_RDNO") == U_RDNO //14030000000040204118 // select a).Take(1); //System.Data.DataTable rTable = sDataRows.CopyToDataTable(); //rTable.Rows[0]["U_RDCD"].ToString(); #endregion #region linq foreach //var lKIS_SO01601_HRD = (from a in sKIS_SO01601_HRD.AsEnumerable() // where a.Field<string>("U_RDNO") == U_RDNO // select new // { // U_GIRONO = a.Field<string>("U_GIRONO").Trim(), // U_RDCD = a.Field<string>("U_RDCD").Trim(), // U_RDNM = a.Field<string>("U_RDNM").Trim(), // U_RDNO = a.Field<string>("U_RDNO").Trim(), // U_ZIPCD1 = a.Field<string>("U_ZIPCD1").Trim(), // U_ADDR1 = a.Field<string>("U_ADDR1").Trim(), // U_ADDR1_D = a.Field<string>("U_ADDR1_D").Trim(), // U_ZIPCD2 = a.Field<string>("U_ZIPCD2").Trim(), // U_ADDR2 = a.Field<string>("U_ADDR2").Trim(), // U_ADDR2_D = a.Field<string>("U_ADDR2_D").Trim(), // U_BRCCD = a.Field<string>("U_BRCCD").Trim(), // U_REQYM = a.Field<string>("U_REQYM").Trim(), // U_CNT = a.Field<int>("U_CNT"), // U_USEYM = a.Field<string>("U_USEYM").Trim(), // U_REQAMT = a.Field<int>("U_REQAMT"), // U_PMETHOD = a.Field<string>("U_PMETHOD").Trim(), // U_MARKYM = a.Field<string>("U_MARKYM").Trim(), // U_PAYCD = a.Field<string>("U_PAYCD").Trim() // }).Take(1); //foreach (var linqRow in lKIS_SO01601_HRD) //{ // linqRow.U_ADDR1 //} #endregion // 지로청구내역 조회 sDataTable = null; dataDr = null; sDataTable = sKIS_SO01601_HRD.Copy(); dataDr = sDataTable.Select(string.Format("U_RDNO='{0}'", U_RDNO)); if (dataDr.Length == 0) { sDataTable = sKIS_SO0220M_HRD.Copy(); dataDr = sKIS_SO0220M_HRD.Select(string.Format("U_RDNO='{0}'", U_RDNO)); } if (dataDr.Length > 0) { oMatrix.AddRow(); oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_GIRONO", U_GIRONO); // 지로번호 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_RDNO", U_RDNO); // 고객관리번호 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_DEPAMT", U_DEPAMT); // 입금액 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_CMMAMT", U_CMMAMT); // 수수료 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_DEPDT", U_DEPDT); // 입금일자 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ERRCD", U_ERRCD); // 에러코드 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ERRMSG", U_ERRMSG); // 에러명칭 if (sDataTable.Columns.Contains("U_PREQYM")) U_PREQYM = dataDr[0]["U_PREQYM"].ToString(); else U_PREQYM = dataDr[0]["U_REQYM"].ToString(); if (sDataTable.Columns.Contains("U_CENTGBN")) U_CENTGBN = dataDr[0]["U_CENTGBN"].ToString(); else U_CENTGBN = ""; if (sDataTable.Columns.Contains("U_BPPER")) U_BPPER = dataDr[0]["U_BPPER"].ToString(); else U_BPPER = ""; oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_RDCD", dataDr[0]["U_RDCD"].ToString()); // 독자코드 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_RDNM", dataDr[0]["U_RDNM"].ToString()); // 청구처이름 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ZIPCD1", dataDr[0]["U_ZIPCD1"].ToString()); // 우편번호1 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ADDR1", dataDr[0]["U_ADDR1"].ToString()); // 주소1 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ADDR1_D", dataDr[0]["U_ADDR1_D"].ToString()); // 주소1 상세 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ZIPCD2", dataDr[0]["U_ZIPCD2"].ToString()); // 우편번호2 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ADDR2", dataDr[0]["U_ADDR2"].ToString()); // 주소2 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ADDR2_D", dataDr[0]["U_ADDR2_D"].ToString()); // 주소2 상세 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_BRCCD", dataDr[0]["U_BRCCD"].ToString()); // 지국코드 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_BRCNM", dataDr[0]["U_BRCNM"].ToString()); // 지국명칭 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_REQYM", dataDr[0]["U_REQYM"].ToString()); // 청구월 (TR) oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_CNT", dataDr[0]["U_CNT"].ToString()); // 부수 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_USEYM", dataDr[0]["U_USEYM"].ToString()); // 사용월 (TR) oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_REQAMT", dataDr[0]["U_REQAMT"].ToString()); // 청구금액 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_PMETHOD", dataDr[0]["U_PMETHOD"].ToString()); // 납부방법 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_MARKYM", dataDr[0]["U_MARKYM"].ToString()); // 표기년월 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_PAYCD", dataDr[0]["U_PAYCD"].ToString()); // 요금제코드 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_PAPERTP", dataDr[0]["U_PAPERTP"].ToString()); // 지종 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_CENTGBN", U_CENTGBN); // 분국구분 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_BPPER", U_BPPER); // 담당자 oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_PREQYM", U_PREQYM); // 지로청구월 (지로청구마스터의 청구월) } //else //{ // throw new Exception("고객관리번호[" + U_RDNO + "]가 존재하지 않습니다. 지로청구 자료를 확인해 주세요."); //} } #endregion #region 합계 U_NOMCNT_S = U_TOTCNT_S - U_UNSCNT_S; U_NOMAMT_S = U_TOTAMT_S - U_UNSAMT_S; FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_NOMCNT", U_NOMCNT_S.ToString()); FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_UNSCNT", U_UNSCNT_S.ToString()); FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_TOTCNT", U_TOTCNT_S.ToString()); FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_NOMAMT", U_NOMAMT_S.ToString()); FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_UNSAMT", U_UNSAMT_S.ToString()); FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_TOTAMT", U_TOTAMT_S.ToString()); FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_CMMAMT", U_CMMAMT_S.ToString()); #endregion oMatrix.FlushToDataSource(); } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); oMatrix.Clear(); oMatrix.FlushToDataSource(); heDataTable.Clear(); boDataTable.Clear(); trDataTable.Clear(); } finally { oForm.Freeze(false); } }