public virtual void ET_AFDataMenu_Add(MenuEvent pVal) { oForm = B1Connections.theAppl.Forms.ActiveForm; // ADD YOUR ACTION CODE HERE ... FN.SetItemEnable(oForm, "btnTRAN,btnCANCTR", false); oButton = oForm.Items.Item("1").Specific; oButton.Caption = "생성"; oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0400T_HRD"); oDB_M.SetValue("U_PERSON", 0, B1Connections.diCompany.UserName); SetYyyyMm_NextValue(oForm); }
}//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
}//fin LimpiarGrid private Boolean CrearDatos() { Boolean _result; Int32 i; TFunctions Functions; try { _result = true; i = 0; oDBDSHeader.Clear(); Functions = new TFunctions(); Functions.SBO_f = FSBOf; if (GlobalSettings.RunningUnderSQLServer) { s = "select Code, U_CodImpto, U_Desc, U_Porc from [@VID_FEIMPADIC]"; } else { s = @"select ""Code"", ""U_CodImpto"", ""U_Desc"", ""U_Porc"" from ""@VID_FEIMPADIC"" "; } oRecordSet.DoQuery(s); if (oRecordSet.RecordCount > 0) { Functions.ImpAdicDel(ref oRecordSet); } while (i < oDataTable.Rows.Count) { oDBDSHeader.InsertRecord(0); oDBDSHeader.SetValue("Code", 0, (System.String)(oDataTable.GetValue("Code", i)).ToString().Trim()); oDBDSHeader.SetValue("U_CodImpto", 0, (System.String)(oDataTable.GetValue("U_CodImpto", i)).ToString().Trim()); oDBDSHeader.SetValue("U_Desc", 0, (System.String)(oDataTable.GetValue("U_Desc", i)).ToString().Trim()); oDBDSHeader.SetValue("U_Porc", 0, FSBOf.DoubleToStr(((System.Double)oDataTable.GetValue("U_Porc", i))).Trim()); _result = Functions.ImpAdicAdd(oDBDSHeader); i++; } oDataTable.Rows.Add(1); oDataTable.SetValue("Code", oDataTable.Rows.Count - 1, ""); oDataTable.SetValue("U_CodImpto", oDataTable.Rows.Count - 1, ""); oDataTable.SetValue("U_Desc", oDataTable.Rows.Count - 1, ""); oDataTable.SetValue("U_Porc", oDataTable.Rows.Count - 1, 0); return(_result); } catch (Exception e) { FSBOApp.StatusBar.SetText(e.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); OutLog("CrearDatos " + e.Message + " ** Trace: " + e.StackTrace); return(false); } } //fin CrearDatos
}//fin MenuEvent private void GuardarRegistros() { TFunctions Reg; Int32 i; Int32 DocEntryAsig; String User, Pass; try { if (ValidarMatrix()) { Reg = new TFunctions(); Reg.SBO_f = FSBOf; oMtx.FlushToDataSource(); FCmpny.StartTransaction(); i = 0; while (i < oMtx.RowCount) { User = (System.String)(oDBDSH.GetValue("U_Usuario", i)); Pass = (System.String)(oDBDSH.GetValue("U_Password", i)); //s = Reg.Encriptar(Pass); oDBDSH.SetValue("U_Password", i, Pass); if ((System.String)(oDBDSH.GetValue("DocEntry", i)) == "") { DocEntryAsig = Reg.FEMultiSocAdd((System.String)(oDBDSH.GetValue("U_Servidor", i)), (System.String)(oDBDSH.GetValue("U_RUT", i)), (System.String)(oDBDSH.GetValue("U_Base", i)), (System.String)(oDBDSH.GetValue("U_Usuario", i)), (System.String)(oDBDSH.GetValue("U_Password", i)), (System.String)(oDBDSH.GetValue("U_Sociedad", i)), (System.String)(oDBDSH.GetValue("U_Habilitada", i))); oDBDSH.SetValue("DocEntry", i, DocEntryAsig.ToString()); } else { Reg.FEMultiSocUpt((System.String)(oDBDSH.GetValue("DocEntry", i)), (System.String)(oDBDSH.GetValue("U_Servidor", i)), (System.String)(oDBDSH.GetValue("U_RUT", i)), (System.String)(oDBDSH.GetValue("U_Base", i)), (System.String)(oDBDSH.GetValue("U_Usuario", i)), (System.String)(oDBDSH.GetValue("U_Password", i)), (System.String)(oDBDSH.GetValue("U_Sociedad", i)), (System.String)(oDBDSH.GetValue("U_Habilitada", i))); } //oDBDSH.SetValue("U_Password", i, Pass); i++; } FCmpny.EndTransaction(BoWfTransOpt.wf_Commit); oDBDSH.InsertRecord(i); oMtx.LoadFromDataSource(); oMtx.AutoResizeColumns(); FSBOApp.StatusBar.SetText("Sociedades registradas satisfactoriamente", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); } } catch (Exception e) { FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); OutLog("GuardarRegistros: " + e.Message + " ** Trace: " + e.StackTrace); if (FCmpny.InTransaction) { FCmpny.EndTransaction(BoWfTransOpt.wf_RollBack); } } }//fin GuardarRegistros
}//fin LimpiarGrid private Boolean CrearDatos() { Boolean _result; Int32 i; TFunctions Functions; try { _result = true; oDBDSHeader.Clear(); Functions = new TFunctions(); Functions.SBO_f = FSBOf; if (GlobalSettings.RunningUnderSQLServer) { s = "SELECT Code, Name FROM [@FM_IVA]"; } else { s = @"SELECT ""Code"", ""Name"" FROM ""@FM_IVA"" "; } oRecordSet.DoQuery(s); if (oRecordSet.RecordCount > 0) { Functions.PEImpDel(ref oRecordSet); } i = 0; while (i < oDataTable.Rows.Count) { oDBDSHeader.Clear(); oDBDSHeader.InsertRecord(0); oDBDSHeader.SetValue("Code", 0, ((System.String)oDataTable.GetValue("Code", i)).Trim()); oDBDSHeader.SetValue("Name", 0, ((System.String)oDataTable.GetValue("Name", i)).Trim()); _result = Functions.PEImpAdd(oDBDSHeader); i++; } oDataTable.Rows.Add(1); oDataTable.SetValue("Code", oDataTable.Rows.Count - 1, ""); oDataTable.SetValue("Name", oDataTable.Rows.Count - 1, ""); return(_result); } catch (Exception e) { FSBOApp.StatusBar.SetText(e.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); OutLog("CrearDatos " + e.Message + " ** Trace: " + e.StackTrace); return(false); } } //fin CrearDatos
//Pone el checkbox en Verdadero o falso public SAPbouiCOM.DBDataSource SetCheckbox(SAPbouiCOM.IMatrix pObjMatrix, IList <TicketDetail> pLstTicketDetail, SAPbouiCOM.DBDataSource pDBDataSourceD) { for (int i = 1; i <= pObjMatrix.RowCount; i++) { if (pLstTicketDetail[i - 1].WeighingM == 1) { ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = true; pDBDataSourceD.SetValue("TreeType", i - 1, "Y"); } else { ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = false; pDBDataSourceD.SetValue("TreeType", i - 1, "N"); } } return(pDBDataSourceD); }
private void GuardarDatos() { Int32 Entry = 0; Int32 LineId = 0; oForm.Freeze(true); try { oDBDSDetalle.Clear(); for (Int32 iCant = 0; iCant <= odt.Rows.Count - 1; iCant++) { if (((System.String)odt.GetValue("U_CtaSAP", iCant)) != "") { oDBDSDetalle.InsertRecord(LineId); oDBDSDetalle.SetValue("DocEntry", LineId, odt.GetValue("DocEntry", iCant).ToString().Trim()); oDBDSDetalle.SetValue("LineId", LineId, LineId.ToString()); oDBDSDetalle.SetValue("U_CtaSAP", LineId, ((System.String)odt.GetValue("U_CtaSAP", iCant)).ToString().Trim()); oDBDSDetalle.SetValue("U_DescSAP", LineId, ((System.String)odt.GetValue("U_DescSAP", iCant)).ToString().Trim()); } LineId++; } Entry = Funciones.UpdDataSourceInt1("VID_FEPLANCTA", oDBDSHeader, "VID_FEPLANCTAD", oDBDSDetalle, "", null, "", null); if (Entry > 0) { FSBOApp.StatusBar.SetText("Se ha guardado satisfactoriamente el Plan de Cuentas", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); } else { FSBOApp.StatusBar.SetText("No se ha guardado Plan de Cuentas", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } CargarGrilla(); oForm.Mode = BoFormMode.fm_OK_MODE; } catch (Exception y) { FSBOApp.StatusBar.SetText("GuardarDatos: " + y.Message + " ** Trace: " + y.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); OutLog("GuardarDatos: " + y.Message + " ** Trace: " + y.StackTrace); } finally { oForm.Freeze(false); } }
/// <summary> /// Metodo para buscar lineas en la matriz comparando los valores con la lista para marcar o no el checkbox /// </summary> /// <param name="pObjMatrix"></param> /// <param name="pLstTicketDetail"></param> /// <param name="pDBDataSourceD"></param> /// <returns></returns> public SAPbouiCOM.DBDataSource SetCheckbox2(SAPbouiCOM.IMatrix pObjMatrix, IList <TicketDetail> pLstTicketDetail, SAPbouiCOM.DBDataSource pDBDataSourceD) { SAPbouiCOM.CommonSetting lObjRowCtrl; lObjRowCtrl = pObjMatrix.CommonSetting; for (int i = 1; i <= pObjMatrix.RowCount; i++) { string l = ((SAPbouiCOM.EditText)pObjMatrix.Columns.Item("ItemCode").Cells.Item(i).Specific).Value; double xe = Convert.ToDouble(((SAPbouiCOM.EditText)pObjMatrix.Columns.Item("PesoN").Cells.Item(i).Specific).Value); foreach (var item in pLstTicketDetail.Where(x => x.Item == l && x.netWeight == xe)) { if (item.WeighingM == 1) { ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = true; lObjRowCtrl.SetCellEditable(i, 5, true); pDBDataSourceD.SetValue("TreeType", i - 1, "Y"); } else { ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = false; pDBDataSourceD.SetValue("TreeType", i - 1, "N"); } } } //for (int i = 1; i <= pObjMatrix.RowCount; i++) //{ // if (pLstTicketDetail[i - 1].WeighingM == 1) // { // ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = true; // pDBDataSourceD.SetValue("TreeType", i - 1, "Y"); // } // else // { // ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = false; // pDBDataSourceD.SetValue("TreeType", i - 1, "N"); // } //} return(pDBDataSourceD); }
}//fin InitForm public new void FormEvent(String FormUID, ref SAPbouiCOM.ItemEvent pVal, ref Boolean BubbleEvent) { //SAPbouiCOM.DataTable oDataTable; //SAPbouiCOM.IChooseFromListEvent oCFLEvento = null; Boolean bRes = false; base.FormEvent(FormUID, ref pVal, ref BubbleEvent); try { if ((pVal.ItemUID == "1") && (pVal.EventType == BoEventTypes.et_ITEM_PRESSED) && (pVal.BeforeAction)) { if (oForm.Mode == BoFormMode.fm_OK_MODE) { BubbleEvent = true; } else { BubbleEvent = false; if (oForm.Mode == BoFormMode.fm_ADD_MODE) { oDBDSHeader.SetValue("Code", 0, "1"); bRes = Funciones.AddDataSource1("VID_mSU", oDBDSHeader, "", null, "", null, "", null, "", null); } else if (oForm.Mode == BoFormMode.fm_UPDATE_MODE) { bRes = Funciones.UpdDataSource1("M", ((System.String)oDBDSHeader.GetValue("Code", 0)).Trim(), "VID_mSU", oDBDSHeader, "", null, "", null, "", null, "", null); } if (bRes) { oForm.Mode = BoFormMode.fm_OK_MODE; FSBOApp.StatusBar.SetText("Se registraron satisfactoriamente los datos", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); } else { FSBOApp.StatusBar.SetText("No se ha registrado los datos", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } } } } catch (Exception e) { if (FCmpny.InTransaction) { FCmpny.EndTransaction(BoWfTransOpt.wf_RollBack); } FSBOApp.StatusBar.SetText(e.Message + " ** Trace: " + e.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); OutLog("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace); } }//fin FormEvent
/// <summary> /// Agrega un item de venta de pesaje a la matriz /// </summary> public SAPbouiCOM.DBDataSource AddItemService(SAPbouiCOM.DBDataSource mDBDataSourceD) { mDBDataSourceD.Clear(); mDBDataSourceD.InsertRecord(0); QueryManager lObjQueryManager = new QueryManager(); string lSTrItemCode = lObjQueryManager.GetValue("U_Value", "Name", "PL_WEIGHING_SALE", "[@UG_CONFIG]"); mDBDataSourceD.SetValue("ItemCode", 0, lSTrItemCode); //Ponerlo en configuracion TicketDAO lObjTicketDAO = new TicketDAO(); string lStrPrice = lObjTicketDAO.GetPrice(lSTrItemCode); mDBDataSourceD.SetValue("Dscription", 0, "SERVICIO DE BASCULA"); mDBDataSourceD.SetValue("Price", 0, lStrPrice); if (lStrPrice == "0") { mDBDataSourceD.SetValue("Price", 0, "1"); } mDBDataSourceD.SetValue("Quantity", 0, "1"); mDBDataSourceD.SetValue("LineTotal", 0, "0"); return(mDBDataSourceD); }
}//fin InitForm public new void FormEvent(String FormUID, ref SAPbouiCOM.ItemEvent pVal, ref Boolean BubbleEvent) { Int32 nErr; String sErr; SAPbouiCOM.DataTable oDataTable; String sValue, sValue1; SAPbouiCOM.IChooseFromListEvent oCFLEvento = null; base.FormEvent(FormUID, ref pVal, ref BubbleEvent); try { if ((pVal.EventType == BoEventTypes.et_ITEM_PRESSED) && (pVal.BeforeAction)) { if ((pVal.ItemUID == "1") && (oForm.Mode == BoFormMode.fm_ADD_MODE)) { //BubbleEvent := ValidarDatosFE(); } } if ((pVal.EventType == BoEventTypes.et_CHOOSE_FROM_LIST) && (!pVal.BeforeAction)) { if (pVal.ColUID == "V_0") { oCFLEvento = (SAPbouiCOM.IChooseFromListEvent)(pVal); oDataTable = oCFLEvento.SelectedObjects; if (oDataTable != null) { sValue = (System.String)(oDataTable.GetValue("Code", 0)); sValue1 = (System.String)(oDataTable.GetValue("Name", 0)); oMtx.FlushToDataSource(); oDBDSD.SetValue("U_Indicato", pVal.Row - 1, sValue); oDBDSD.SetValue("U_Descrip", pVal.Row - 1, sValue1); if (pVal.Row == oMtx.RowCount) { oDBDSD.InsertRecord(pVal.Row); } oMtx.LoadFromDataSource(); oMtx.AutoResizeColumns(); if (oForm.Mode == BoFormMode.fm_OK_MODE) { oForm.Mode = BoFormMode.fm_UPDATE_MODE; } } } } } catch (Exception e) { FCmpny.GetLastError(out nErr, out sErr); FSBOApp.StatusBar.SetText("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); OutLog("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace); } }//fin FormEvent
}//fin MenuEvent private void GuardarRegistros() { TFunctions Reg; Int32 _return; try { if (Validar()) { if (GlobalSettings.RunningUnderSQLServer) { s = "select count(*) 'cont' from [@VID_FEDIST] where DocEntry = '{0}'"; } else { s = @"select COUNT(*) ""cont"" from ""@VID_FEDIST"" where ""DocEntry"" = '{0}' "; } s = String.Format(s, (System.String)(oDBDSH.GetValue("DocEntry", 0))); oRecordSet.DoQuery(s); Reg = new TFunctions(); Reg.SBO_f = FSBOf; oMtx.FlushToDataSource(); if ((System.Int32)(oRecordSet.Fields.Item("cont").Value) == 0) { _return = Reg.FEDistAdd(oDBDSH, oDBDSD); } else { _return = Reg.FEDistUpt(oDBDSH, oDBDSD); } if (_return > 0) { oDBDSH.SetValue("DocEntry", 0, Convert.ToString(_return)); oForm.Mode = BoFormMode.fm_OK_MODE; } } } catch (Exception e) { FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); OutLog("GuardarRegistros: " + e.Message + " ** Trace: " + e.StackTrace); } }//fin GuardarRegistros
private void AddPrefix() { //int i = 0; EditText oEditText = null; string newPhone = String.Empty; oItem = oForm.Items.Item("txtPhone"); oEditText = (EditText)oItem.Specific; oMatrix.FlushToDataSource(); oDBDataSource = oForm.DataSources.DBDataSources.Item("OCRD"); for (int i = 0; i <= oDBDataSource.Size - 1; i++) { newPhone = oDBDataSource.GetValue("Phone1", i); newPhone = newPhone.Trim(Char.Parse(" ")); oDBDataSource.SetValue("Phone1", 1, oEditText.String + newPhone); } oMatrix.LoadFromDataSource(); }
/// <summary> /// Agrega un item de venta de pesaje a la matriz /// </summary> public SAPbouiCOM.DBDataSource AddItemWeigin(SAPbouiCOM.DBDataSource mDBDataSourceD) { mDBDataSourceD.Clear(); mDBDataSourceD.InsertRecord(0); QueryManager lObjQueryManager = new QueryManager(); string lSTrItemCode = lObjQueryManager.GetValue("U_Value", "Name", "PL_ITEM_WEIGH", "[@UG_CONFIG]"); mDBDataSourceD.SetValue("ItemCode", 0, lSTrItemCode); //Ponerlo en configuracion TicketDAO lObjTicketDAO = new TicketDAO(); string lStrPrice = lObjTicketDAO.GetPrice(lSTrItemCode); mDBDataSourceD.SetValue("Dscription", 0, "Articulo de pesaje simple"); mDBDataSourceD.SetValue("Price", 0, lStrPrice); if (lStrPrice == "0") { mDBDataSourceD.SetValue("Price", 0, "0"); } mDBDataSourceD.SetValue("Quantity", 0, "0"); mDBDataSourceD.SetValue("LineTotal", 0, "0"); return(mDBDataSourceD); }
}//fin FormEvent private void GuardarRegistros() { TFunctions Reg; Int32 i; SAPbouiCOM.EditText oEditText; SAPbouiCOM.ComboBox oComboBox; String Code, Name, Hab; Boolean _return = false; try { Reg = new TFunctions(); Reg.SBO_f = FSBOf; oMtx.FlushToDataSource(); i = 1; while (i <= oMtx.RowCount) { oEditText = (EditText)(oMtx.Columns.Item("Code").Cells.Item(i).Specific); Code = (System.String)(oEditText.Value).Trim(); oEditText = (EditText)(oMtx.Columns.Item("Name").Cells.Item(i).Specific); Name = (System.String)(oEditText.Value).Trim(); oComboBox = (ComboBox)(oMtx.Columns.Item("Habilitada").Cells.Item(i).Specific); Hab = oComboBox.Value; oDBDSH.Clear(); oDBDSH.InsertRecord(0); oDBDSH.SetValue("Code", 0, Code); oDBDSH.SetValue("Name", 0, Name); oDBDSH.SetValue("U_Habilitada", 0, Hab); if (GlobalSettings.RunningUnderSQLServer) { s = @"select count(*) 'cont' from [@VID_FESUC] where Code = '{0}'"; } else { s = @"select COUNT(*) ""cont"" from ""@VID_FESUC"" where ""Code"" = '{0}' "; } s = String.Format(s, Code); oRecordSet.DoQuery(s); if ((System.Int32)(oRecordSet.Fields.Item("cont").Value) == 0) { _return = Reg.FESUCAdd(oDBDSH); } else { _return = Reg.FESUCUpd(oDBDSH); } i++; } if (_return) { oForm.Mode = BoFormMode.fm_OK_MODE; } } catch (Exception e) { FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); OutLog("GuardarRegistros: " + e.Message + " ** Trace: " + e.StackTrace); } }//fin GuardarRegistro
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; } }
public virtual void ET_cboJOB_AFComboSelect(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboJOB").Specific)); // ADD YOUR ACTION CODE HERE ... oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); oDB_M.SetValue("U_JOBNM", 0, oComboBox.Selected.Description); }
/// <summary> /// 독자코드가 존재하면 새로운 코드를 채번해서 화면상에 Bind하고 저장하도록 한다. /// </summary> /// <param name="oForm"></param> private void SeNewCodeApply(SAPbouiCOM.Form oForm) { string strNewCode = string.Empty; string strLineID = string.Empty; try { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); strNewCode = GetNewCode(oForm); oDB_M.SetValue("Code", 0, strNewCode); foreach (System.Data.DataRow dr in gDs.Tables[oForm.UniqueID + "_Deliver"].Rows) { strLineID = dr["LINEID"].ToString().Trim().PadLeft(4, '0'); dr["DELVCD"] = strNewCode + "_" + strLineID; } } catch (Exception) { throw; } }
/// <summary> /// 창 닫기전에 부모창에 값을 바인딩 한다. /// </summary> /// <param name="oForm"></param> private void SetDataToParentApply(SAPbouiCOM.Form oForm) { try { //oForm.Update(); oUDS = oForm.DataSources.UserDataSources; string StrPFormUID = oUDS.Item("pFORMUID").Value; pForm = B1Connections.theAppl.Forms.Item(StrPFormUID); //oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); pDB_M = pForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); //string strBANKNM = FN.GetItemValue(ref oForm, "cboBANKNM"); //string strBNKACCT = FN.GetItemValue(ref oForm, "edtBNKACCT"); //string strCREDTBP = FN.GetItemValue(ref oForm, "cboCREDTBP"); //string strDEPNAME = FN.GetItemValue(ref oForm, "edtDEPNAME"); //string strCREDTNO = FN.GetItemValue(ref oForm, "edtCREDTNO"); //string strVALIDMY = FN.GetItemValue(ref oForm, "edtVALIDMY"); //string strCREDTNM = FN.GetItemValue(ref oForm, "edtCREDTNM"); //string strJMNO = FN.GetItemValue(ref oForm, "edtJMNO1"); //string strJMNO2 = FN.GetItemValue(ref oForm, "edtJMNO2"); string strBANKNM = oUDS.Item("cboBANKNM").Value; string strBNKACCT = oUDS.Item("edtBNKACCT").Value; string strCREDTBP = oUDS.Item("cboCREDTBP").Value; string strDEPNAME = oUDS.Item("edtDEPNAME").Value; string strCREDTNO = oUDS.Item("edtCREDTNO").Value; string strVALIDMY = oUDS.Item("edtVALIDMY").Value; string strCREDTNM = oUDS.Item("edtCREDTNM").Value; string strJMNO = oUDS.Item("edtJMNO").Value; string strJMNOYN = oUDS.Item("chkJMNOYN").Value; pDB_M.SetValue("U_BANKNM", 0, strBANKNM); pDB_M.SetValue("U_BNKACCT", 0, strBNKACCT); pDB_M.SetValue("U_CREDTBP", 0, strCREDTBP); pDB_M.SetValue("U_DEPNAME", 0, strDEPNAME); pDB_M.SetValue("U_CREDTNO", 0, strCREDTNO); pDB_M.SetValue("U_VALIDMY", 0, strVALIDMY); pDB_M.SetValue("U_CREDTNM", 0, strCREDTNM); pDB_M.SetValue("U_JMNO", 0, strJMNO); pDB_M.SetValue("U_JMNOYN", 0, strJMNOYN); if (pForm.Mode == BoFormMode.fm_OK_MODE) pForm.Mode = BoFormMode.fm_UPDATE_MODE; } catch (Exception) { throw; } }
private void Guardar_Registros() { String CardCode; String CardName; String Activado; Int32 DocEntry; Int32 lRetCode; SAPbouiCOM.ProgressBar oProgressBar = null; oForm.Freeze(true); try { FSBOApp.StatusBar.SetText("Inicio de actualización lista negra", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); oProgressBar = FSBOApp.StatusBar.CreateProgressBar("Actualizando lista negra...", odt.Rows.Count, false); for (Int32 iCont_1 = 0; iCont_1 < odt.Rows.Count; iCont_1++) { if (((System.String)odt.GetValue("U_CardCode", iCont_1)).Trim().Length > 0) { oDBDSHeader.Clear(); oDBDSHeader.InsertRecord(0); DocEntry = ((System.Int32)odt.GetValue("DocEntry", iCont_1)); CardCode = ((System.String)odt.GetValue("U_CardCode", iCont_1)).Trim(); CardName = ((System.String)odt.GetValue("U_CardName", iCont_1)).Trim(); s = ((System.String)odt.GetValue("U_Activado", iCont_1)).Trim(); if (s == "") { Activado = "N"; } else { Activado = s; } oDBDSHeader.SetValue("U_CardCode", 0, CardCode); oDBDSHeader.SetValue("U_CardName", 0, CardName); oDBDSHeader.SetValue("U_Activado", 0, Activado); if (DocEntry != 0) { oDBDSHeader.SetValue("DocEntry", 0, DocEntry.ToString()); lRetCode = Funciones.UpdDataSourceInt1("VID_FELISTANE", oDBDSHeader, "", null, "", null, "", null); } else { lRetCode = Funciones.AddDataSourceInt1("VID_FELISTANE", oDBDSHeader, "", null, "", null, "", null); } if (lRetCode == 0) { FSBOApp.StatusBar.SetText("No se ha actualizado proveedor " + CardCode, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } else { FSBOApp.StatusBar.SetText("Se ha actualizado proveedor " + CardCode, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); } } oProgressBar.Value = iCont_1 + 1; } oProgressBar.Value = oProgressBar.Maximum; oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE; CargarGrid(); } catch (Exception e) { FSBOApp.StatusBar.SetText(e.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); OutLog("Guardar_Registros: " + e.Message + " ** Trace: " + e.StackTrace); } finally { oForm.Freeze(false); oProgressBar.Stop(); FSBOf._ReleaseCOMObject(oProgressBar); } }
public virtual bool ET_BFFormDataUpdate(BusinessObjectInfo pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); // ADD YOUR ACTION CODE HERE ... oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0150T_HRD"); oDB_M.SetValue("U_USERSG2", 0, B1Connections.diCompany.UserSignature.ToString()); if (BeforModifyData_CheckAuthority(oForm)) return true; else return false; }
private void FindSubData(SAPbouiCOM.Form oForm, int pRowIdx, string Type = "") { string strDeliveryCode = string.Empty; string strExpr = string.Empty; string strSort = string.Empty; System.Data.DataRow[] findRows = null; StringBuilder sb = new StringBuilder(); int i = 0; try { oForm.Freeze(true); oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1_DUMY").Specific)); oDB2_Z = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00302Z_HRD"); oDB2_Z.Clear(); if (oMatrix.VisualRowCount > 0) { strDeliveryCode = FN.GetMatirxCellValue(ref oMatrix, "U_DELVCD", pRowIdx); sb.Append(" 1 = 1 "); if (!string.IsNullOrEmpty(strDeliveryCode)) { sb.AppendFormat(" AND DELVCD = '{0}' ", strDeliveryCode); } if (Type == "") { sb.AppendFormat(" AND DELVCD = '{0}' ", strDeliveryCode); sFindTY = "F"; } else { sFindTY = ""; } findRows = gDs.Tables[oForm.UniqueID + "_Call"].Select(sb.ToString(), "IDX DESC"); oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_DUMY").Specific; foreach (System.Data.DataRow dr in findRows) { oDB2_Z.InsertRecord(i); oDB2_Z.SetValue("U_NO", i, (i + 1).ToString()); oDB2_Z.SetValue("U_IDX", i, dr["IDX"].ToString());//"데이터테이블 고유번호 IDX"; oDB2_Z.SetValue("LineId", i, dr["LINEID"].ToString());//"원본라인번호"; oDB2_Z.SetValue("U_DELVCD", i, dr["DELVCD"].ToString());//"배달코드" oDB2_Z.SetValue("U_CALLTP", i, dr["CALLTP"].ToString());//"콜유형" oDB2_Z.SetValue("U_MEMO", i, dr["MEMO"].ToString());//"접수내용" oDB2_Z.SetValue("U_RECVID", i, dr["RECVID"].ToString());//"접수자ID" oDB2_Z.SetValue("U_RECVNM", i, dr["RECVNM"].ToString());//"접수자명" oDB2_Z.SetValue("U_RECVDT", i, dr["RECVDT"].ToString());//"접수일자" oDB2_Z.SetValue("U_RECVTI", i, dr["RECVTI"].ToString());//"접수시간" oDB2_Z.SetValue("U_PROCID", i, dr["PROCID"].ToString());//"처리자ID" oDB2_Z.SetValue("U_PROCNM", i, dr["PROCNM"].ToString());//"처리자명" oDB2_Z.SetValue("U_PROCDT", i, dr["PROCDT"].ToString());//"처리일자" oDB2_Z.SetValue("U_PROSTAT", i, dr["PROSTAT"].ToString());//"처리상태" i += 1; } oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_DUMY").Specific; oMatrix.LoadFromDataSource(); //접수자 ID와 로그인 아이디가 다를경우 수정불가 for (int j = 0; j < oMatrix.VisualRowCount; j++) { if ((oMatrix.GetCellSpecific("U_RECVID", j + 1).Value.Trim() == B1Connections.diCompany.UserName.ToString()) && (sFindTY == "F")) { oMatrix.CommonSetting.SetCellEditable(j + 1, gCallTp_IDX, true); oMatrix.CommonSetting.SetCellEditable(j + 1, gComment_IDX, true); } else { oMatrix.CommonSetting.SetCellEditable(j + 1, gCallTp_IDX, false); oMatrix.CommonSetting.SetCellEditable(j + 1, gComment_IDX, false); } } } } catch (Exception) { oForm.Freeze(false); throw; } finally { oForm.Freeze(false); findRows = null; } }
public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings) { Int32 i; //SAPbouiCOM.EditTextColumn oEditText; SAPbouiCOM.CommonSetting oSetting; TFunctions Reg; bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings); try { oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)); Lista = new List <string>(); FSBOf.LoadForm(xmlPath, "VID_Sucursal.srf", uid); //EnableCrystal := true; oForm = FSBOApp.Forms.Item(uid); oForm.Freeze(true); oForm.AutoManaged = true; oForm.SupportedModes = -1; // afm_All // VID_DelRow := true; // VID_DelRowOK := true; //oForm.DataBrowser.BrowseBy := "Code"; oDBDSH = oForm.DataSources.DBDataSources.Item("@VID_FESUC"); // Ok Ad Fnd Vw Rq Sec Lista.Add("mtx , f, t, f, f, r, 1"); //Lista.Add('Name , f, t, t, f, r, 1'); //Lista.Add('CardCode , f, t, t, f, r, 1'); //FSBOf.SetAutoManaged(var oForm, Lista); //oCombo := ComboBox(oForm.Items.Item('TipDoc').Specific); //oCombo.ValidValues.Add('33', 'Factura'); //s := '1'; //oCombo.Select(s, BoSearchKey.psk_ByValue); // AddChooseFromList(); oMtx = (Matrix)(oForm.Items.Item("mtx").Specific); // oColumn := SAPbouiCOM.Column(oMtx.Columns.Item('V_0')); // oColumn.ChooseFromListUID := 'CFL0'; // oColumn.ChooseFromListAlias:= 'Code'; // oMtx.AutoResizeColumns(); if (GlobalSettings.RunningUnderSQLServer) { s = @"select Code, Name, ISNULL(U_Habilitada,'Y') 'Habilitada' from [@VID_FESUC]"; } else { s = @"select ""Code"", ""Name"", IFNULL(""U_Habilitada"",'Y') ""Habilitada"" from ""@VID_FESUC"" "; } oRecordSet.DoQuery(s); if (oRecordSet.RecordCount == 0) { if (GlobalSettings.RunningUnderSQLServer) { s = "select Code from [@VID_FESUC] where Code = 'Principal'"; } else { s = @"select ""Code"" from ""@VID_FESUC"" where ""Code"" = 'Principal' "; } oRecordSet.DoQuery(s); if (oRecordSet.RecordCount == 0) { Reg = new TFunctions(); Reg.SBO_f = FSBOf; oDBDSH.Clear(); oDBDSH.InsertRecord(0); oDBDSH.SetValue("Code", 0, "Principal"); oDBDSH.SetValue("Name", 0, "SAP BO"); oDBDSH.SetValue("U_Habilitada", 0, "Y"); if (Reg.FESUCAdd(oDBDSH) == true) { FSBOApp.StatusBar.SetText("Sucursal Principal creada correctamente", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); } else { FSBOApp.StatusBar.SetText("Sucursal Principal no ha sido creada", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } } } if (GlobalSettings.RunningUnderSQLServer) { s = @"select Code, Name, ISNULL(U_Habilitada,'Y') 'Habilitada' from [@VID_FESUC]"; } else { s = @"select ""Code"", ""Name"", IFNULL(""U_Habilitada"",'Y') ""Habilitada"" from ""@VID_FESUC"" "; } oRecordSet.DoQuery(s); i = 0; oDBDSH.Clear(); while (!oRecordSet.EoF) { oDBDSH.InsertRecord(i); oDBDSH.SetValue("Code", i, (System.String)(oRecordSet.Fields.Item("Code").Value)); oDBDSH.SetValue("Name", i, (System.String)(oRecordSet.Fields.Item("Name").Value)); oDBDSH.SetValue("U_Habilitada", i, (System.String)(oRecordSet.Fields.Item("Habilitada").Value)); oRecordSet.MoveNext(); i++; } oDBDSH.InsertRecord(i); oDBDSH.SetValue("Code", i, ""); oDBDSH.SetValue("Name", i, ""); oDBDSH.SetValue("U_Habilitada", i, "Y"); if (GlobalSettings.RunningUnderSQLServer) { s = @"select FldValue 'Code', Descr 'Name' from UFD1 where TableID = '@VID_FESUC' and FieldID = 0"; } else { s = @"select ""FldValue"" ""Code"", ""Descr"" ""Name"" from ""UFD1"" where ""TableID"" = '@VID_FESUC' and ""FieldID"" = 0"; } oRecordSet.DoQuery(s); oColumn = (SAPbouiCOM.Column)(oMtx.Columns.Item("Habilitada")); FSBOf.FillComboMtx(oColumn, ref oRecordSet, false); //EditText(oForm.Items.Item('CardCode').Specific).Active := True; oMtx.LoadFromDataSource(); oSetting = oMtx.CommonSetting; i = 1; while (i <= oMtx.RowCount) { if ((System.String)(oDBDSH.GetValue("Code", i - 1)).Trim() != "") { oSetting.SetCellEditable(i, 1, false); } i++; } oForm.Mode = BoFormMode.fm_OK_MODE; oMtx.AutoResizeColumns(); } catch (Exception e) { OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace); FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); } oForm.Freeze(false); return(Result); }//fin InitForm
}//fin InitForm public new void FormEvent(String FormUID, ref SAPbouiCOM.ItemEvent pVal, ref Boolean BubbleEvent) { //SAPbouiCOM.DataTable oDataTable; //inherited FormEvent(FormUID,var pVal,var BubbleEvent); String Local; SAPbouiCOM.CheckBox oCheckBox; base.FormEvent(FormUID, ref pVal, ref BubbleEvent); try { if ((pVal.EventType == BoEventTypes.et_ITEM_PRESSED) && (pVal.BeforeAction == true)) { if ((pVal.ItemUID == "1") && ((oForm.Mode == BoFormMode.fm_ADD_MODE) || (oForm.Mode == BoFormMode.fm_UPDATE_MODE))) { s = "1"; oDBDSHeader.SetValue("Code", 0, s); if (1 != FSBOApp.MessageBox("¿ Desea actualizar los parametros ?", 1, "Ok", "Cancelar", "")) { BubbleEvent = false; } else { BubbleEvent = false; if (oForm.SupportedModes == 1) { s = "1"; } else { s = "3"; } if (AddDatos(s)) { FSBOApp.StatusBar.SetText("Datos actualizados satisfactoriamente", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); oForm.Mode = BoFormMode.fm_OK_MODE; //Remover menu y colocar los nuevos segun parametros System.Xml.XmlDocument oXmlDoc = null; oXmlDoc = new System.Xml.XmlDocument(); oXmlDoc.Load(System.IO.Path.GetDirectoryName(TMultiFunctions.ParamStr(0)) + "\\Menus\\RemoveMenuPE.xml"); string sXML = oXmlDoc.InnerXml.ToString(); FSBOApp.LoadBatchActions(ref sXML); oXmlDoc.Load(System.IO.Path.GetDirectoryName(TMultiFunctions.ParamStr(0)) + "\\Menus\\Menu.xml"); sXML = oXmlDoc.InnerXml.ToString(); FSBOApp.LoadBatchActions(ref sXML); } } } } if ((pVal.EventType == BoEventTypes.et_ITEM_PRESSED) && (!pVal.BeforeAction)) { if (pVal.ItemUID == "btnProcFE") { CargarProcedimientos(); } } } catch (Exception e) { if (FCmpny.InTransaction) { FCmpny.EndTransaction(BoWfTransOpt.wf_RollBack); } FSBOApp.StatusBar.SetText(e.Message + " ** Trace: " + e.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); OutLog("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace); } }//fin FormEvent
public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings) { Int32 i; //TFunctions Reg; bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings); try { oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)); Lista = new List <string>(); FSBOf.LoadForm(xmlPath, "VID_FEPROCED.srf", uid); //EnableCrystal := true; oForm = FSBOApp.Forms.Item(uid); oForm.Freeze(true); oForm.AutoManaged = true; oForm.SupportedModes = -1; // afm_All // VID_DelRow := true; // VID_DelRowOK := true; //oForm.DataBrowser.BrowseBy := "Code"; oDBDSH = oForm.DataSources.DBDataSources.Item("@VID_FEPROCED"); // Ok Ad Fnd Vw Rq Sec Lista.Add("mtx , f, t, f, f, r, 1"); //Lista.Add('Name , f, t, t, f, r, 1'); //Lista.Add('CardCode , f, t, t, f, r, 1'); //FSBOf.SetAutoManaged(var oForm, Lista); //oCombo := ComboBox(oForm.Items.Item('TipDoc').Specific); //oCombo.ValidValues.Add('33', 'Factura'); //s := '1'; //oCombo.Select(s, BoSearchKey.psk_ByValue); // AddChooseFromList(); oMtx = (Matrix)(oForm.Items.Item("mtx").Specific); // oColumn := SAPbouiCOM.Column(oMtx.Columns.Item('V_0')); // oColumn.ChooseFromListUID := 'CFL0'; // oColumn.ChooseFromListAlias:= 'Code'; // oMtx.AutoResizeColumns(); if (GlobalSettings.RunningUnderSQLServer) { s = @"select DocEntry, ISNULL(U_TipoDoc,'') TipoDoc, ISNULL(U_ProcNomE,'') ProcNomE, ISNULL(U_ProcNomD,'') ProcNomD, ISNULL(U_ProcNomR,'') ProcNomR, ISNULL(U_ProcNomC,'') ProcNomC, ISNULL(U_ProcNomDe,'') ProcNomDe, ISNULL(U_ProcNomL,'') ProcNomL, ISNULL(U_ProcNomS,'') ProcNomS, ISNULL(U_Habili,'Y') 'Habilitada', ISNULL(U_CantLineas,0) 'CantLineas' from [@VID_FEPROCED]"; } else { s = @"select ""DocEntry"", IFNULL(""U_TipoDoc"",'') ""TipoDoc"", IFNULL(""U_ProcNomE"",'') ""ProcNomE"", IFNULL(""U_ProcNomD"",'') ""ProcNomD"", IFNULL(""U_ProcNomR"",'') ""ProcNomR"", IFNULL(""U_ProcNomC"",'') ""ProcNomC"", IFNULL(""U_ProcNomDe"",'') ""ProcNomDe"", IFNULL(""U_ProcNomL"",'') ""ProcNomL"", IFNULL(""U_ProcNomS"",'') ""ProcNomS"", IFNULL(""U_Habili"",'Y') ""Habilitada"", IFNULL(""U_CantLineas"",0) ""CantLineas"" from ""@VID_FEPROCED"" "; } oRecordSet.DoQuery(s); i = 0; oDBDSH.Clear(); while (!oRecordSet.EoF) { oDBDSH.InsertRecord(i); oDBDSH.SetValue("DocEntry", i, Convert.ToString((System.Int32)(oRecordSet.Fields.Item("DocEntry").Value))); oDBDSH.SetValue("U_TipoDoc", i, (System.String)(oRecordSet.Fields.Item("TipoDoc").Value)); //oDBDSH.SetValue("U_TipoDocPE", i, (System.String)(oRecordSet.Fields.Item("TipoDocPE").Value)); oDBDSH.SetValue("U_ProcNomE", i, (System.String)(oRecordSet.Fields.Item("ProcNomE").Value)); oDBDSH.SetValue("U_ProcNomD", i, (System.String)(oRecordSet.Fields.Item("ProcNomD").Value)); oDBDSH.SetValue("U_ProcNomR", i, (System.String)(oRecordSet.Fields.Item("ProcNomR").Value)); oDBDSH.SetValue("U_ProcNomC", i, (System.String)(oRecordSet.Fields.Item("ProcNomC").Value)); //oDBDSH.SetValue("U_ProcNomDe", i, (System.String)(oRecordSet.Fields.Item("ProcNomDe").Value)); //oDBDSH.SetValue("U_ProcNomL", i, (System.String)(oRecordSet.Fields.Item("ProcNomL").Value)); //oDBDSH.SetValue("U_ProcNomS", i, (System.String)(oRecordSet.Fields.Item("ProcNomS").Value)); oDBDSH.SetValue("U_Habili", i, (System.String)(oRecordSet.Fields.Item("Habilitada").Value)); oDBDSH.SetValue("U_CantLineas", i, Convert.ToString((System.Int32)(oRecordSet.Fields.Item("CantLineas").Value))); oRecordSet.MoveNext(); i++; } oDBDSH.InsertRecord(i); oDBDSH.SetValue("DocEntry", i, ""); oDBDSH.SetValue("U_TipoDoc", i, ""); //oDBDSH.SetValue("U_TipoDocPE", i, ""); oDBDSH.SetValue("U_ProcNomE", i, ""); oDBDSH.SetValue("U_ProcNomD", i, ""); oDBDSH.SetValue("U_ProcNomR", i, ""); oDBDSH.SetValue("U_ProcNomC", i, ""); //oDBDSH.SetValue("U_ProcNomDe", i, ""); //oDBDSH.SetValue("U_ProcNomL", i, ""); //oDBDSH.SetValue("U_ProcNomS", i, ""); oDBDSH.SetValue("U_Habili", i, "Y"); oDBDSH.SetValue("U_CantLineas", i, "60"); if (GlobalSettings.RunningUnderSQLServer) //TipoDoc { s = @"select U1.FldValue 'Code', U1.Descr 'Name' from UFD1 U1 join CUFD U0 on U0.TableID = U1.TableID and U0.FieldID = U1.FieldID where U1.TableID = '@VID_FEPROCED' and U0.AliasID = '{0}'"; } else { s = @"select U1.""FldValue"" ""Code"", U1.""Descr"" ""Name"" from ""UFD1"" U1 join ""CUFD"" U0 on U0.""TableID"" = U1.""TableID"" and U0.""FieldID"" = U1.""FieldID"" where U1.""TableID"" = '@VID_FEPROCED' and U0.""AliasID"" = '{0}' "; } s = String.Format(s, "TipoDoc"); oRecordSet.DoQuery(s); oColumn = (SAPbouiCOM.Column)(oMtx.Columns.Item("TipoDoc")); FSBOf.FillComboMtx(oColumn, ref oRecordSet, false); //((SAPbouiCOM.Column)oMtx.Columns.Item("TipoDocPE")).Visible = false; if (GlobalSettings.RunningUnderSQLServer) //Habilitado { s = @"select FldValue 'Code', Descr 'Name' from UFD1 where TableID = '@VID_FEPROCED' and FieldID = 2"; } else { s = @"select ""FldValue"" ""Code"", ""Descr"" ""Name"" from ""UFD1"" where ""TableID"" = '@VID_FEPROCED' and ""FieldID"" = 2"; } oRecordSet.DoQuery(s); oColumn = (SAPbouiCOM.Column)(oMtx.Columns.Item("Habili")); FSBOf.FillComboMtx(oColumn, ref oRecordSet, false); //EditText(oForm.Items.Item('CardCode').Specific).Active := True; oMtx.LoadFromDataSource(); oForm.Mode = BoFormMode.fm_OK_MODE; oMtx.AutoResizeColumns(); } catch (Exception e) { OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace); FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); } oForm.Freeze(false); return(Result); }//fin InitForm
/// <summary> /// 추가모드전환시 자동으로 생성가능한 년월을 가져온다. /// </summary> /// <param name="oForm"></param> /// <returns></returns> private bool SetYyyyMm_NextValue(SAPbouiCOM.Form oForm) { bool rtnValue = false; string strYyyyMm = string.Empty; string strDate = string.Empty; string strDesc = string.Empty; string strValue = string.Empty; string strPerson = string.Empty; StringBuilder sb; SAPbobsCOM.Recordset oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); try { strYyyyMm = FN.GetItemValue(ref oForm, "edtYYYYMM"); strPerson = B1Connections.diCompany.UserName; sb = new StringBuilder(); sb.AppendLine(" SELECT ISNULL ( (SELECT CONVERT (NVARCHAR (6), DATEADD (MM, 1, CONVERT (DATE, U_YYYYMM + '01')), 112) "); sb.AppendLine(" FROM (SELECT U_YYYYMM, ROW_NUMBER () OVER (ORDER BY U_YYYYMM DESC) AS RegSeq "); sb.AppendLine(" FROM [@KIS_SO0400T_HRD] "); sb.AppendFormat(" WHERE Status = 'O' AND U_PERSON = '{0}') AS x ", strPerson); sb.AppendLine(" WHERE RegSeq = 1) "); sb.AppendLine(" , CONVERT (NVARCHAR (6), GETDATE (), 112)) "); sb.AppendLine(" AS U_YYYYMM "); oRS.DoQuery(sb.ToString()); if (!oRS.EoF) { strValue = oRS.Fields.Item("U_YYYYMM").Value.ToString(); oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0400T_HRD"); oDB_M.SetValue("U_YYYYMM", 0, strValue); } } catch (Exception) { throw; } finally { if (oRS != null) { Marshal.ReleaseComObject(oRS); } oRS = null; } return rtnValue; }
private bool DataToDbDataSource_DELIVER(SAPbouiCOM.Form oForm) { bool rtnValue = false; try { oDB1_O = oForm.DataSources.DBDataSources.Item("@KIS_SO00301_HRD"); oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_ORIG").Specific; oMatrix.FlushToDataSource(); /* // 1. 메트릭스 삭제대상 삭제 적용 var objDelete = from row in gDs.Tables[oForm.UniqueID + "_Deliver"].AsEnumerable() where row.Field<string>("ROWSTATE") == "D" select new { vIDX = row.Field<Int32>("IDX") +1 }; foreach (var itemSub in objDelete) { //삭제할것들 선택한다. oMatrix.SelectRow(itemSub.vIDX, true, true); } // 선택된 Rows를 삭제한다. int iSelectIdx = 0; while (iSelectIdx != -1) { iSelectIdx = oMatrix.GetNextSelectedRow(0, BoOrderType.ot_SelectionOrder); if (iSelectIdx != -1) oMatrix.DeleteRow(iSelectIdx); } if(objDelete.Count() > 0) oMatrix.FlushToDataSource(); */ // 2. 수정, 추가된내역 적용 var objModify = from row in gDs.Tables[oForm.UniqueID + "_Deliver"].AsEnumerable() where row.Field<string>("ROWSTATE") == "M" || row.Field<string>("ROWSTATE") == "I" select new { vIDX = row.Field<Int32>("IDX") , vDELVCD = row.Field<string>("DELVCD") , vRDEPT = row.Field<string>("RDEPT") , vPAPERTP = row.Field<string>("PAPERTP") , vPAYCD = row.Field<string>("PAYCD") , vPAYNM = row.Field<string>("PAYNM") , vTEL = row.Field<string>("TEL") , vMOBILE = row.Field<string>("MOBILE") , vADDR1 = row.Field<string>("ADDR1") , vADDR2 = row.Field<string>("ADDR2") , vADDR1_D = row.Field<string>("ADDR1_D") , vADDR2_D = row.Field<string>("ADDR2_D") , vCENTCD = row.Field<string>("CENTCD") , vCENTNM = row.Field<string>("CENTNM") , vDELVFR = row.Field<string>("DELVFR") , vDELVTO = row.Field<string>("DELVTO") , vDELVCNT = row.Field<Int32>("DELVCNT") , vMETHOD = row.Field<string>("METHOD") , vSAILCD = row.Field<string>("SAILCD") , vSAILNM = row.Field<string>("SAILNM") , vSDEPT = row.Field<string>("SDEPT") , vSTATUS = row.Field<string>("STATUS") , vNOTE = row.Field<string>("NOTE") , vJOINDT = row.Field<string>("JOINDT") , vCLOSEDT = row.Field<string>("CLOSEDT") , vUSERSG1 = row.Field<string>("USERSG1") , vREADTP = row.Field<string>("READTP") , vBTEL1 = row.Field<string>("BTEL1") , vBTEL2 = row.Field<string>("BTEL2") , vROWSTATE = row.Field<string>("ROWSTATE") }; foreach (var itemSub in objModify) { if (itemSub.vROWSTATE == "I") SetDbDataSourceAddRow(ref oForm, ref oMatrix, ref oDB1_O, "U_DELVCD"); oDB1_O.SetValue("U_DELVCD", itemSub.vIDX, itemSub.vDELVCD); oDB1_O.SetValue("U_RDEPT", itemSub.vIDX, itemSub.vRDEPT); oDB1_O.SetValue("U_PAPERTP", itemSub.vIDX, itemSub.vPAPERTP); oDB1_O.SetValue("U_READTP", itemSub.vIDX, itemSub.vREADTP); oDB1_O.SetValue("U_PAYCD", itemSub.vIDX, itemSub.vPAYCD); oDB1_O.SetValue("U_PAYNM", itemSub.vIDX, itemSub.vPAYNM); oDB1_O.SetValue("U_TEL", itemSub.vIDX, itemSub.vTEL); oDB1_O.SetValue("U_MOBILE", itemSub.vIDX, itemSub.vMOBILE); oDB1_O.SetValue("U_ADDR1", itemSub.vIDX, itemSub.vADDR1); oDB1_O.SetValue("U_ADDR2", itemSub.vIDX, itemSub.vADDR2); oDB1_O.SetValue("U_ADDR1_D", itemSub.vIDX, itemSub.vADDR1_D); oDB1_O.SetValue("U_ADDR2_D", itemSub.vIDX, itemSub.vADDR2_D); oDB1_O.SetValue("U_CENTCD", itemSub.vIDX, itemSub.vCENTCD); oDB1_O.SetValue("U_CENTNM", itemSub.vIDX, itemSub.vCENTNM); oDB1_O.SetValue("U_DELVFR", itemSub.vIDX, itemSub.vDELVFR); oDB1_O.SetValue("U_DELVTO", itemSub.vIDX, itemSub.vDELVTO); oDB1_O.SetValue("U_DELVCNT", itemSub.vIDX, itemSub.vDELVCNT.ToString()); oDB1_O.SetValue("U_METHOD", itemSub.vIDX, itemSub.vMETHOD); oDB1_O.SetValue("U_STATUS", itemSub.vIDX, itemSub.vSTATUS); oDB1_O.SetValue("U_SAILCD", itemSub.vIDX, itemSub.vSAILCD); oDB1_O.SetValue("U_SAILNM", itemSub.vIDX, itemSub.vSAILNM); oDB1_O.SetValue("U_SDEPT", itemSub.vIDX, itemSub.vSDEPT); oDB1_O.SetValue("U_NOTE", itemSub.vIDX, itemSub.vNOTE); oDB1_O.SetValue("U_JOINDT", itemSub.vIDX, itemSub.vJOINDT); oDB1_O.SetValue("U_CLOSEDT", itemSub.vIDX, itemSub.vCLOSEDT); oDB1_O.SetValue("U_USERSG1", itemSub.vIDX, itemSub.vUSERSG1); //등록자 oDB1_O.SetValue("U_BTEL1", itemSub.vIDX, itemSub.vBTEL1); //분국전화1 oDB1_O.SetValue("U_BTEL2", itemSub.vIDX, itemSub.vBTEL2); //분국전화2 } if (objModify.Count() > 0) oMatrix.LoadFromDataSource(); rtnValue = true; } catch (Exception) { throw; } return rtnValue; }
public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings) { //SAPbouiCOM.ComboBox oCombo; TFunctions Param; SAPbouiCOM.CheckBox oCheckBox; SAPbouiCOM.EditText oEditText; // // obetener recurso // try // ..... // finally // liberar recurso // end bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings); oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)); try { //Lista := New list<string>; FSBOf.LoadForm(xmlPath, "strCnn.srf", uid); //EnableCrystal := true; oForm = FSBOApp.Forms.Item(uid); oForm.Freeze(true); oForm.AutoManaged = false; oForm.SupportedModes = -1; // afm_All //oForm.DataBrowser.BrowseBy := "DocNum"; // Ok Ad Fnd Vw Rq Sec //Lista.Add('DocNum , f, f, t, f, n, 1'); //Lista.Add('DocDate , f, t, f, f, r, 1'); //Lista.Add('CardCode , f, t, t, f, r, 1'); //FSBOf.SetAutoManaged(var oForm, Lista); oDBDSHeader = (DBDataSource)(oForm.DataSources.DBDataSources.Item("@VID_FEPARAM")); oCheckBox = (CheckBox)(oForm.Items.Item("chkMon").Specific); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox = (CheckBox)(oForm.Items.Item("chkDteTra").Specific); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; //oCheckBox = (CheckBox)(oForm.Items.Item("chkCrearD").Specific); //oCheckBox.ValOn = "Y"; //oCheckBox.ValOff = "N"; //oCheckBox = (CheckBox)(oForm.Items.Item("chkCrearDS").Specific); //oCheckBox.ValOn = "Y"; //oCheckBox.ValOff = "N"; oCheckBox = (CheckBox)(oForm.Items.Item("chkPrint").Specific); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox = (CheckBox)(oForm.Items.Item("chkDistrib").Specific); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox = (CheckBox)(oForm.Items.Item("chkVal90").Specific); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox = (CheckBox)(oForm.Items.Item("MultiSoc").Specific); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox = (CheckBox)(oForm.Items.Item("ValDescL").Specific); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox = (CheckBox)(oForm.Items.Item("GeneraT").Specific); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox = (CheckBox)(oForm.Items.Item("SubirSuc").Specific); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox = (CheckBox)(oForm.Items.Item("AbrirDoc").Specific); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox = (CheckBox)(oForm.Items.Item("chkFProv").Specific); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oEditText = (EditText)(oForm.Items.Item("Pasword").Specific); oEditText.IsPassword = true; //Configuración RadioButtons DSOpDif = oForm.DataSources.UserDataSources.Add("rbOpDif", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); ((OptionBtn)oForm.Items.Item("opDifPor").Specific).DataBind.SetBound(true, "", "rbOpDif"); //1 ((OptionBtn)oForm.Items.Item("opDifMon").Specific).DataBind.SetBound(true, "", "rbOpDif"); //2 ((OptionBtn)oForm.Items.Item("opDifMon").Specific).GroupWith("opDifPor"); if (!GlobalSettings.RunningUnderSQLServer) { oForm.Items.Item("btnProcFE").Visible = false; } else { oForm.Items.Item("btnProcFE").Visible = true; } //s := 'Select count(*) cant from [@VID_FEPARAM]'; if (GlobalSettings.RunningUnderSQLServer) { s = @"Select count(*) CANT ,U_Usuario ,U_Password ,U_UserWSCL ,U_PassWSCL ,ISNULL(U_TipoDif,'M') 'U_TipoDif' from [@VID_FEPARAM] group by U_Usuario ,U_Password ,U_UserWSCL ,U_PassWSCL ,ISNULL(U_TipoDif,'M')"; } else { s = @"Select count(*) ""CANT"" ,""U_Usuario"" ,""U_Password"" ,""U_UserWSCL"" ,""U_PassWSCL"" ,IFNULL(""U_TipoDif"",'M') ""U_TipoDif"" from ""@VID_FEPARAM"" group by ""U_Usuario"" ,""U_Password"" ,""U_UserWSCL"" ,""U_PassWSCL"" ,IFNULL(""U_TipoDif"",'M') "; } oRecordSet.DoQuery(s); if ((System.Int32)(oRecordSet.Fields.Item("CANT").Value) > 0) { Param = new TFunctions(); Param.SBO_f = FSBOf; oForm.SupportedModes = 1; oForm.Mode = BoFormMode.fm_UPDATE_MODE; oDBDSHeader.Query(null); s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_Usuario").Value).ToString().Trim()); oDBDSHeader.SetValue("U_Usuario", 0, s); s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_Password").Value).ToString().Trim()); oDBDSHeader.SetValue("U_Password", 0, s); s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_UserWSCL").Value).ToString().Trim()); oDBDSHeader.SetValue("U_UserWSCL", 0, s); s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_PassWSCL").Value).ToString().Trim()); oDBDSHeader.SetValue("U_PassWSCL", 0, s); oForm.PaneLevel = 101; if (((System.String)oDBDSHeader.GetValue("U_MultiSoc", 0)).Trim() == "Y") { oForm.Items.Item("chkDistrib").Visible = false; oForm.Items.Item("AbrirDoc").Visible = true; } else if (((System.String)oDBDSHeader.GetValue("U_MultiSoc", 0)).Trim() == "N") { oForm.Items.Item("chkDistrib").Visible = true; oForm.Items.Item("AbrirDoc").Visible = false; } oForm.Freeze(false); if (((System.String)oRecordSet.Fields.Item("U_TipoDif").Value).Trim() == "M") { DSOpDif.Value = "2"; } //((OptionBtn)oForm.Items.Item("opDifMon").Specific).Selected = true; else { DSOpDif.Value = "1"; } //((OptionBtn)oForm.Items.Item("opDifPor").Specific).Selected = true; } else { oForm.SupportedModes = 3; oForm.Mode = BoFormMode.fm_ADD_MODE; oForm.PaneLevel = 101; ((OptionBtn)oForm.Items.Item("opDifMon").Specific).Selected = true; } } catch (Exception e) { OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace); FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); } finally { oForm.Freeze(false); } return(Result); }//fin InitForm
/// <summary> /// 마스터의 구독부수를 갱신한다. /// </summary> /// <param name="oForm"></param> private void SetSumNumberOfCofies(SAPbouiCOM.Form oForm) { try { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); string strSum = gDs.Tables[oForm.UniqueID + "_Deliver"].Compute(" SUM(DELVCNT) ", " STATUS = 'UO'").ToString(); if (string.IsNullOrEmpty(strSum)) strSum = "0"; oDB_M.SetValue("U_SUMCNT", 0, strSum); } catch (Exception) { throw; } }
private void GuardarDatos() { Int32 Entry; oForm.Freeze(true); try { for (Int32 iCant = 0; iCant <= oDataTable.Rows.Count - 1; iCant++) { if (((System.String)oDataTable.GetValue("Cuenta", iCant)).Trim() != "") { oDBDSHeader.Clear(); oDBDSHeader.InsertRecord(0); oDBDSHeader.SetValue("U_Cuenta", 0, ((System.String)oDataTable.GetValue("Cuenta", iCant)).Trim()); oDBDSHeader.SetValue("U_Desc", 0, ((System.String)oDataTable.GetValue("Descripcion", iCant)).Trim()); oDBDSHeader.SetValue("U_Clasif", 0, ((System.String)oDataTable.GetValue("Clasificacion", iCant)).Trim()); if (((System.Int32)oDataTable.GetValue("DocEntry", iCant)) == 0) { Entry = Funciones.AddDataSourceInt1("VID_FEPLANCTA", oDBDSHeader, "", null, "", null, "", null); } else { oDBDSHeader.SetValue("DocEntry", 0, oDataTable.GetValue("DocEntry", iCant).ToString().Trim()); Entry = Funciones.UpdDataSourceInt1("VID_FEPLANCTA", oDBDSHeader, "", null, "", null, "", null); } if (Entry > 0) { FSBOApp.StatusBar.SetText("Se ha guardado satisfactoriamente el Plan de Cuenta", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); } else { FSBOApp.StatusBar.SetText("No se ha guardado Plan de Cuenta", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } } } CargarGrilla(); oForm.Mode = BoFormMode.fm_OK_MODE; } catch (Exception y) { FSBOApp.StatusBar.SetText("GuardarDatos: " + y.Message + " ** Trace: " + y.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); OutLog("GuardarDatos: " + y.Message + " ** Trace: " + y.StackTrace); } finally { oForm.Freeze(false); } }
public virtual void ET_edtCALLPER_AFValidate(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtCALLPER").Specific)); // ADD YOUR ACTION CODE HERE .... if (pVal.ItemChanged == true) { if (oEditText.Value == "") { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); oDB_M.SetValue("U_CALLNM", 0, ""); } } }
private void GetDataLoad(SAPbouiCOM.Form oForm) { string strYYYYMM = oForm.DataSources.UserDataSources.Item("U_YYYYMM").Value.Trim(); string strCENTCD = oForm.DataSources.UserDataSources.Item("U_CENTCD").Value.Trim(); string strCENTNM = oForm.DataSources.UserDataSources.Item("U_CENTNM").Value.Trim(); string strBENTRY = oForm.DataSources.UserDataSources.Item("U_BENTRY").Value.Trim(); oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0420T_HRD"); oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_SO04201_HRD"); //헤더데이터를 조회 QueryWithConditions_MASTER(ref oDB_M, strYYYYMM, strCENTCD); if (oDB_M.Size > 0) { string strDocEntry = oDB_M.GetValue("DocEntry", 0).Trim(); //헤더를 기준으로 라인데이터 조회 QueryWithConditions(ref oDB_1, "DocEntry", strDocEntry); oForm.Mode = BoFormMode.fm_OK_MODE; oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx").Specific; oMatrix.LoadFromDataSource(); } else { string strSTATUS = oForm.DataSources.UserDataSources.Item("U_STATUS").Value.Trim(); if (strSTATUS == "P") { // 아무것도 없는 마스터에 값을 입력할려고 하면 오류 발생 // 폼 모드 Add모드로 강제로 전환 하고 데이터 입력해야함. oForm.Mode = BoFormMode.fm_ADD_MODE; } oDB_M.SetValue("U_YYYYMM", 0, strYYYYMM); oDB_M.SetValue("U_CENTCD", 0, strCENTCD); oDB_M.SetValue("U_CENTNM", 0, strCENTNM); oDB_M.SetValue("U_BENTRY", 0, strBENTRY); oDB_M.SetValue("U_BTYPE", 0, "KIS_SO0310_HRD"); } }
public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings) { Int32 i; TFunctions Param; bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings); try { oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)); Lista = new List <string>(); FSBOf.LoadForm(xmlPath, "VID_FEMULTISOC.srf", uid); //EnableCrystal := true; oForm = FSBOApp.Forms.Item(uid); oForm.Freeze(true); oForm.AutoManaged = true; oForm.SupportedModes = -1; // afm_All VID_DelRow = false; VID_DelRowOK = false; Param = new TFunctions(); Param.SBO_f = FSBOf; //oForm.DataBrowser.BrowseBy := "DocEntry"; oDBDSH = oForm.DataSources.DBDataSources.Item("@VID_FEMULTISOC"); //oDBDSBases := oForm.DataSources.DBDataSources.Item("@VID_FEMULTISOC"); // Ok Ad Fnd Vw Rq Sec // Lista.Add('DocEntry , f, f, t, f, r, 1'); // Lista.Add('Desde , f, f, f, f, r, 1'); // Lista.Add('mtx , f, t, f, f, n, 1'); // FSBOf.SetAutoManaged(var oForm, Lista); oMtx = (Matrix)(oForm.Items.Item("mtx").Specific); oMtx.AutoResizeColumns(); //EditText(oForm.Items.Item('CardCode').Specific).Active := True; if (GlobalSettings.RunningUnderSQLServer) { s = @"select U_Sociedad ,U_RUT ,U_Servidor ,U_Base ,U_Usuario ,U_Password ,DocEntry ,U_Habilitada from [@VID_FEMULTISOC]"; } else { s = @"select ""U_Sociedad"" ,""U_RUT"" ,""U_Servidor"" ,""U_Base"" ,""U_Usuario"" ,""U_Password"" ,""DocEntry"" ,""U_Habilitada"" from ""@VID_FEMULTISOC"" "; } oRecordSet.DoQuery(s); if (oRecordSet.RecordCount == 0) { oMtx.AddRow(1, 1); oMtx.FlushToDataSource(); oMtx.AutoResizeColumns(); } else { i = 0; oDBDSH.Clear(); while (!oRecordSet.EoF) { oDBDSH.InsertRecord(i); oDBDSH.SetValue("U_Sociedad", i, (System.String)(oRecordSet.Fields.Item("U_Sociedad").Value)); oDBDSH.SetValue("U_RUT", i, (System.String)(oRecordSet.Fields.Item("U_RUT").Value)); oDBDSH.SetValue("U_Servidor", i, (System.String)(oRecordSet.Fields.Item("U_Servidor").Value)); oDBDSH.SetValue("U_Base", i, (System.String)(oRecordSet.Fields.Item("U_Base").Value)); oDBDSH.SetValue("U_Usuario", i, (System.String)(oRecordSet.Fields.Item("U_Usuario").Value)); //s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_Password").Value).ToString().Trim()); oDBDSH.SetValue("U_Password", i, (System.String)(oRecordSet.Fields.Item("U_Password").Value)); oDBDSH.SetValue("DocEntry", i, Convert.ToString((System.Int32)(oRecordSet.Fields.Item("DocEntry").Value))); oDBDSH.SetValue("U_Habilitada", i, (System.String)(oRecordSet.Fields.Item("U_Habilitada").Value)); i++; oRecordSet.MoveNext(); } oDBDSH.InsertRecord(i); oMtx.LoadFromDataSource(); oMtx.AutoResizeColumns(); } oForm.Mode = BoFormMode.fm_OK_MODE; } catch (Exception e) { OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace); FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); } oForm.Freeze(false); return(Result); }//fin InitForm
private void GuardarRegistros() { TFunctions Reg; Int32 i; SAPbouiCOM.EditText oEditText; SAPbouiCOM.ComboBox oComboBox; String DocEntry, ProcNomE, ProcNomD, ProcNomR, ProcNomC, ProcNomL, ProcNomS, Hab, TipoDoc, CantLineas, ProcNomDe; Int32 _return = 0; try { Reg = new TFunctions(); Reg.SBO_f = FSBOf; oMtx.FlushToDataSource(); i = 1; while (i <= oMtx.RowCount) { oEditText = (EditText)(oMtx.Columns.Item("DocEntry").Cells.Item(i).Specific); DocEntry = (System.String)(oEditText.Value).Trim(); oEditText = (EditText)(oMtx.Columns.Item("ProcNomE").Cells.Item(i).Specific); ProcNomE = (System.String)(oEditText.Value).Trim(); oEditText = (EditText)(oMtx.Columns.Item("ProcNomD").Cells.Item(i).Specific); ProcNomD = (System.String)(oEditText.Value).Trim(); oEditText = (EditText)(oMtx.Columns.Item("ProcNomR").Cells.Item(i).Specific); ProcNomR = (System.String)(oEditText.Value).Trim(); oEditText = (EditText)(oMtx.Columns.Item("ProcNomC").Cells.Item(i).Specific); ProcNomC = (System.String)(oEditText.Value).Trim(); //oEditText = (EditText)(oMtx.Columns.Item("ProcNomDe").Cells.Item(i).Specific); //ProcNomDe = (System.String)(oEditText.Value).Trim(); //oEditText = (EditText)(oMtx.Columns.Item("ProcNomL").Cells.Item(i).Specific); //ProcNomL = (System.String)(oEditText.Value).Trim(); //oEditText = (EditText)(oMtx.Columns.Item("ProcNomS").Cells.Item(i).Specific); //ProcNomS = (System.String)(oEditText.Value).Trim(); oComboBox = (ComboBox)(oMtx.Columns.Item("Habili").Cells.Item(i).Specific); Hab = oComboBox.Value; oComboBox = (ComboBox)(oMtx.Columns.Item("TipoDoc").Cells.Item(i).Specific); TipoDoc = oComboBox.Value; //oComboBox = (ComboBox)(oMtx.Columns.Item("TipoDocPE").Cells.Item(i).Specific); //TipoDocPE = oComboBox.Value; oEditText = (EditText)(oMtx.Columns.Item("CantLineas").Cells.Item(i).Specific); CantLineas = (System.String)(oEditText.Value).Trim(); oDBDSH.Clear(); oDBDSH.InsertRecord(0); oDBDSH.SetValue("DocEntry", 0, DocEntry); oDBDSH.SetValue("U_TipoDoc", 0, TipoDoc); //oDBDSH.SetValue("U_TipoDocPE", 0, TipoDocPE); oDBDSH.SetValue("U_Habili", 0, Hab); oDBDSH.SetValue("U_ProcNomE", 0, ProcNomE); oDBDSH.SetValue("U_ProcNomD", 0, ProcNomD); oDBDSH.SetValue("U_ProcNomR", 0, ProcNomR); oDBDSH.SetValue("U_ProcNomC", 0, ProcNomC); //oDBDSH.SetValue("U_ProcNomDe", 0, ProcNomDe); //oDBDSH.SetValue("U_ProcNomL", 0, ProcNomL); //oDBDSH.SetValue("U_ProcNomS", 0, ProcNomS); oDBDSH.SetValue("U_CantLineas", 0, CantLineas); if (DocEntry.Trim() == "") { _return = Reg.FEPROCAdd(oDBDSH); } else { _return = Reg.FEPROCUpt(oDBDSH); } if (_return != 0) { oEditText = (EditText)(oMtx.Columns.Item("DocEntry").Cells.Item(i).Specific); oEditText.Value = _return.ToString(); FSBOApp.StatusBar.SetText("Se ha guardado regsitro Tipo Documento " + TipoDoc, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); } else { FSBOApp.StatusBar.SetText("No se ha guardado regsitro Tipo Documento " + TipoDoc, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } i++; } oMtx.FlushToDataSource(); oMtx.AutoResizeColumns(); if (_return > 0) { oForm.Mode = BoFormMode.fm_OK_MODE; } } catch (Exception e) { FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); OutLog("GuardarRegistros: " + e.Message + " ** Trace: " + e.StackTrace); } }//fin GuardarRegistro
public virtual void ET_chkACCTIN_AFItemPressed(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oCheckBox = ((SAPbouiCOM.CheckBox)(oForm.Items.Item("chkACCTIN").Specific)); // ADD YOUR ACTION CODE HERE ... SetItemEnabled(oForm); //if (pVal.ItemChanged) //{ oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0320T_HRD"); oDB_M.SetValue("U_METHOD", 0, ""); oDB_M.SetValue("U_ACCTCD", 0, ""); SetComboBox_Method(oForm); //} }
public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings) { //SAPbouiCOM.ComboBox oCombo; TFunctions Param; SAPbouiCOM.CheckBox oCheckBox; SAPbouiCOM.EditText oEditText; // // obetener recurso // try // ..... // finally // liberar recurso // end bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings); oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)); try { //Lista := New list<string>; FSBOf.LoadForm(xmlPath, "strCnn.srf", uid); //EnableCrystal := true; oForm = FSBOApp.Forms.Item(uid); oForm.Freeze(true); oForm.AutoManaged = false; oForm.SupportedModes = -1; // afm_All //oForm.DataBrowser.BrowseBy := "DocNum"; // Ok Ad Fnd Vw Rq Sec //Lista.Add('DocNum , f, f, t, f, n, 1'); //Lista.Add('DocDate , f, t, f, f, r, 1'); //Lista.Add('CardCode , f, t, t, f, r, 1'); //FSBOf.SetAutoManaged(var oForm, Lista); oDBDSHeader = (DBDataSource)(oForm.DataSources.DBDataSources.Item("@VID_FEPARAM")); if (!GlobalSettings.RunningUnderSQLServer) { oForm.Items.Item("btnProcFE").Visible = false; } else { oForm.Items.Item("btnProcFE").Visible = true; } //s := 'Select count(*) cant from [@VID_FEPARAM]'; if (GlobalSettings.RunningUnderSQLServer) { s = @"Select count(*) CANT ,U_UserED ,U_PwdED ,U_UserWS ,U_PassWS from [@VID_FEPARAM] group by U_UserED ,U_PwdED ,U_UserWS ,U_PassWS"; } else { s = @"Select count(*) ""CANT"" ,""U_UserED"" ,""U_PwdED"" ,""U_UserWS"" ,""U_PassWS"" from ""@VID_FEPARAM"" group by ""U_UserED"" ,""U_PwdED"" ,""U_UserWS"" ,""U_PassWS"""; } oRecordSet.DoQuery(s); if ((System.Int32)(oRecordSet.Fields.Item("CANT").Value) > 0) { Param = new TFunctions(); Param.SBO_f = FSBOf; oForm.SupportedModes = 1; oForm.Mode = BoFormMode.fm_UPDATE_MODE; oDBDSHeader.Query(null); s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_UserED").Value).ToString().Trim()); oDBDSHeader.SetValue("U_UserED", 0, s); s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_PwdED").Value).ToString().Trim()); oDBDSHeader.SetValue("U_PwdED", 0, s); s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_UserWS").Value).ToString().Trim()); oDBDSHeader.SetValue("U_UserWS", 0, s); s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_PassWS").Value).ToString().Trim()); oDBDSHeader.SetValue("U_PassWS", 0, s); } else { oForm.SupportedModes = 3; oForm.Mode = BoFormMode.fm_ADD_MODE; oForm.PaneLevel = 106; } } catch (Exception e) { OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace); FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); } finally { oForm.Freeze(false); } return(Result); }//fin InitForm
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting(SAPbouiCOM.Form oForm) { try { //메트릭스 첫줄 선택시 팝업박스 뜨는것 막는다. oForm.Settings.EnableRowFormat = false; oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx").Specific; oMatrix.SelectionMode = BoMatrixSelect.ms_Auto; if (oForm.Mode != BoFormMode.fm_ADD_MODE) { oForm.Mode = BoFormMode.fm_ADD_MODE; } oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0320T_HRD"); oDB_M.SetValue("U_TYPE", 0, "I"); // 수금으로 선택 //네비게이션 버튼 활성화 및 네비게션의 유일한 값 oForm.DataBrowser.BrowseBy = "edtDOCNUM"; // 입금.지급방법 //FN.SetComboBoxValidValues(oForm, " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO51' AND U_RMK2 = 'Y' ", "cboMETHOD", FN.Enum_WholeTp.m_Nothing, ""); // 계정과목 콤보 //FN.SetComboBoxValidValues(oForm, " SELECT U_RMK1, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO19' AND U_SMLCD IN ('U201', 'U204') ", "cboACCTCD", FN.Enum_WholeTp.m_Space, ""); // 지국코드 FN.SetChooseFromListAdd(oForm, "KIS_SO0040_HRD", "edtCENTCD", "Code", BoFormItemTypes.it_EDIT); // 은행계좌 FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oHouseBankAccounts).ToString(), "edtBNKACCT", "Account", BoFormItemTypes.it_EDIT); //SAPbouiCOM.Conditions oCons = new SAPbouiCOM.Conditions(); //SAPbouiCOM.Condition oCon = oCons.Add(); //oCon.Alias = "GroupMask"; //oCon.Operation = BoConditionOperation.co_EQUAL; //oCon.CondVal = "2"; // 계정과목 //FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oChartOfAccounts).ToString(), "cboACCTCD", "AcctCode", BoFormItemTypes.it_EDIT, oCons); //계정과목으로 입금/지급체크 여부에 따라 아이뎀활성여부 SetItemEnabled(oForm); //입금지급 유형에따른 콤보바인딩처리 SetComboBox_Method(oForm); FN.SetSumField(ref oMatrix, "U_REQAMT,U_SAVAMT,U_REQUNP,U_SAVUNP,U_REQDEP,U_SAVDEP"); } catch (Exception) { throw; } }
}//fin MenuEvent private void ActualizarRegistrosWS() { String sCode = ""; //SqlDataAdapter cmd2; System.Data.DataTable resultDataTable; //System.Data.DataTable resultDataTable1; Int32 i; Boolean _return; SAPbouiCOM.GridColumn oColumn; String sDocEntry = ""; SAPbobsCOM.Recordset orsAux; String RUTEmpresa = ""; String URL = ""; String URLFinal; String[] TipoDocs = { "33", "34", "39", "41", "43", "46", "52", "56", "61", "110", "111", "112" }; String UserWS = ""; String PassWS = ""; String sMessage; String xmlCAF = ""; XmlDocument oXml; String Desde = ""; String Hasta = ""; String Fecha = ""; try { ActualizarGrilla(); orsAux = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)); if (GlobalSettings.RunningUnderSQLServer) { s = @"SELECT U_BuscarCAF, ISNULL(U_UserWSCL,'') 'UserWS', ISNULL(U_PassWSCL,'') 'PassWS' FROM [@VID_FEPARAM] WHERE Code = '1'"; } else { s = @"SELECT ""U_BuscarCAF"", IFNULL(""U_UserWSCL"",'') ""UserWS"", IFNULL(""U_PassWSCL"",'') ""PassWS"" FROM ""@VID_FEPARAM"" WHERE ""Code"" = '1'"; } orsAux.DoQuery(s); if (orsAux.RecordCount == 0) { throw new Exception("Debe parametrizar el addon"); } else if (((System.String)orsAux.Fields.Item("U_BuscarCAF").Value).Trim() == "") { throw new Exception("Debe ingresar http para buscar CAF en paramatros del addon"); } else { URL = ((System.String)orsAux.Fields.Item("U_BuscarCAF").Value).Trim(); if (((System.String)orsAux.Fields.Item("UserWS").Value).Trim() != "") { UserWS = Funciones.DesEncriptar(((System.String)orsAux.Fields.Item("UserWS").Value).Trim()); } if (((System.String)orsAux.Fields.Item("PassWS").Value).Trim() != "") { PassWS = Funciones.DesEncriptar(((System.String)orsAux.Fields.Item("PassWS").Value).Trim()); } } if (bMultiSoc) { if (GlobalSettings.RunningUnderSQLServer) { s = @"SELECT DocEntry, REPLACE(REPLACE(ISNULL(U_RUT,''),'.',''),'-','') TaxIdNum FROM [@VID_FEMULTISOC] WHERE U_Habilitada = 'Y'"; } else { s = @"SELECT TO_VARCHAR(""DocEntry"") ""DocEntry"", REPLACE(REPLACE(IFNULL(""U_RUT"",''),'.',''),'-','') ""TaxIdNum"" FROM ""@VID_FEMULTISOC"" WHERE ""U_Habilitada"" = 'Y' "; } } else { if (GlobalSettings.RunningUnderSQLServer) { s = @"SELECT REPLACE(REPLACE(ISNULL(TaxIdNum,''),'-',''),'.','') TaxIdNum FROM OADM"; } else { s = @"SELECT REPLACE(REPLACE(IFNULL(""TaxIdNum"",''),'-',''),'.','') ""TaxIdNum"" FROM ""OADM"" "; } } oRecordSet.DoQuery(s); if (oRecordSet.RecordCount > 0) { while (!oRecordSet.EoF) { try { RUTEmpresa = ((System.String)oRecordSet.Fields.Item("TaxIdNum").Value).Trim(); if (bMultiSoc) { sDocEntry = Convert.ToString((System.Int32)(oRecordSet.Fields.Item("DocEntry").Value)); } else { sDocEntry = "0"; } foreach (String xTipo in TipoDocs) { try { //http://portal1.easydoc.cl/consulta/generaciondte.aspx?RUT={0}&TIPODTE={1}&OP=22 URLFinal = URL; URLFinal = String.Format(URLFinal, RUTEmpresa, xTipo); WebRequest request = WebRequest.Create(URLFinal); if ((UserWS != "") && (PassWS != "")) { request.Credentials = new NetworkCredential(UserWS, PassWS); } request.Method = "POST"; string postData = "";//** xmlDOC.InnerXml; byte[] byteArray = Encoding.UTF8.GetBytes(postData); request.ContentType = "text/xml"; request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); WebResponse response = request.GetResponse(); Console.WriteLine(((HttpWebResponse)(response)).StatusDescription); dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); string responseFromServer = reader.ReadToEnd(); reader.Close(); dataStream.Close(); response.Close(); sMessage = responseFromServer; request = null; response = null; GC.Collect(); GC.WaitForPendingFinalizers(); if (sMessage != "") { xmlCAF = sMessage; xmlCAF = xmlCAF.Replace(@"<?xml version=""1.0""?>", ""); //xmlCAF = xmlCAF.Replace("\n", ""); //xmlCAF = xmlCAF.Replace(@"\", ""); //xmlCAF = xmlCAF.Replace(Environment.NewLine, ""); oXml = new XmlDocument(); oXml.LoadXml(xmlCAF); var DA = oXml.GetElementsByTagName("DA"); var RNG = ((XmlElement)DA[0]).GetElementsByTagName("RNG"); foreach (XmlElement nodo in RNG) { var nDesde = nodo.GetElementsByTagName("D"); var nHasta = nodo.GetElementsByTagName("H"); Desde = (System.String)(nDesde[0].InnerText); Hasta = (System.String)(nHasta[0].InnerText); } var CAF = oXml.GetElementsByTagName("CAF"); var DA2 = ((XmlElement)CAF[0]).GetElementsByTagName("DA"); foreach (XmlElement nodo in CAF) { var nFecha = nodo.GetElementsByTagName("FA"); Fecha = (System.String)(nFecha[0].InnerText); } if (GlobalSettings.RunningUnderSQLServer) { s = @"SELECT Code FROM [@VID_FECAF] WHERE U_TipoDoc = '{0}' AND U_Desde = {1} AND U_Hasta = {2} {3}"; } else { s = @"SELECT ""Code"" FROM ""@VID_FECAF"" WHERE ""U_TipoDoc"" = '{0}' AND ""U_Desde"" = {1} AND ""U_Hasta"" = {2} {3}"; } s = String.Format(s, xTipo, Desde, Hasta, (bMultiSoc ? " AND U_BaseMul = " + sDocEntry : "")); orsAux.DoQuery(s); if (orsAux.RecordCount == 0) //no existe en la base de datos { sCode = Funciones.sNuevoDocEntryLargo("@VID_FECAF", GlobalSettings.RunningUnderSQLServer); oDBDSH.Clear(); oDBDSH.InsertRecord(0); oDBDSH.SetValue("Code", 0, sCode); //OutLog("Code -> " + oDBDSH.GetValue("Code",0)); oDBDSH.SetValue("U_TipoDoc", 0, xTipo); //OutLog("TipoDoc -> " + oDBDSH.GetValue("U_TipoDoc", 0)); oDBDSH.SetValue("U_Desde", 0, Desde); //OutLog("Desde -> " + oDBDSH.GetValue("U_Desde", 0)); oDBDSH.SetValue("U_Hasta", 0, Hasta); //OutLog("Hasta -> " + oDBDSH.GetValue("U_Hasta", 0)); DateTime oFecha; DateTime.TryParse(Fecha, out oFecha); oDBDSH.SetValue("U_Fecha", 0, oFecha.ToString("yyyyMMdd")); //OutLog("Fecha -> " + oDBDSH.GetValue("U_Fecha", 0)); oDBDSH.SetValue("U_BaseMul", 0, sDocEntry); //OutLog("BaseMul -> " + oDBDSH.GetValue("U_BaseMul", 0)); oDBDSH.SetValue("U_CAF", 0, xmlCAF); //OutLog("CAF -> " + oDBDSH.GetValue("U_CAF", 0)); oDBDSH.SetValue("U_Utilizados", 0, "0"); //OutLog("Utilizados -> " + oDBDSH.GetValue("U_Utilizados", 0)); var iDif = (Convert.ToInt32(Hasta) - Convert.ToInt32(Desde)) + 1; oDBDSH.SetValue("U_Asignables", 0, iDif.ToString()); //OutLog("Asignables -> " + oDBDSH.GetValue("U_Asignables", 0)); oDBDSH.SetValue("U_FolioDesde", 0, Desde); //OutLog("FolioDesde -> " + oDBDSH.GetValue("U_FolioDesde", 0)); _return = Funciones.CAFAdd(oDBDSH); if (_return) { FSBOApp.StatusBar.SetText("CAF Registrado, TipoDoc " + xTipo, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); } else { FSBOApp.StatusBar.SetText("CAF no se ha registrado, TipoDoc " + xTipo, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } } } else { FSBOApp.StatusBar.SetText("No se ha encontrado CAF para documento " + xTipo, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Warning); } } catch (Exception v) { OutLog("Error actualizar CAF Tipo " + xTipo + " RUT Empresa " + RUTEmpresa + ", " + v.Message + ", TRACE " + v.StackTrace); FSBOApp.StatusBar.SetText("Error actualizar CAF Tipo " + xTipo + " RUT Empresa " + RUTEmpresa + ", " + v.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } }//Fin Foreach FSBOApp.StatusBar.SetText("CAF actualizados", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); } catch (Exception v) { OutLog("Error actualizar empresa RUT " + RUTEmpresa + ", " + v.Message + ", TRACE " + v.StackTrace); FSBOApp.StatusBar.SetText("Error actualizar empresa RUT " + RUTEmpresa + ", " + v.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } oRecordSet.MoveNext(); } ActualizarGrilla(); } else { FSBOApp.StatusBar.SetText("Debe ingresar datos de conexion", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } } catch (Exception e) { FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); OutLog("ActualizarRegistros: " + e.Message + " ** Trace: " + e.StackTrace); } }//fin ActualizarRegistros
private void SetComboBox_Method(SAPbouiCOM.Form oForm) { try { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0320T_HRD"); string strTYPE = oDB_M.GetValue("U_TYPE", 0).Trim(); string strACCTYN = oDB_M.GetValue("U_ACCTYN", 0).Trim(); string strLIST = string.Empty; if (strTYPE == "I") { if (strACCTYN == "Y") { strLIST = "'S04','S05'"; } else { strLIST = "'S04','S05','S11'";// 현금, 무통장, 보증금대체 } } else { strLIST = "'S04','S05','S12'";// 현금, 무통장, 미지급금대체 } if (String.IsNullOrEmpty(strLIST)) { oComboBox = oForm.Items.Item("cboMETHOD").Specific; FN.SetComboClear(ref oComboBox); oDB_M.SetValue("U_METHOD", 0, ""); } else { oComboBox = oForm.Items.Item("cboMETHOD").Specific; FN.SetComboClear(ref oComboBox); oDB_M.SetValue("U_METHOD", 0, ""); FN.SetComboBoxValidValues(oForm, string.Format(" SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO51' AND U_SMLCD IN ({0}) ", strLIST), "cboMETHOD", FN.Enum_WholeTp.m_Space, ""); } } catch (Exception) { throw; } }
public virtual bool ET_BFFormDataUpdate(BusinessObjectInfo pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); // ADD YOUR ACTION CODE HERE ... bool rtnValue = true; //메모리상의 데이터 테이블의 상태값을 기준으로 DBDataSource에 복사한다. try { //oForm.Freeze(true); oDB_M = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); oDB_M.SetValue("U_USERSG2", 0, B1Connections.diCompany.UserSignature.ToString()); // 등록자 / 수정자 저장 if (!DataToDbDataSource_DELIVER(oForm) || !DataToDbDataSource_CALL(oForm)) rtnValue = false; else rtnValue = true; } catch (Exception) { throw; } finally { //oForm.Freeze(false); } return rtnValue; }
private void SetComboBox_AcctCode(SAPbouiCOM.Form oForm) { try { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0320T_HRD"); string strTYPE = oDB_M.GetValue("U_TYPE", 0).Trim(); string strMETHOD = oDB_M.GetValue("U_METHOD", 0).Trim(); string strACCTYN = oDB_M.GetValue("U_ACCTYN", 0).Trim(); string strLIST = string.Empty; if (strACCTYN == "Y") { if (strMETHOD == "S04" || strMETHOD == "S05") // 현금,무통장 { if (strTYPE == "I") // 수금(입금) { strLIST = "'U201','U204'"; // 선수금, 보증금 } else { strLIST = "'U204'"; // 보증금 } } else if (strMETHOD == "S11") //보증금대체 { strLIST = "'U204'"; } else if (strMETHOD == "S12") // 미지급금대체 { strLIST = "'U204'"; } } if (String.IsNullOrEmpty(strLIST)) { oComboBox = oForm.Items.Item("cboACCTCD").Specific; FN.SetComboClear(ref oComboBox); oDB_M.SetValue("U_ACCTCD", 0, ""); } else { oComboBox = oForm.Items.Item("cboACCTCD").Specific; FN.SetComboClear(ref oComboBox); oDB_M.SetValue("U_ACCTCD", 0, ""); FN.SetComboBoxValidValues(oForm, string.Format(" SELECT U_RMK1, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO19' AND U_SMLCD IN ({0}) ", strLIST), "cboACCTCD", FN.Enum_WholeTp.m_Space, ""); } } catch (Exception) { throw; } }
private bool DataToDbDataSource_CALL(SAPbouiCOM.Form oForm) { bool rtnValue = false; try { oDB2_O = oForm.DataSources.DBDataSources.Item("@KIS_SO00302_HRD"); oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_ORIG").Specific; /* // 1. 메트릭스 삭제대상 삭제 적용 var objDelete = from row in gDs.Tables[oForm.UniqueID + "_Call"].AsEnumerable() where row.Field<string>("ROWSTATE") == "D" select new { vIDX = row.Field<Int32>("IDX") + 1 }; foreach (var itemSub in objDelete) { //삭제할것들 선택한다. oMatrix.SelectRow(itemSub.vIDX, true, true); } // 선택된 Rows를 삭제한다. int iSelectIdx = 0; while (iSelectIdx != -1) { iSelectIdx = oMatrix.GetNextSelectedRow(0, BoOrderType.ot_SelectionOrder); if (iSelectIdx != -1) oMatrix.DeleteRow(iSelectIdx); } if (objDelete.Count() > 0) oMatrix.FlushToDataSource(); * */ var objModify = from row in gDs.Tables[oForm.UniqueID + "_Call"].AsEnumerable() where row.Field<string>("ROWSTATE") == "M" || row.Field<string>("ROWSTATE") == "I" orderby row.Field<Int32>("IDX") descending select new { vIDX = row.Field<Int32>("IDX") , vDELVCD = row.Field<string>("DELVCD") , vCALLTP = row.Field<string>("CALLTP") , vMEMO = row.Field<string>("MEMO") , vRECVID = row.Field<string>("RECVID") , vRECVNM = row.Field<string>("RECVNM") , vRECVDT = row.Field<string>("RECVDT") , vRECVTI = row.Field<string>("RECVTI") , vPROCID = row.Field<string>("PROCID") , vPROCNM = row.Field<string>("PROCNM") , vPROCDT = row.Field<string>("PROCDT") , vPROSTAT = row.Field<string>("PROSTAT") , vROWSTATE = row.Field<string>("ROWSTATE") }; foreach (var itemSub in objModify) { if (itemSub.vROWSTATE == "I") SetDbDataSourceAddRow(ref oForm, ref oMatrix, ref oDB2_O, "U_DELVCD"); oDB2_O.SetValue("U_DELVCD", itemSub.vIDX, itemSub.vDELVCD); oDB2_O.SetValue("U_CALLTP", itemSub.vIDX, itemSub.vCALLTP); oDB2_O.SetValue("U_MEMO", itemSub.vIDX, itemSub.vMEMO); oDB2_O.SetValue("U_RECVID", itemSub.vIDX, itemSub.vRECVID); oDB2_O.SetValue("U_RECVNM", itemSub.vIDX, itemSub.vRECVNM); oDB2_O.SetValue("U_RECVDT", itemSub.vIDX, itemSub.vRECVDT); oDB2_O.SetValue("U_RECVTI", itemSub.vIDX, itemSub.vRECVTI); oDB2_O.SetValue("U_PROCID", itemSub.vIDX, itemSub.vPROCID); oDB2_O.SetValue("U_PROCNM", itemSub.vIDX, itemSub.vPROCNM); oDB2_O.SetValue("U_PROCDT", itemSub.vIDX, itemSub.vPROCDT); oDB2_O.SetValue("U_PROSTAT", itemSub.vIDX, itemSub.vPROSTAT); } if (objModify.Count() > 0) oMatrix.LoadFromDataSource(); rtnValue = true; } catch (Exception) { throw; } return rtnValue; }
public virtual void ET_edtBNKACCT_AFChooseFromList(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtBNKACCT").Specific)); // ADD YOUR ACTION CODE HERE ... //데이터를 가져오기 위해 데이터테이블 추가 SAPbouiCOM.DataTable oDataTable = FN.GetCFLSelectedObjects(pVal); try { if (oDataTable != null) { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0320T_HRD"); oDB_M.SetValue("U_BNKACCT", 0, oDataTable.GetValue("Account", 0).ToString()); //계좌 //oDB_M.SetValue("U_ACCTCD", 0, oDataTable.GetValue("GLAccount", 0).ToString());//계정콛, oDB_M.SetValue("U_BNKBRCH", 0, oDataTable.GetValue("Branch", 0).ToString());//지점명 } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("ET_edtBNKACCT_AFChooseFromList " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oDataTable = null; } }
public virtual void ET_edtCALLPER_AFChooseFromList(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtCALLPER").Specific)); // ADD YOUR ACTION CODE HERE ... //데이터를 가져오기 위해 데이터테이블 추가 SAPbouiCOM.DataTable oDataTable = FN.GetCFLSelectedObjects(pVal); try { if (oForm.Mode != BoFormMode.fm_FIND_MODE) { if (oDataTable != null) { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); oDB_M.SetValue("U_CALLPER", 0, oDataTable.GetValue("USER_CODE", 0).ToString()); oDB_M.SetValue("U_CALLNM", 0, oDataTable.GetValue("U_NAME", 0).ToString()); if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE; } } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("ET_edtCALLPER_AFChooseFromList " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oDataTable = null; } }
public virtual void ET_edtBNKACCT_AFValidate(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtBNKACCT").Specific)); // ADD YOUR ACTION CODE HERE .... if (pVal.ItemChanged == true) { if (oEditText.Value == "") { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0320T_HRD"); //oDB_M.SetValue("U_ACCTCD", 0, "");//계정콛 oDB_M.SetValue("U_BNKBRCH", 0, "");//지점명 } } }
public virtual void ET_CallBack_AFClick(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("CallBack").Specific)); // ADD YOUR ACTION CODE HERE ... string popupID = string.Empty; popupID = oButton.Caption.ToString(); if (string.IsNullOrEmpty(popupID)) return; // 리턴 DataTable SAPbouiCOM.DataTable rDT = KIS_SO0000F_HRD.GetReturnDT(popupID, oForm.UniqueID); int rowIdx = KIS_SO0000F_HRD.GetSelectRowIdx(popupID, oForm.UniqueID); oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific; int idx = GetDataTableIndexByMatrix(oMatrix, rowIdx); oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); switch (popupID) { case "DTL_지번주소": oMatrix.SetCellWithoutValidation(rowIdx, "U_ADDR1", rDT.GetValue("RADDR_KOR", 0)); SetDeliveryDataApply(oForm, "U_ADDR1", rowIdx); if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE; break; case "DTL_거리주소": oMatrix.SetCellWithoutValidation(rowIdx, "U_ADDR2", rDT.GetValue("RADDR_KOR", 0)); SetDeliveryDataApply(oForm, "U_ADDR2", rowIdx); if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE; break; case "MST_지번주소": oDB_M.SetValue("U_ZIPCD1", 0, rDT.GetValue("ZIP_CD", 0)); oDB_M.SetValue("U_ADDR1", 0, rDT.GetValue("RADDR_KOR", 0)); if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE; break; case "MST_거리주소": oDB_M.SetValue("U_ZIPCD2", 0, rDT.GetValue("ZIP_CD", 0)); oDB_M.SetValue("U_ADDR2", 0, rDT.GetValue("RADDR_KOR", 0)); if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE; break; case "접수내용": rowIdx = int.Parse(oForm.DataSources.UserDataSources.Item("cRow").Value); SetCallDataApply(oForm, "U_MEMO", rowIdx); if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE; break; case "선수금내역": break; default: break; } }
public SAPbouiCOM.DBDataSource CalcImport(string pStrTypeTicket, SAPbouiCOM.IMatrix pObjMatrix, int pIntRow, SAPbouiCOM.DBDataSource pDBDataSourceD) { try { double lDblPesoNeto = 0; double lDblPeso1 = 0; double lDblPeso2 = 0; double lDblImporte = 0; double lDblPrice = 0; string lStrSacos = ""; if (pIntRow <= pObjMatrix.RowCount && !string.IsNullOrEmpty((pObjMatrix.Columns.Item("Peso2").Cells.Item(pIntRow).Specific as EditText).Value.Trim())) { lDblPeso1 = Convert.ToDouble((pObjMatrix.Columns.Item("Peso1").Cells.Item(pIntRow).Specific as EditText).Value.Trim()); //itemcode = VALUE OF CELL. COLUMN "1": ITEMCODE COLUMN. CURRENT ROW: pVal.Row lDblPeso2 = Convert.ToDouble((pObjMatrix.Columns.Item("Peso2").Cells.Item(pIntRow).Specific as EditText).Value.Trim()); lDblPrice = Convert.ToDouble((pObjMatrix.Columns.Item("Price").Cells.Item(pIntRow).Specific as EditText).Value.Trim()); if (pStrTypeTicket != "Venta de pesaje" && pStrTypeTicket != "Pesaje") { lStrSacos = ((SAPbouiCOM.EditText)pObjMatrix.Columns.Item("Sacos").Cells.Item(pIntRow).Specific).Value; } // lDblPesoNeto = Convert.ToDouble((mObjMatrix.Columns.Item("PesoN").Cells.Item(mIntRow).Specific as EditText).Value.Trim()); if (!((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(pIntRow).Specific).Checked) { pDBDataSourceD.SetValue("TreeType", pIntRow - 1, "N"); if (lDblPeso1 != 0 && lDblPeso2 != 0 && lDblPesoNeto == 0) { lDblPesoNeto = lDblPeso2 - lDblPeso1; } } else { pDBDataSourceD.SetValue("TreeType", pIntRow - 1, "Y"); lDblPesoNeto = Convert.ToDouble((pObjMatrix.Columns.Item("PesoN").Cells.Item(pIntRow).Specific as EditText).Value.Trim()); } lDblPrice = Convert.ToDouble((pObjMatrix.Columns.Item("Price").Cells.Item(pIntRow).Specific as EditText).Value.Trim()); if (mObjValidations.ValidateWeight(pStrTypeTicket, lDblPesoNeto, lDblPeso2, pObjMatrix, pIntRow)) { //Valida el tipo de peso if (lDblPesoNeto < 0) { lDblPesoNeto = lDblPesoNeto * -1; } if (!((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(pIntRow).Specific).Checked) { (pObjMatrix.Columns.Item("PesoN").Cells.Item(pIntRow).Specific as EditText).Value = lDblPesoNeto.ToString("C"); } //(pObjMatrix.Columns.Item("Price").Cells.Item(pIntRow).Specific as EditText).Value = lDblPrice.ToString("C"); pDBDataSourceD.SetValue("Quantity", pIntRow - 1, lDblPesoNeto.ToString("C")); pDBDataSourceD.SetValue("Price", pIntRow - 1, lDblPrice.ToString("C")); // (pObjMatrix.Columns.Item("Peso1").Cells.Item(pIntRow).Specific as EditText).Value = lDblPeso1.ToString(); // (pObjMatrix.Columns.Item("Peso2").Cells.Item(pIntRow).Specific as EditText).Value = lDblPeso2.ToString(); pDBDataSourceD.SetValue("Weight1", pIntRow - 1, lDblPeso1.ToString()); pDBDataSourceD.SetValue("Weight2", pIntRow - 1, lDblPeso2.ToString()); pDBDataSourceD.SetValue("U_GLO_BagsBales", pIntRow - 1, lStrSacos); //mObjMatrix.Item.Visible = false; //mObjMatrix.Item.Visible = true; //mObjMatrix.LoadFromDataSource(); if (pStrTypeTicket == "Venta de pesaje" || pStrTypeTicket == "Pesaje") { lDblImporte = lDblPrice; } else { lDblImporte = lDblPesoNeto * lDblPrice; } //if (lDblImporte < 0) //{ // lDblImporte = lDblImporte * -1; //} (pObjMatrix.Columns.Item("Importe").Cells.Item(pIntRow).Specific as EditText).Value = lDblImporte.ToString("C"); pDBDataSourceD.SetValue("LineTotal", pIntRow - 1, lDblImporte.ToString("C")); pObjMatrix.Item.Update(); //pObjMatrix.LoadFromDataSource(); } } } catch (Exception ex) { LogService.WriteError("[CalcImport]: " + ex.Message); LogService.WriteError(ex); UIApplication.ShowMessageBox("Error al calcular Importe " + ex.Message); } return(pDBDataSourceD); }
/// <summary> /// ItemValidate 를 한곳에서 처리하도록함. /// </summary> /// <param name="oForm"></param> /// <param name="pItemUID"></param> private void ItemValidate(SAPbouiCOM.Form oForm, string pItemUID) { string strItemValue = string.Empty; try { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); switch (pItemUID) { //납부방법 1 case "edtPAY_FR1": strItemValue = FN.GetItemValue(ref oForm, pItemUID); if (!string.IsNullOrEmpty(strItemValue)) { string strMonthFirstDate = DateTimeLibrary.FirstDayOfCurrentMonth(strItemValue); oDB_M.SetValue("U_PAY_FR1", 0, FN.SetDateFormatToDB(strMonthFirstDate, FN.eDateType.n_YYYYMMDD)); strItemValue = FN.GetItemValue(ref oForm, "edtPAY_TO1"); if (string.IsNullOrEmpty(strItemValue)) oDB_M.SetValue("U_PAY_TO1", 0, "29991231"); } break; case "edtPAY_TO1": strItemValue = FN.GetItemValue(ref oForm, pItemUID); if (!string.IsNullOrEmpty(strItemValue)) { string strMonthLastDate = DateTimeLibrary.LastDayOfCurrentMonth(strItemValue); oDB_M.SetValue("U_PAY_TO1", 0, FN.SetDateFormatToDB(strMonthLastDate, FN.eDateType.n_YYYYMMDD)); } break; //납부방법 2 case "edtPAY_FR2": strItemValue = FN.GetItemValue(ref oForm, pItemUID); if (!string.IsNullOrEmpty(strItemValue)) { string strMonthFirstDate = DateTimeLibrary.FirstDayOfCurrentMonth(strItemValue); oDB_M.SetValue("U_PAY_FR2", 0, FN.SetDateFormatToDB(strMonthFirstDate, FN.eDateType.n_YYYYMMDD)); } break; case "edtPAY_TO2": strItemValue = FN.GetItemValue(ref oForm, pItemUID); if (!string.IsNullOrEmpty(strItemValue)) { string strMonthLastDate = DateTimeLibrary.LastDayOfCurrentMonth(strItemValue); oDB_M.SetValue("U_PAY_TO2", 0, FN.SetDateFormatToDB(strMonthLastDate, FN.eDateType.n_YYYYMMDD)); } break; // 구독기간 case "edtR_FRDT": strItemValue = FN.GetItemValue(ref oForm, pItemUID); if (!string.IsNullOrEmpty(strItemValue)) { strItemValue = FN.GetItemValue(ref oForm, "edtR_TODT"); if (string.IsNullOrEmpty(strItemValue)) oDB_M.SetValue("U_R_TODT", 0, "29991231"); } break; default: break; } } catch (Exception) { throw; } }
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 SetDefultMasterData(SAPbouiCOM.Form oForm) { string strNewCode = string.Empty; try { oDB_M = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); strNewCode = GetNewCode(oForm); oDB_M.SetValue("Code", 0, strNewCode); // HR/KR 관리자 , JH 관리자 = 릴리즈 / HR/KR 콜센터 = 계획 if (oForm.Mode == BoFormMode.fm_ADD_MODE) { // 2014.06.11 사용자 요청으로 상태값 무조건 릴리즈 처리한다. oDB_M.SetValue("U_STATUS", 0, "R"); //if (SO.SO_COMMON_HRD.Authority == SO.SO_COMMON_HRD.AuthorityType.H_Manager || SO.SO_COMMON_HRD.Authority == SO.SO_COMMON_HRD.AuthorityType.J_Manager) // oDB_M.SetValue("U_STATUS", 0, "R"); //else // oDB_M.SetValue("U_STATUS", 0, "P"); oDB_M.SetValue("U_USERSG2", 0, B1Connections.diCompany.UserSignature.ToString()); // 등록자 / 수정자 저장 } gDs.Tables[oForm.UniqueID + "_Deliver"].Rows.Clear(); gDs.Tables[oForm.UniqueID + "_Call"].Rows.Clear(); //gDs.Tables[oForm.UniqueID + "_Deliver"].Rows.Clear(); //gDs.Tables[oForm.UniqueID + "_Call"].Rows.Clear(); } catch (Exception) { throw; } }
private void SetTR(string TYPE) { bool bModify = false; SAPbobsCOM.Recordset oRS = null; oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); 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.FlushToDataSource(); string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString(); strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.p_YYYYMMDD); string Code = string.Empty; string YYYYMM = string.Empty; string sQry = string.Empty; if (SelectRow != -1) { if (TYPE == "TR") { Code = oForm.Items.Item("Code").Specific.value.Trim(); YYYYMM = oDB_1.GetValue("U_YYYYMM", SelectRow).ToString().Trim(); sQry = " EXEC KIS_SP_FI0020B1_HRD '" + YYYYMM + "'"; oRS.DoQuery(sQry); if (oRS.RecordCount == 0) { oDB_1.SetValue("U_UPDATEDT", SelectRow, strNowDate.Replace(".", "")); oDB_1.SetValue("U_STATUS", SelectRow, "Y"); } sQry = "UPDATE [@KIS_FI00201_HRD] SET U_UPDATEDT = '" + strNowDate.Replace(".", "") + "' ,U_STATUS = 'Y' WHERE Code = '" + Code + "' AND U_YYYYMM = '" + YYYYMM + "'"; oRS.DoQuery(sQry); } else { Code = oForm.Items.Item("Code").Specific.value.Trim(); YYYYMM = oDB_1.GetValue("U_YYYYMM", SelectRow).ToString().Trim(); sQry = " DELETE FROM [@KIS_FI0020B1_HRD] WHERE U_YYYYMM = '" + YYYYMM + "'"; sQry = sQry + " DELETE FROM [@KIS_FI0020B2_HRD] WHERE U_YYYYMM = '" + YYYYMM + "'"; oRS.DoQuery(sQry); if (oRS.RecordCount == 0) { oDB_1.SetValue("U_UPDATEDT", SelectRow, ""); oDB_1.SetValue("U_STATUS", SelectRow, "N"); } sQry = "UPDATE [@KIS_FI00201_HRD] SET U_UPDATEDT = NULL ,U_STATUS = 'N' WHERE Code = '" + Code + "' AND U_YYYYMM = '" + YYYYMM + "'"; oRS.DoQuery(sQry); } bModify = true; } if (bModify) { oMatrix.LoadFromDataSource(); SelectRow = -1; } B1Connections.theAppl.StatusBar.SetText("배치가 적용되었습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 } catch (Exception ex) { oForm.Freeze(false); B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oRS = null; } }
private void FindData(SAPbouiCOM.Form oForm) { string strExpr = string.Empty; string strSort = string.Empty; /* 조회조건 */ string strF_DEPT = string.Empty; // 구독부서 string strF_TEL = string.Empty; // 전화번호 string strF_ADDR = string.Empty; // 주소 string strF_CENTER = string.Empty; // 지국(분국) string strF_STATUS = string.Empty; // 상태 System.Data.DataRow[] findRows = null; StringBuilder sb = new StringBuilder(); int i = 0; try { /*조회조건 값 가져오기 */ oUDS = oForm.DataSources.UserDataSources; strF_DEPT = oUDS.Item("edtF_RDEPT").Value; strF_TEL = oUDS.Item("edtF_TEL").Value; strF_ADDR = oUDS.Item("edtF_ADDR").Value; strF_CENTER = oUDS.Item("edtF_CENT").Value; strF_STATUS = oUDS.Item("cboF_STATU").Value; oDB1_Z = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00301Z_HRD"); oDB1_Z.Clear(); sb.Append(" 1 = 1 "); if (!string.IsNullOrEmpty(strF_DEPT)) //구독부서 sb.AppendFormat(" AND RDEPT LIKE '%{0}%' ", strF_DEPT); if (!string.IsNullOrEmpty(strF_TEL)) //전화번호 sb.AppendFormat(" AND TEL LIKE '%{0}%' ", strF_TEL); if (!string.IsNullOrEmpty(strF_ADDR)) //주소 sb.AppendFormat(" AND (ADDR1 LIKE '%{0}%' OR ADDR1_D LIKE '%{0}%' OR ADDR2 LIKE '%{0}%' OR ADDR2_D LIKE '%{0}%' ) ", strF_ADDR); if (!string.IsNullOrEmpty(strF_CENTER)) //지국 sb.AppendFormat(" AND CENTNM LIKE '%{0}%' ", strF_CENTER); if (!string.IsNullOrEmpty(strF_STATUS)) //상태 sb.AppendFormat(" AND STATUS = '{0}' ", strF_STATUS); // 정렬 기준 findRows = gDs.Tables[oForm.UniqueID + "_Deliver"].Select(sb.ToString(), "LINEID ASC"); foreach (System.Data.DataRow dr in findRows) { oDB1_Z.InsertRecord(i); oDB1_Z.SetValue("U_NO", i, (i + 1).ToString()); oDB1_Z.SetValue("U_IDX", i, dr["IDX"].ToString()); //"데이터테이블 고유번호 IDX"; oDB1_Z.SetValue("LineId", i, dr["LineId"].ToString());//"원본라인번호"; oDB1_Z.SetValue("U_DELVCD", i, dr["DELVCD"].ToString()); //"배달코드"; oDB1_Z.SetValue("U_RDEPT", i, dr["RDEPT"].ToString()); //"부서"; oDB1_Z.SetValue("U_PAPERTP", i, dr["PAPERTP"].ToString()); //"지종"; oDB1_Z.SetValue("U_READTP", i, dr["READTP"].ToString()); //"독자구분"; oDB1_Z.SetValue("U_PAYCD", i, dr["PAYCD"].ToString()); //"요금제코드"; oDB1_Z.SetValue("U_PAYNM", i, dr["PAYNM"].ToString()); //"요금제명"; oDB1_Z.SetValue("U_TEL", i, dr["TEL"].ToString()); //"연락처"; oDB1_Z.SetValue("U_MOBILE", i, dr["MOBILE"].ToString()); //"휴대폰"; oDB1_Z.SetValue("U_ADDR1", i, dr["ADDR1"].ToString()); //"주소1"; oDB1_Z.SetValue("U_ADDR2", i, dr["ADDR2"].ToString()); //"주소2"; oDB1_Z.SetValue("U_ADDR1_D", i, dr["ADDR1_D"].ToString()); //"주소1상세"; oDB1_Z.SetValue("U_ADDR2_D", i, dr["ADDR2_D"].ToString()); //"주소2상세"; oDB1_Z.SetValue("U_CENTCD", i, dr["CENTCD"].ToString()); //"지국"; oDB1_Z.SetValue("U_CENTNM", i, dr["CENTNM"].ToString()); //"지국명"; oDB1_Z.SetValue("U_DELVFR", i, FN.SetDateFormatToDB(dr["DELVFR"].ToString(), FN.eDateType.n_YYYYMMDD)); //"배달시작일"; oDB1_Z.SetValue("U_DELVTO", i, FN.SetDateFormatToDB(dr["DELVTO"].ToString(), FN.eDateType.n_YYYYMMDD)); //"배달종료일"; oDB1_Z.SetValue("U_DELVCNT", i, dr["DELVCNT"].ToString()); //"배달부수"; oDB1_Z.SetValue("U_METHOD", i, dr["METHOD"].ToString()); //"가입방법"; oDB1_Z.SetValue("U_SAILCD", i, dr["SAILCD"].ToString()); //"유치자"; oDB1_Z.SetValue("U_SAILNM", i, dr["SAILNM"].ToString()); //"유치자"; oDB1_Z.SetValue("U_SDEPT", i, dr["SDEPT"].ToString()); //"유치부서"; oDB1_Z.SetValue("U_NOTE", i, dr["NOTE"].ToString()); //"배달상세"; oDB1_Z.SetValue("U_STATUS", i, dr["STATUS"].ToString()); //"배달상태"; oDB1_Z.SetValue("U_JOINDT", i, FN.SetDateFormatToDB(dr["JOINDT"].ToString(), FN.eDateType.n_YYYYMMDD)); //"가입일자"; oDB1_Z.SetValue("U_CLOSEDT", i, FN.SetDateFormatToDB(dr["CLOSEDT"].ToString(), FN.eDateType.n_YYYYMMDD)); //"중지일자"; oDB1_Z.SetValue("U_USERSG1", i, dr["USERSG1"].ToString()); //"등록자"; oDB1_Z.SetValue("U_BTEL1", i, dr["BTEL1"].ToString()); //"분국전화1"; oDB1_Z.SetValue("U_BTEL2", i, dr["BTEL2"].ToString()); //"분국전화1"; i += 1; } oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific; oMatrix.LoadFromDataSource(); } catch (Exception) { throw; } finally { findRows = null; } }
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; } } }
public virtual void ET_AFDataMenu_Add(MenuEvent pVal) { oForm = B1Connections.theAppl.Forms.ActiveForm; // ADD YOUR ACTION CODE HERE ... oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0010M_HRD"); oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00101_HRD"); string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString(); strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.p_YYYYMMDD); oDB_M.SetValue("U_DOCDATE", 0, strNowDate.Replace(".", "")); oDB_M.SetValue("U_USERID", 0, B1Connections.theAppl.Company.UserName); oComboBox = oForm.Items.Item("cboYYYY").Specific; oComboBox.Select(FN.Left(strNowDate, 4), BoSearchKey.psk_ByValue); oComboBox = oForm.Items.Item("cboTYPE").Specific; oComboBox.Select(0, BoSearchKey.psk_Index); }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... #region Form Setting oForm.DataBrowser.BrowseBy = "DocEntry"; oForm.SupportedModes = -1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = true; oForm.PaneLevel = 1; #endregion oForm.Mode = BoFormMode.fm_ADD_MODE; oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0010M_HRD"); oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00101_HRD"); string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString(); strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.p_YYYYMMDD); oDB_M.SetValue("U_DOCDATE", 0, strNowDate.Replace(".", "")); oDB_M.SetValue("U_USERID", 0, B1Connections.theAppl.Company.UserName); oComboBox = oForm.Items.Item("cboYYYY").Specific; FN.SetComboBoxValidValues(oForm, " SELECT YEAR AS CODE, YEAR AS NAME FROM OACP ", "cboYYYY", FN.Enum_WholeTp.m_Nothing); oComboBox.Select(FN.Left(strNowDate,4) , BoSearchKey.psk_ByValue); oComboBox = oForm.Items.Item("cboTYPE").Specific; FN.SetComboBoxValidValues(oForm, " SELECT U_SMLCD,U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'FI01' AND U_USEYN = 'Y' ", "cboTYPE", FN.Enum_WholeTp.m_Nothing); oComboBox.Select(0, BoSearchKey.psk_Index); #region EditText // 코스트센터그룹 SAPbouiCOM.Conditions oCons = new Conditions(); FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOSTFR", "Code", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOSTTO", "Code", BoFormItemTypes.it_EDIT, oCons); // 공통비 코스트센터 그룹 FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOMGPCD", "Code", BoFormItemTypes.it_EDIT, oCons); // 원가그룹 FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtDISACCD", "Code", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtCOPECD", "Code", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtCOAMCD", "Code", BoFormItemTypes.it_EDIT, oCons); // 계정코드 #region GLAccounts Conditions oCons = new Conditions(); SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "U_CATEGORY"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "S09"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtCOMPECD", "AcctCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtCOMAMCD", "AcctCode", BoFormItemTypes.it_EDIT, oCons); #endregion #region Matrix oMatrix = oForm.Items.Item("mtx").Specific; oMatrix.SelectionMode = BoMatrixSelect.ms_None; // 메트릭스 FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "mtx", "Code", BoFormItemTypes.it_MATRIX, null, "U_PRCCD"); FN.SetSumField(ref oMatrix, "U_1MON,U_2MON,U_3MON,U_4MON,U_5MON,U_6MON,U_7MON,U_8MON,U_9MON,U_10MON,U_11MON,U_12MON"); //FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oDB_1, FN.RowSelectMode.SelectedLine, "U_PRCCD"); #endregion #region SetAutoManagedAttribute string AllString = "cboYYYY,cboTYPE,edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,edtCOMPECD,edtCOMAMCD,mtx,btnFIND"; string AddString = "cboYYYY,cboTYPE,edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,mtx,btnFIND"; string OKString = "edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,mtx,btnFIND"; string FindString = "cboYYYY,cboTYPE"; FN.SetAutoManagedAttribute(ref oForm, AllString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False); FN.SetAutoManagedAttribute(ref oForm, AddString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True); FN.SetAutoManagedAttribute(ref oForm, OKString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True); FN.SetAutoManagedAttribute(ref oForm, FindString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True); #endregion }
//Carga los datos al data source de la matriz public SAPbouiCOM.DBDataSource LoadMatrixData(Ticket pObjTicket, SAPbouiCOM.DBDataSource pDBDataSourceD, IList <TicketDetail> pLstTicketDetail, string pStrSource) { int i = 0; double lFloQuantity = 0; foreach (TicketDetail lObjTicketDetail in pLstTicketDetail.OrderByDescending(x => x.Line)) { ///LE Importe Pesaje simple if (pObjTicket.CapType == 4) { lFloQuantity = 1; } else { lFloQuantity = lObjTicketDetail.netWeight; } //mObjQueryManager.GetObjectsList< pDBDataSourceD.InsertRecord(i); pDBDataSourceD.SetValue("ItemCode", i, lObjTicketDetail.Item); pDBDataSourceD.SetValue("Dscription", i, mObjTicketServices.SearchItemName(lObjTicketDetail.Item)); pDBDataSourceD.SetValue("Price", i, lObjTicketDetail.Price.ToString()); pDBDataSourceD.SetValue("Weight1", i, lObjTicketDetail.FirstWT.ToString()); pDBDataSourceD.SetValue("Weight2", i, lObjTicketDetail.SecondWT.ToString()); pDBDataSourceD.SetValue("Quantity", i, lFloQuantity.ToString()); pDBDataSourceD.SetValue("LineTotal", i, (lFloQuantity * lObjTicketDetail.Price).ToString()); pDBDataSourceD.SetValue("U_GLO_BagsBales", i, lObjTicketDetail.BagsBales.ToString()); pDBDataSourceD.SetValue("WhsCode", i, lObjTicketDetail.WhsCode.ToString()); pDBDataSourceD.SetValue("FromWhsCod", i, lObjTicketDetail.WhsCode.ToString()); pDBDataSourceD.SetValue("LineNum", i, lObjTicketDetail.BaseLine.ToString()); string lStrLine = GetTableLine(pObjTicket.DocType, pStrSource); string lStrTable = lStrLine.Remove(lStrLine.Length - 1); pDBDataSourceD.SetValue("OpenCreQty", i, mObjTicketServices.GetOpenLine("O" + lStrTable, lStrLine, "OpenCreQty", pObjTicket.Number.ToString(), lObjTicketDetail.BaseLine.ToString())); pDBDataSourceD.SetValue("DelivrdQty", i, mObjTicketServices.GetDeliveryLine("O" + lStrTable, lStrLine, "DelivrdQty", pObjTicket.Number.ToString(), lObjTicketDetail.BaseLine.ToString())); } return(pDBDataSourceD); }
}//fin InitForm public new void FormEvent(String FormUID, ref SAPbouiCOM.ItemEvent pVal, ref Boolean BubbleEvent) { Int32 nErr; String sErr; SAPbouiCOM.DataTable oDataTable; String sValue, sValue1; SAPbouiCOM.IChooseFromListEvent oCFLEvento = null; base.FormEvent(FormUID, ref pVal, ref BubbleEvent); try { if ((pVal.EventType == BoEventTypes.et_ITEM_PRESSED) && (pVal.BeforeAction)) { if ((pVal.ItemUID == "1") && (oForm.Mode == BoFormMode.fm_ADD_MODE)) { //BubbleEvent := ValidarDatosFE(); } } if ((pVal.EventType == BoEventTypes.et_COMBO_SELECT) && (!pVal.BeforeAction) && (pVal.ItemUID == "mtx")) { if (pVal.ColUID == "V_0") { oMtx.FlushToDataSource(); sValue = ((System.String)oDBDSD.GetValue("U_CodeImp", pVal.Row - 1)).Trim(); if (GlobalSettings.RunningUnderSQLServer) { s = @"select Code, Name from OSTA where Code = '{0}' UNION ALL select WTCode 'Code', WTName 'Name' from OWHT where Inactive = 'N' and WTCode = '{0}'"; } else { s = @"select ""Code"", ""Name"" from ""OSTA"" where ""Code"" = '{0}' UNION ALL select ""WTCode"" ""Code"", ""WTName"" ""Name"" from ""OWHT"" where ""Inactive"" = 'N' and ""WTCode"" = '{0}' "; } s = String.Format(s, sValue); oRecordSet.DoQuery(s); if (oRecordSet.RecordCount == 0) { FSBOApp.StatusBar.SetText("No se encuentra Impuesto o Retención: " + sValue, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } else { sValue1 = ((System.String)oRecordSet.Fields.Item("Name").Value).Trim(); oDBDSD.SetValue("U_CodeImp", pVal.Row - 1, sValue); oDBDSD.SetValue("U_Descrip", pVal.Row - 1, sValue1); if (pVal.Row == oMtx.RowCount) { oDBDSD.InsertRecord(pVal.Row); } oMtx.LoadFromDataSource(); oMtx.AutoResizeColumns(); if (oForm.Mode == BoFormMode.fm_OK_MODE) { oForm.Mode = BoFormMode.fm_UPDATE_MODE; } } } } } catch (Exception e) { FCmpny.GetLastError(out nErr, out sErr); FSBOApp.StatusBar.SetText("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); OutLog("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace); } }//fin FormEvent