示例#1
0
 private void pObjMtxRoutes_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
 {
     BubbleEvent = true;
     try
     {
         if (pVal.Row > 0)
         {
             SetRoutes(pVal.Row);
             pObjMtxRoutes.SelectRow(pVal.Row, true, false);
             //pIntCode = (int)(lObjDtRoutes.Columns.Item("Code").Cells.Item(pVal.Row - 1).Value);
             //pIntRow = pVal.Row;
         }
         else
         {
             pRoutes = null;
             //pIntCode = 0;
             //pIntRow = 0;
         }
     }
     catch (Exception ex)
     {
         LogService.WriteError(ex.Message);
         LogService.WriteError(ex);
         UIApplication.ShowMessageBox(ex.Message);
     }
 }
示例#2
0
        // Export button pressed
        void _btnExport_PressedAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            try
            {
                if (_txtPath.Value.Length < 1)
                {
                    eCommon.SBO_Application.StatusBar.SetText("Invalid Path to save.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    return;
                }

                int[] SelectedRows = eCommon.DataTableIndexOf(_dt_grid_Trans, "Checked", "Y");
                if (SelectedRows == null)
                {
                    eCommon.SBO_Application.StatusBar.SetText("No Transactions selected.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                }
                else
                {
                    String str_directory = Environment.CurrentDirectory.ToString();
                    String parent        = System.IO.Directory.GetParent(System.IO.Directory.GetParent(System.IO.Directory.GetParent(str_directory).FullName).FullName).FullName;
                    exportXML(SelectedRows);
                }
            }
            catch (Exception ex)
            {
                eCommon.SBO_Application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
        }
示例#3
0
        private void Button0_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;


            oUserTable = oCompany.UserTables.Item("SECCIONESCOL");
            //hago un getbykey para obtener el valor key necesario para actualizar los datos
            if (oUserTable.GetByKey(EditText0.Value.ToString()))
            {
                // oUserTable.UserFields.Fields.Item("U_CodigoEDC").Value = EditText0.Value.ToString();
                oUserTable.UserFields.Fields.Item("U_NombreSEC").Value = EditText1.Value.ToString();
            }
            oUserTable.UserFields.Fields.Item("U_SupraSeccionSEC").Value = EditText2.Value.ToString();
            oUserTable.UserFields.Fields.Item("U_PrecioSEC").Value       = EditText4.Value.ToString();


            //oUserTable.Update();


            int i = oUserTable.Update();

            //oApp.SetStatusBarMessage("valor"+ i);
            if (i != 0)
            {
                oApp.SetStatusBarMessage("Error en la actualización: " + oCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, false);
            }
            else
            {
                oApp.SetStatusBarMessage("Exito en la actualizacón", SAPbouiCOM.BoMessageTime.bmt_Medium, false);
                //oForm = oApp.Forms.Item("fmacted");
                //oForm.Close();
            }
        }
        private void Button0_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;

            oUserTable      = oCompany.UserTables.Item("SECCIONESCOL");
            oUserTable.Code = EditText0.Value.ToString();
            oUserTable.Name = EditText0.Value.ToString();
            oUserTable.UserFields.Fields.Item("U_CodigoSEC").Value       = EditText0.Value.ToString();
            oUserTable.UserFields.Fields.Item("U_NombreSEC").Value       = EditText1.Value.ToString();
            oUserTable.UserFields.Fields.Item("U_SupraSeccionSEC").Value = EditText3.Value.ToString();
            oUserTable.UserFields.Fields.Item("U_PrecioSEC").Value       = EditText2.Value.ToString();
            oUserTable.UserFields.Fields.Item("U_ProyectoSEC").Value     = "";
            //oUserTable.Add();

            int i = oUserTable.Add();


            if (i != 0)
            {
                oApp.SetStatusBarMessage("Error" + oCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, false);
            }
            else
            {
                oApp.SetStatusBarMessage("Exito en la inserción", SAPbouiCOM.BoMessageTime.bmt_Medium, false);
                oForm = oApp.Forms.Item("creasecc");
                oForm.Close();
            }
        }
        private void Button1_ClickAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            try
            {
                if (CheckBox0.Checked)
                {
                    oUDS = oForm.DataSources.UserDataSources.Item("UD_0X");

                    SAPbouiCOM.Form oFormP = Application.SBO_Application.Forms.Item(oUDS.ValueEx);
                    oForm.Close();

                    ((SAPbouiCOM.EditText)oFormP.Items.Item("Item_2").Specific).String  = "AJUSTE";
                    ((SAPbouiCOM.EditText)oFormP.Items.Item("Item_10").Specific).String = "AJUSTE";
                }
                else
                if (Grid0.Rows.SelectedRows.Count > 0)
                {
                    oUDS = oForm.DataSources.UserDataSources.Item("UD_0X");
                    string sRut    = Convert.ToString(Grid0.DataTable.GetValue(0, Grid0.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder)));
                    string sNombre = Convert.ToString(Grid0.DataTable.GetValue(1, Grid0.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder)));

                    SAPbouiCOM.Form oFormP = Application.SBO_Application.Forms.Item(oUDS.ValueEx);
                    oForm.Close();

                    ((SAPbouiCOM.EditText)oFormP.Items.Item("Item_2").Specific).String  = sRut;
                    ((SAPbouiCOM.EditText)oFormP.Items.Item("Item_10").Specific).String = sNombre;
                }
            }
            catch (Exception)
            {
            }
        }
示例#6
0
        private void btnRemove_ClickAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            try
            {
                if (gvBatches.Rows.Count > 0)
                {
                    var selectedRows      = gvSelectedBatches.Rows.SelectedRows.Cast <dynamic>();
                    int selectedRow       = selectedRows.FirstOrDefault();
                    var selectedBatchName = dtSelected.GetValue("Batch", selectedRow);
                    var selectedQuantity  = Convert.ToDouble(dtSelected.GetValue("Selected Qty", selectedRow));
                    var totalNeeded       = Convert.ToDouble(dtDocuments.GetValue("TotalNeeded", currentDocumentIndex));

                    for (int i = 0; i < dtBatches.Rows.Count; i++)
                    {
                        if (dtBatches.GetValue("DistNumber", i).ToString() == dtSelected.GetValue("Batch", selectedRow).ToString())
                        {
                            var batchQuantity = Convert.ToDouble(dtBatches.GetValue("Quantity", i));
                            dtBatches.SetValue("Quantity", i, batchQuantity + selectedQuantity);
                            dtDocuments.SetValue("TotalNeeded", currentDocumentIndex, selectedQuantity + totalNeeded);
                            dtSelected.Rows.Remove(selectedRow);
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
示例#7
0
 public static void OnAfterFormResize(SAPbouiCOM.SBOItemEventArg pVal)
 {
     SAPbouiCOM.Form oForm = eCommon.SBO_Application.Forms.Item(pVal.FormUID);
     if (oForm.Items.Count > 0)
     {
     }
 }
示例#8
0
        //Delete Button
        private void Button3_PressedAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            SAPbobsCOM.GeneralService    oGeneralService = null;
            SAPbobsCOM.GeneralDataParams oGeneralParams  = null;
            SAPbobsCOM.CompanyService    sCmp            = null;
            try
            {
                if (Grid0.Rows.SelectedRows.Count == 1)
                {
                    if (oApp.MessageBox("Are you sure you want to delete this record ?", 2, "Yes", "No") == 1)
                    {
                        int    DocEntry = 0;
                        string t        = Grid0.DataTable.GetValue("Document Number", Grid0.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder)).ToString();
                        int.TryParse(t, out DocEntry);

                        sCmp            = oCompany.GetCompanyService();
                        oGeneralService = sCmp.GetGeneralService("BILLVP");
                        oGeneralParams  = (SAPbobsCOM.GeneralDataParams)oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams);
                        oGeneralParams.SetProperty("DocEntry", DocEntry);
                        oGeneralService.Delete(oGeneralParams);
                        oApp.SetStatusBarMessage("Delete Complete", SAPbouiCOM.BoMessageTime.bmt_Medium, false);
                        Load_Grid_Period(EditText0.Value, ComboBox0.Selected.Value);
                    }
                }
                else
                {
                    oApp.MessageBox("Please select record !");
                }
            }
            catch (Exception ex)
            {
                oApp.MessageBox(ex.Message);
            }
        }
示例#9
0
 //Show All
 private void OptionBtn3_PressedAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
 {
     if (OptionBtn3.Selected)
     {
         Load_Grid_HDList_All();
     }
 }
示例#10
0
        // on button next check which rows are checked, and proceed to pane 2
        void _btnNext_PressedAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            try
            {
                //listofDocEntries = new List<String>();
                //for (int i = 1; i <= _mat_CST.RowCount; i++)
                //{
                //    SAPbouiCOM.CheckBox check = (SAPbouiCOM.CheckBox)_mat_CST.Columns.Item("colCHK").Cells.Item(i).Specific;
                //    SAPbouiCOM.EditText oEditText = (SAPbouiCOM.EditText)_mat_CST.Columns.Item("colDOCET").Cells.Item(i).Specific;
                //    if (check.Checked)
                //        listofDocEntries.Add(oEditText.Value);
                //}
                _mat_CST.FlushToDataSource();
                int[] SelectedRows = eCommon.DataTableIndexOf(_dt_CST, "Check", "Y");

                if (SelectedRows == null || SelectedRows.Length < 1)
                {
                    eCommon.SBO_Application.StatusBar.SetText("No SO selected", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                }
                else
                {
                    changePane(2);
                }
            }
            catch (Exception Ex) { eCommon.SBO_Application.StatusBar.SetText(Ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); }
        }
        private void Button0_ClickAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            try
            {
                string sql = "";
                if (EditText0.Value.Trim().Length > 0)
                {
                    oUDS = oForm.DataSources.UserDataSources.Item("UD_1");
                    if (CheckBox0.Checked)
                    {
                        sql = @"select Project as 'Proyecto', DocNum as 'Numero Pedido', CardName as 'Cliente Final', CreateDate as 'Fecha Creacion'
                                    from ORDR 
                                    where Series = 27 and ( DocNum = " + EditText0.Value.Trim() + " or Project = '" + EditText0.Value.Trim() + @"')  
                                    order by Project, CreateDate";
                    }
                    else
                    {
                        sql = @"select Project as 'Proyecto', DocNum as 'Numero Pedido', CardName as 'Cliente Final', CreateDate as 'Fecha Creacion'
                                    from ORDR 
                                    where Series = 27 and SlpCode = " + oUDS.ValueEx + " and ( DocNum = " + EditText0.Value.Trim() + " or Project = '" + EditText0.Value.Trim() + @"')  
                                    order by Project, CreateDate";
                    }

                    DT_SQL.ExecuteQuery(sql);
                    DT_PCV.CopyFrom(DT_SQL);

                    Grid0.Columns.Item(2).Width = 200;

                    Ultima_Busqueda = EditText0.Value.Trim();
                }
                else
                {
                    oUDS = oForm.DataSources.UserDataSources.Item("UD_1");
                    if (CheckBox0.Checked)
                    {
                        sql = @"select Project as 'Proyecto', DocNum as 'Numero Pedido', CardName as 'Cliente Final', CreateDate as 'Fecha Creacion'
                                    from ORDR 
                                    where Series = 27 
                                    order by Project, CreateDate";
                    }
                    else
                    {
                        sql = @"select Project as 'Proyecto', DocNum as 'Numero Pedido', CardName as 'Cliente Final', CreateDate as 'Fecha Creacion'
                                    from ORDR 
                                    where Series = 27 and SlpCode = " + oUDS.ValueEx + @"
                                    order by Project, CreateDate";
                    }

                    DT_SQL.ExecuteQuery(sql);
                    DT_PCV.CopyFrom(DT_SQL);

                    Grid0.Columns.Item(2).Width = 200;

                    Ultima_Busqueda = "°#TODOS LOS REGISTROS#°";
                }
            }
            catch (Exception)
            {
            }
        }
 //BOTON IMPORTAR ANEXOS DESDE DOCUMENTOS BASE
 private void Button0_ClickAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
 {
     if (Button0.Item.Enabled)
     {
         Importar_Anexos_Desde_Origen();
     }
 }
 public void btnAddRow_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
 {
     BubbleEvent = true;
     if (fldrItems.Selected == true)
     {
         if (mtxItems.IsMatrixCellsNotEmpty("to_Item", "ToWhs", "rec_Item", "Quantity", "FromWhs", "AvgPrice"))
         {
             mtxItems.AddLine();
         }
         else
         {
             Application.SBO_Application.MessageBox("Please fill in all the row cells.");
         }
     }
     else
     {
         if (mtxCost.IsMatrixCellsNotEmpty("Code", "Type", "Cost"))
         {
             mtxCost.AddLine();
         }
         else
         {
             Application.SBO_Application.MessageBox("Please fill in all the row cells.");
         }
     }
 }
        public void mtxItems_ValidateBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            if (pVal.ColUID.Equals("Quantity"))
            {
                decimal quantityValue = decimal.MinValue;
                var     whsCode       = mtxItems.GetCellValue("FromWhs", pVal.Row).ToString();
                var     itemCode      = mtxItems.GetCellValue("to_Item", pVal.Row).ToString();
                var     quantity      = mtxItems.GetCellValue("Quantity", pVal.Row);
                if (!quantity.Equals(string.Empty))
                {
                    quantityValue = Convert.ToDecimal(quantity);
                }

                var whsInfo = B1Helper.GetWhsItemInfo(itemCode, whsCode);
                if (quantityValue + GetSelectedItemQuantity(itemCode, whsCode, pVal.Row) > whsInfo.AvailableValue)
                {
                    Application.SBO_Application.MessageBox("The quantity in stock is not enough.");
                    BubbleEvent = false;
                }
                else
                {
                    BubbleEvent = true;
                }
            }
            else
            {
                BubbleEvent = true;
            }
        }
示例#15
0
 void _grid_Vendor_PressedAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
 {
     if (pVal.ColUID == "Checked")
     {
         updateFields();
     }
 }
示例#16
0
        private void Button4_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            if (Grid0.Rows.SelectedRows.Count > 0)   //VERIFICA QUE EXISTA UN ROW SELECCIONADO
            {
                int    nSelecRow  = (Grid0.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder));
                String sValorGrid = Convert.ToString(Grid0.DataTable.GetValue("CÓDIGO", nSelecRow));
                oUserTable = oCompany.UserTables.Item("SECCIONESCOL");
                if (oUserTable.GetByKey(sValorGrid))
                {
                    int i = oUserTable.Remove();


                    if (i != 0)
                    {
                        oApp.SetStatusBarMessage("Error al eliminar : " + oCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, false);
                    }
                    else
                    {
                        oApp.SetStatusBarMessage("Edición Eliminada", SAPbouiCOM.BoMessageTime.bmt_Medium, false);
                        //oForm = oApp.Forms.Item("fmacted");
                        //oForm.Close();
                        //presiono el boton refrescar
                        Button3_ClickBefore(sboObject, pVal, out BubbleEvent);
                    }
                }
            }
            else
            {
                oApp.SetStatusBarMessage("Error, no has seleccionado una fila", SAPbouiCOM.BoMessageTime.bmt_Medium, false);
            }
        }
示例#17
0
        // Search and highlight rows
        void _txtSrchPO_KeyDownAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            if (_txtSrchPO.Value.Length > 0)
            {
                try
                {
                    _oForm.Freeze(true);
                    int[] selectedRows = twmKDS_CRINV.DataTableIndexOf(_dt_VendorMatrix, "NUMATCARD", _txtSrchPO.String);

                    //to select multiple rows on search
                    _mat_Vendor.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Auto;
                    if (selectedRows != null)
                    {
                        for (int i = 0; i < selectedRows.Length; i++)
                        {
                            _mat_Vendor.SelectRow(selectedRows[i] + 1, true, true);
                        }
                        eCommon.SBO_Application.StatusBar.SetText(selectedRows.Length + " match(es) for search", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success);
                    }
                    else
                    {
                        eCommon.SBO_Application.StatusBar.SetText("No Match", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    }

                    _oForm.Freeze(false);
                }
                catch (Exception Ex) { eCommon.SBO_Application.StatusBar.SetText(Ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); }
            }
        }
示例#18
0
        private void Button0_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            crea_secc crear_form = new crea_secc();

            crear_form.Show();
        }
示例#19
0
 private void gvRecBatches_KeyDownAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
 {
     if (dtRecBatches.Rows.Count == pVal.Row + 1)
     {
         gvRecBatches.AddLine();
     }
 }
示例#20
0
 private void mObjMtx_ClickAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
 {
     if (pVal.Row > 0)
     {
         mObjMtx.SelectRow(pVal.Row, true, false);
     }
 }
示例#21
0
        private void btnSearch_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;

            try
            {
                mObjFrmFolios = new frmCFLFolios(FoliosFormModeEnum.StockTransfer);
                mObjFrmFolios.Show();
            }
            catch (Exception lObjException)
            {
                LogUtility.WriteError(string.Format("[frmStockTransfer - btnSearch_ClickBefore] Error: {0}", lObjException.Message));

                if (lObjException.Message.Contains("Failed to create form. Please check the form attributes"))
                {
                    if (Application.SBO_Application.MessageBox("La pantalla de folios ya se encuentra abierta, ¿desea cerrar la actual?", 1, "Aceptar", "Cancelar", "") == 1)
                    {
                        UIApplication.GetApplication().Forms.Item("frmFolios").Close();

                        mObjFrmFolios = new frmCFLFolios(FoliosFormModeEnum.StockTransfer);
                        mObjFrmFolios.Show();
                    }
                }
                else
                {
                    UIApplication.ShowMessageBox(string.Format("Error al abrir la pantalla de folios: {0}", lObjException.Message));
                }
            }
        }
示例#22
0
        //Reject Button
        private void Button1_PressedAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            if (DocEntry_ODRF > 0)
            {
                SAPbobsCOM.ApprovalRequestsService oApprovalRequestsService = (SAPbobsCOM.ApprovalRequestsService)oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.ApprovalRequestsService);
                SAPbobsCOM.ApprovalRequestsParams  oApprovalRequestsParams  = (SAPbobsCOM.ApprovalRequestsParams)oApprovalRequestsService.GetDataInterface(SAPbobsCOM.ApprovalRequestsServiceDataInterfaces.arsApprovalRequestsParams);
                SAPbobsCOM.ApprovalRequest         oApprovalRequest         = (SAPbobsCOM.ApprovalRequest)oApprovalRequestsService.GetDataInterface(SAPbobsCOM.ApprovalRequestsServiceDataInterfaces.arsApprovalRequest);
                SAPbobsCOM.ApprovalRequestParams   oApprovalRequestParams   = (SAPbobsCOM.ApprovalRequestParams)oApprovalRequestsService.GetDataInterface(SAPbobsCOM.ApprovalRequestsServiceDataInterfaces.arsApprovalRequestParams);

                oApprovalRequestParams.Code = WddCode;
                //oApprovalRequestsParams = oApprovalRequestsService.GetAllApprovalRequestsList();
                //oApprovalRequestParams = oApprovalRequestsParams.Item(oApprovalRequestsParams.Count - 1);

                //Approve request
                oApprovalRequest = oApprovalRequestsService.GetApprovalRequest(oApprovalRequestParams);
                oApprovalRequest.ApprovalRequestDecisions.Add();
                oApprovalRequest.ApprovalRequestDecisions.Item(0).Remarks = EditText0.Value;
                oApprovalRequest.ApprovalRequestDecisions.Item(0).Status  = SAPbobsCOM.BoApprovalRequestDecisionEnum.ardNotApproved;
                try
                {
                    oApprovalRequestsService.UpdateRequest(oApprovalRequest);
                    oApp.MessageBox("Từ chối phê duyệt thành công");
                }
                catch (Exception ex)
                {
                    oApp.MessageBox(ex.Message);
                }
            }
        }
示例#23
0
 private void EditText1_KeyDownAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
 {
     if (pVal.CharPressed == 13)
     {
         LoadMatrixPeticiones();
     }
 }
示例#24
0
        private void Form_ResizeAfter(SAPbouiCOM.SBOItemEventArg pVal)
        {
            int new_heigt = this.UIAPIRawForm.ClientHeight;
            int new_width = this.UIAPIRawForm.ClientWidth;

            //Resize List JV
            Grid0.Item.Width  = 400;
            Grid0.Item.Height = new_heigt - 40;
            //Resize List Apprv
            Grid1.Item.Left   = 422;
            Grid1.Item.Height = 130;

            //Resize List Infor
            Grid2.Item.Left = 422;

            //Resize Button
            Button0.Item.Top  = new_heigt - 40;
            Button0.Item.Left = 422;
            Button1.Item.Top  = new_heigt - 40;
            Button1.Item.Left = 588;

            //Resize option button
            OptionBtn1.Item.Left = OptionBtn0.Item.Left + OptionBtn0.Item.Width + 10;
            OptionBtn2.Item.Left = OptionBtn1.Item.Left + OptionBtn1.Item.Width + 10;
            OptionBtn3.Item.Left = OptionBtn2.Item.Left + OptionBtn2.Item.Width + 10;
        }
示例#25
0
        private void Button2_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            //oApp = (SAPbouiCOM.Application)Application.SBO_Application;
            //oCompany = (SAPbobsCOM.Company)oApp.Company.GetDICompany();

            oUserTable      = oCompany.UserTables.Item("EDICIONESCOL");
            oUserTable.Code = EditText4.Value.ToString();
            oUserTable.Name = EditText4.Value.ToString();
            oUserTable.UserFields.Fields.Item("U_CodigoEDC").Value   = EditText4.Value.ToString();
            oUserTable.UserFields.Fields.Item("U_NombreEDC").Value   = EditText7.Value.ToString();
            oUserTable.UserFields.Fields.Item("U_ProyectoEDC").Value = EditText5.Value.ToString();
            //oUserTable.Add();

            int i = oUserTable.Add();


            if (i != 0)
            {
                oApp.SetStatusBarMessage("Error" + oCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, false);
            }
            else
            {
                oApp.SetStatusBarMessage("Exito en la inserción", SAPbouiCOM.BoMessageTime.bmt_Medium, false);
                oForm = oApp.Forms.Item("fmcred");
                oForm.Close();
            }
        }
示例#26
0
        private void Button0_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            AddUserView form2 = new AddUserView(UserController, this);

            form2.Show();
        }
示例#27
0
        private void txtNo_LostFocusAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            try
            {
                if (txtNo.Value != "")
                {
                    int lIntValidInt = Convert.ToInt32(txtNo.Value.ToString());
                    Check_txtNo(lIntValidInt);
                }
            }
            catch (Exception ex)
            {
                switch (ex.HResult)
                {
                case -2146233066:
                case -2146233033:
                    Application.SBO_Application.StatusBar.SetText("No. de Quincena Invalida. " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    txtNo.Value = "";
                    break;

                default:
                    Application.SBO_Application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    break;
                }
            }
        }
示例#28
0
        /// <summary>
        /// Loads the available bank accounts in the comoboxes.
        /// </summary>

        private void cboAuctions_ComboSelectAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            try
            {
                if (!string.IsNullOrEmpty(CboAuctions.Value))
                {
                    mObjLastAuction = mAuctionDAO.GetAuctionByFolio(CboAuctions.Value);

                    if (mObjLastAuction != null)
                    {
                        LoadSellers(mObjLastAuction.Folio);
                        mEdtFolio.Value        = mObjLastAuction.Folio;
                        lObjBtnCC.Item.Enabled = true;
                    }
                    else
                    {
                        UIApplication.ShowError("No hay subastas activas.");
                    }
                }
            }
            catch (Exception ex)
            {
                LogUtility.WriteError(string.Format("[CheckGeneration - cboAuctions_ComboSelectAfter] Error: {0}", ex.Message));
                UIApplication.ShowMessageBox(ex.Message);
                //UIApplication.ShowError("frm (LoadMatrix)" + ex.Message);
            }
            finally
            {
                this.UIAPIRawForm.Freeze(false);
            }
        }
        private void Button0_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;

            mObjFrmFolios = new frmCFLFolios();
            mObjFrmFolios.Show();
        }
        private void Button1_ClickAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            if (Grid0.Rows.SelectedRows.Count > 0)
            {
                oUDS = oForm.DataSources.UserDataSources.Item("UD_0");
                int      nRow  = Grid0.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder);
                string[] sVend = new string[2];
                sVend[0] = Convert.ToString(Grid0.DataTable.GetValue(0, nRow));
                sVend[1] = "(" + Convert.ToString(Grid0.DataTable.GetValue(1, nRow)) + ") - "
                           + Convert.ToString(Grid0.DataTable.GetValue(2, nRow));
                SAPbouiCOM.Form oFormP = Application.SBO_Application.Forms.Item(oUDS.ValueEx);
                oForm.Close();

                switch (sOrigf)
                {
                case "Pagos":
                    Comisiones.Asigna_Vendedor_Grid_Pagos(sVend[0]);
                    break;

                case "Premios":
                    Comisiones.Asigna_Vendedor_Grid_Premios(sVend[0]);
                    break;

                case "ComisionesA":
                case "ComisionesR":
                    Comisiones.Agregar_Vendedor_Comisiones_Periodo(sVend);
                    break;
                }
            }
        }