private void InitialiseProjects()
        {
            try
            {
                List <Project>            inboundProjects = _userClient.GetProjectsForUser(((User)Application.Current.Properties["user"]).Id);
                List <ProjectPermissions> projectList     = new List <ProjectPermissions>();

                foreach (Project project in inboundProjects)
                {
                    projectList.Add(new ProjectPermissions(project, (User)Application.Current.Properties["user"]));
                }

                ProjectList = projectList;
            }
            catch (RestResponseErrorException ex)
            {
                if (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
                {
                    MessageBoxUtil.ShowInfoBox(ex.Message);
                }
                else
                {
                    MessageBoxUtil.ShowErrorBox(ex.Message);
                }
            }
        }
Exemple #2
0
        public void BeamSyncSuccessful()
        {
            // TODO: Is there really no way to programmatically select multiple slides at once?
            // TODO: Ideally, I want to select the slides 5,6,7,8 together and apply Synchronize Agenda on them

            ClickOnSlideThumbnailsPanel();
            PpOperations.SelectSlide(5);
            MessageBoxUtil.ExpectMessageBoxWillPopUp(
                "Reorganise Sidebar",
                "The sections have been changed. Do you wish to reorganise the items in the sidebar?",
                PplFeatures.SynchronizeAgenda,
                "&Yes");

            PpOperations.SelectSlide(6);
            PplFeatures.SynchronizeAgenda();

            ClickOnSlideThumbnailsPanel();
            PpOperations.SelectSlide(8);
            PplFeatures.SynchronizeAgenda();

            List <TestInterface.ISlideData> actualSlides   = PpOperations.FetchCurrentPresentationData();
            List <TestInterface.ISlideData> expectedSlides = PpOperations.FetchPresentationData(
                PathUtil.GetDocTestPresentationPath("AgendaLab\\AgendaSlidesBeamAfterSync.pptx"));

            PresentationUtil.AssertEqual(expectedSlides, actualSlides);
        }
Exemple #3
0
        //保存明细
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            decimal ID     = decimal.Parse(gridViewBillAppList.GetFocusedDataRow()["ID"].ToString());
            decimal seq    = gridView1.FocusedRowHandle + 1;
            decimal mat_id = Convert.ToDecimal(gridViewPopupMaterial.GetFocusedDataRow()["ID"]);

            if (gridView1.GetFocusedRowCellValue(gridColumnMaterialAppNum).Equals(DBNull.Value))
            {
                MessageBoxUtil.ShowWarning("入库数量不可为空");
                return;
            }
            decimal app_num  = Convert.ToDecimal(gridView1.GetFocusedRowCellValue(gridColumnMaterialAppNum));
            decimal send_num = 0;
            decimal buy_num  = 0;
            decimal mat_seq  = Convert.ToDecimal(gridViewPopupStock.GetFocusedDataRow()["MAT_SEQ"]);
            string  remark   = gridView1.GetFocusedRowCellValue(gridColumnMaterialRemark).ToString();

            if (billAppMain.insertBappDetail(ID, seq, mat_id, app_num, send_num, remark, mat_seq))
            {
                MessageBoxUtil.ShowInformation("保存明细成功");
                getDetail();
            }
            else
            {
                MessageBoxUtil.ShowWarning("保存明细失败");
            }
        }
Exemple #4
0
        private Boolean ValidarInputs()
        {
            string errores = "";

            // Validacion tipo tarjeta
            if (cmbTipoTarjeta.SelectedItem == null)
            {
                errores += "El tipo de tarjeta es obligatorio\n";
            }

            // Validacion código tarjeta
            if (inputCodigo.Text == "")
            {
                errores += "El código de tarjeta es obligatorio\n";
            }

            if (errores != "")
            {
                MessageBoxUtil.ShowError(errores);
                return(false);
            }
            else
            {
                return(true);
            }
        }
Exemple #5
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            if (cmbModificacion.SelectedItem == null)
            {
                MessageBoxUtil.ShowError("Seleccione un grado de publicación.");
            }
            else
            {
                if (txtDescripcion.Text == "")
                {
                    MessageBoxUtil.ShowInfo("Complete el campo descripcion.");
                }
                else
                {
                    try
                    {
                        decimal            idGradoSeleccionado = ((ComboBoxItem <decimal>)cmbModificacion.SelectedItem).Value;
                        GradoDePublicacion grado = new GradoDePublicacion(idGradoSeleccionado, txtDescripcion.Text, nudPorcentaje.Value);
                        gradoRepository.ModificarGradoDePublicacion(grado);

                        MessageBoxUtil.ShowInfo("Grado de publicación modificado correctamente.");
                        NavigableFormUtil.BackwardTo(this, callerForm);
                    }
                    catch (StoredProcedureException ex)
                    {
                        MessageBoxUtil.ShowError(ex.Message);
                    }
                }
            }
        }
        private void Button_ProvisioningDoProvision_Click(object sender, EventArgs e)
        {
            if (this.checkBox_ProvisioningSendWelcomeEmail.Checked == false)
            {
                MessageBoxUtil.ShowInfo(this, ErrorMessages.NO_TEAM_JOIN_EMAIL);
            }
            Control checkedButton = tableLayoutPanel_ProvisioningRolesSelectionGroup.Controls.OfType <RadioButton>().FirstOrDefault(r => r.Checked);

            switch (checkedButton.Name)
            {
            case "radioButton_ProvisioningRoleTeamAdmin":
                SelectedRole = "team_admin";
                break;

            case "radioButton_ProvisioningRoleUserMgmtAdmin":
                SelectedRole = "user_management_admin";
                break;

            case "radioButton_ProvisioningRoleSupportAdmin":
                SelectedRole = "support_admin";
                break;

            case "radioButton_ProvisioningRoleMemberOnly":
            default:
                SelectedRole = "member_only";
                break;
            }
            InvokeDataChanged(sender, e);
            if (CommandProvision != null)
            {
                CommandProvision(sender, e);
            }
        }
Exemple #7
0
 private void NoAgendaRemoveUnsuccessful()
 {
     MessageBoxUtil.ExpectMessageBoxWillPopUp(
         "Unable to execute action",
         "There is no generated agenda.",
         PplFeatures.RemoveAgenda);
 }
Exemple #8
0
        private void ImageEditForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (_canvas.CanUndo)
            {
                var result = MessageBoxUtil.ConfirmYesNoCancel(Resource.GetString(Key.CloseOrSaveConfirmMsg));
                if (result == DialogResult.Cancel)
                {
                    e.Cancel = true;
                    return;
                }

                if (result == DialogResult.Yes)
                {
                    try
                    {
                        byte[] data = _canvas.GetImageData();
                        if (data == null)
                        {
                            return;
                        }

                        File.WriteAllBytes(_filePath, data);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex);
                    }
                }
            }

            CaptureSetting.Save();
        }
Exemple #9
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (TextBoxAreValids())
            {
                var passwordHash = ComputeSha256Hash(txtPassword.Text);
                var user         = userService.GetAll()
                                   .Where(u => u.UserName == txtUserName.Text &&
                                          u.UserPassword == passwordHash)
                                   .ProjectTo <UserViewModel>(mapper.ConfigurationProvider)
                                   .FirstOrDefault();


                if (user != null)
                {
                    Program.CurrentUser = user;
                    var masterPage = Program.Container.GetInstance <MasterPage>();
                    this.Hide();
                    masterPage.Show();
                }
                else
                {
                    MessageBoxUtil.MessageError(this, AlertMessages.INCORRECT_USER_PASSWORD);
                }
            }
        }
        private void btnModificar_Click(object sender, EventArgs e)
        {
            if (CamposRequeridosNoVacios())
            {
                try
                {
                    new RepositorioProveedores().Modificar(
                        idProveedor,
                        checkboxHabilitado.Checked,
                        inputRazonSocial.Text,
                        inputTelefono.Text,
                        inputEmail.Text,
                        inputDireccion.Text,
                        inputPiso.Text,
                        inputDepartamento.Text,
                        inputLocalidad.Text,
                        inputCodigoPostal.Text,
                        inputCuit.Text,
                        inputCiudad.Text,
                        inputRubro.Text,
                        inputNombreContacto.Text
                        );

                    previousForm.RefrescarBusqueda();
                    MessageBoxUtil.ShowInfo("Proveedor modificado con exito");
                }
                catch (SqlException ex)
                {
                    MessageBoxUtil.ShowError(ex.Message);
                }
            }
        }
Exemple #11
0
 /// <summary>
 /// 登录仓库控制
 /// </summary>
 public void ChooseStorage(string Code)
 {
     ServiceReference1.Service1Client TClient = new BookUI.ServiceReference1.Service1Client();
     if (TClient.GetPower(Code) == "999")
     {
         barButtonItem8.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
         barButtonItem9.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
     }
     else if (TClient.GetPower(Code) == "1")
     {
         barButtonItem8.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
         barButtonItem9.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
     }
     else if (TClient.GetPower(Code) == "2")
     {
         barButtonItem8.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
         barButtonItem9.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
     }
     else
     {
         barButtonItem8.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
         barButtonItem9.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
         MessageBoxUtil.ShowError("当前账户信息有误");
     }
 }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (this.ValidarInputs())
            {
                double precioOferta, precioLista;
                double.TryParse(inputPrecioOferta.Text, out precioOferta);
                double.TryParse(inputPrecioLista.Text, out precioLista);

                try
                {
                    new RepositorioOfertas().Guardar(
                        dateTimePickerFechaPublicacion.Value,
                        dateTimePickerFechaVencimiento.Value,
                        precioOferta,
                        precioLista,
                        Int32.Parse(inputStockDisponible.Text),
                        Int32.Parse(inputMaxUnidadesPorCliente.Text),
                        inputCodigo.Text,
                        inputDescripcion.Text,
                        idProveedor
                        );

                    MessageBoxUtil.ShowInfo("La oferta fue guardada exitosamente");
                    NavigableFormUtil.BackwardTo(this, previousForm);
                }
                catch (SqlException ex)
                {
                    MessageBoxUtil.ShowError(ex.Message);
                }
            }
        }
Exemple #13
0
        public ProjectDashboard(Project currentProject)
        {
            InitializeComponent();
            CurrentPage = this.Title;
            DataContext = this;

            _projectClient = new ProjectClient();
            _userClient    = new UserClient();

            Permissions = new Permissions((User)Application.Current.Properties["user"], currentProject);

            CurrentProject = currentProject;
            _projects      = _userClient.GetProjectsForUser(((User)Application.Current.Properties["user"]).Id);
            ProjectDropDownButton.Content = currentProject.Name;
            AddProjectsToDropdownList();

            try
            {
                TeamMembers = new ObservableCollection <User>(_projectClient.GetProjectTeam(currentProject.Id));
            }
            catch (RestResponseErrorException ex)
            {
                MessageBoxUtil.ShowErrorBox(ex.Message);
            }
        }
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (CamposRequeridosNoVacios())
            {
                try
                {
                    new RepositorioProveedores().Guardar(
                        inputRazonSocial.Text,
                        inputTelefono.Text,
                        inputMail.Text,
                        inputDireccion.Text,
                        inputPiso.Text,
                        inputDepartamento.Text,
                        inputLocalidad.Text,
                        inputCodigoPostal.Text,
                        inputCuit.Text,
                        inputCiudad.Text,
                        inputRubro.Text,
                        inputNombreDeContacto.Text
                        );

                    MessageBoxUtil.ShowInfo("Proveedor generado con exito");
                }
                catch (SqlException ex)
                {
                    MessageBoxUtil.ShowError(ex.Message);
                }
            }
        }
Exemple #15
0
        //审核
        private void barButtonItemAudit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            decimal ID = decimal.Parse(gridViewBillOutList.GetFocusedDataRow()["ID"].ToString());
            string  state;

            if (XtraMessageBox.Show("是否通过审核", "提示", MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
            {
                state = "3";
                if (billOutMain.examineState(ID, state))
                {
                    GetBillList();
                    MessageBoxUtil.ShowInformation("该单据已通过审核");
                }
                else
                {
                    MessageBoxUtil.ShowWarning("审核失败");
                }
            }
            else
            {
                state = "4";
                if (billOutMain.examineState(ID, state))
                {
                    GetBillList();
                    MessageBoxUtil.ShowInformation("该单据已通过审核");
                }
                else
                {
                    MessageBoxUtil.ShowWarning("审核失败");
                }
            }
        }
Exemple #16
0
        /// <summary>
        /// Parses grid size from input field. Possible formats: x,y or x
        /// </summary>
        /// <returns>array of 2 elements: 0- cols, 1- rows</returns>
        private int[] ParseGridSize()
        {
            int[] gridSize   = null;
            var   input      = _gridSizeInput.text;
            var   inputParts = input.Split(',');

            if (inputParts.Length == 1)
            {
                int sizeX;
                var isNumber = int.TryParse(inputParts[0], out sizeX);
                if (!isNumber)
                {
                    MessageBoxUtil.Show($"{input} is not a number!", MessageType.Error);
                }
                else
                {
                    gridSize = new int[] { sizeX, sizeX };
                }
            }
            else if (inputParts.Length == 2)
            {
                int sizeX;
                int sizeY;
                var isNumber1 = int.TryParse(inputParts[0], out sizeX);
                var isNumber2 = int.TryParse(inputParts[0], out sizeY);
                if (!isNumber1 || !isNumber2)
                {
                    MessageBoxUtil.Show($"{input} is not a number!", MessageType.Error);
                }
                gridSize = new[] { sizeX, sizeY };
            }

            return(gridSize);
        }
Exemple #17
0
        private void dgvClientes_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string nombre    = dgvClientes.CurrentRow.Cells[0].Value.ToString();
            string apellido  = dgvClientes.CurrentRow.Cells[1].Value.ToString();
            int    idCliente = Int32.Parse(dgvClientes.CurrentRow.Cells["id_cliente"].Value.ToString());
            string DNI       = dgvClientes.CurrentRow.Cells[2].Value.ToString();

            if (MessageBox.Show("¿Desea canjear la oferta para el cliente " + nombre + " " + apellido + " ?", "Atención", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                StoredProcedureParameters param = new StoredProcedureParameters()
                                                  .AddParameter("@id_proveedor", new RepositorioProveedores().ObtenerIdProveedorDeUsuario(Session.Instance.IdUsuario))
                                                  .AddParameter("@id_cliente", idCliente)
                                                  .AddParameter("@fecha_actual", DateTime.Parse(ConfigurationManager.AppSettings["FechaSistema"]))
                                                  .AddParameter("@id_compra", idCompra);

                try
                {
                    new Conexion().ExecDataTableStoredProcedure(StoredProcedures.CanjearCompra, param);
                    MessageBoxUtil.ShowInfo("Compra canjeada exitosamente");
                    previousForm.LlenarTablaOfertas();
                    NavigableFormUtil.BackwardToDifferentWindow(this, previousForm);
                }
                catch (Exception ex)
                {
                    MessageBoxUtil.ShowError(ex.Message);
                }
            }
        }
        private bool ValidateTextBox()
        {
            bool error = true;

            if (txtName.IsNotNullOrEmpty())
            {
                MessageBoxUtil.MessageError(this, AlertMessages.MISSING_DATA);
                errorIcon.SetError(txtName, AlertMessages.ENTER_A_NAME);
                error = false;
            }
            if (!txtIdentificationCard.IsValidIdentificationCard())
            {
                MessageBoxUtil.MessageError(this, AlertMessages.MISSING_DATA);
                errorIcon.SetError(txtIdentificationCard, AlertMessages.ENTER_A_VALID_IDENTIFICATION_CARD);
                error = false;
            }
            else if (!txtIdentificationCard.Text.ValidateIdentification())
            {
                MessageBoxUtil.MessageError(this, AlertMessages.INVALID_IDENTIFICATION);
                errorIcon.SetError(txtIdentificationCard, AlertMessages.INVALID_IDENTIFICATION);
                error = false;
            }

            return(error);
        }
Exemple #19
0
        private void ListBoxInDeleteBtn_MouseLeftButtonDown(object sender, RoutedEventArgs e)
        {
            Button deleteCmd = (Button)sender;

            if (deleteCmd.DataContext is ServerModel deleteItem)
            {
                if (deleteItem.target == 1)
                {
                    MessageBoxUtil.WarningMessageBoxShow("起動対象のサーバとなっているので削除はできません。");
                    return;
                }

                using (SqliteWrapper sqliteWrapper = new SqliteWrapper(true))
                {
                    try
                    {
                        sqliteWrapper.ExecuteDelete(deleteItem);
                        sqliteWrapper.Commit();
                    }
                    catch
                    {
                        sqliteWrapper.RollBack();
                    }
                }
            }
            RefreshData();
        }
Exemple #20
0
        private void TestErrorDialogs(ISyncLabController syncLab)
        {
            PpOperations.SelectSlide(OriginalSyncGroupToShapeSlideNo);

            // no selection copy
            MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.ErrorDialogTitle,
                                                     "Please select one shape to copy.", syncLab.Copy, "Ok");

            // 2 item selected copy
            List <String> shapes = new List <string> {
                Line, RotatedArrow
            };

            PpOperations.SelectShapes(shapes);
            MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.ErrorDialogTitle,
                                                     "Please select one shape to copy.", syncLab.Copy, "Ok");

            // group selected copy
            PpOperations.SelectShape(Group);
            MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.ErrorDialogTitle,
                                                     "Please select one shape to copy.", syncLab.Copy, "Ok");

            // copy blank item for the paste error dialog test
            PpOperations.SelectShape(Line);
            CopyStyle(syncLab);

            // no selection sync
            PpOperations.SelectSlide(ExpectedSyncShapeToGroupSlideNo);
            MessageBoxUtil.ExpectMessageBoxWillPopUp(SyncLabText.ErrorDialogTitle,
                                                     "Please select at least one item to apply this format to.", () => syncLab.Sync(0), "Ok");
        }
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            if (ValidarFiltros())
            {
                //TODO separar en clases
                switch (cmbTipoListado.SelectedItem.ToString())
                {
                case EMPRESAS_LOCALIDADES_NO_VENDIDAS:
                    dgvResultados.DataSource = listadoEstadisticoRepository.EmpresasConMasLocalidadesNoVendidas(Quarter().Desde, Quarter().Hasta);
                    break;

                case CLIENTES_MAS_COMPRAS:
                    dgvResultados.DataSource = listadoEstadisticoRepository.ClientesConMasCompras(Quarter().Desde, Quarter().Hasta);
                    break;

                case CLIENTES_MAS_PUNTOS_VENCIDOS:
                    dgvResultados.DataSource = listadoEstadisticoRepository.ClientesConMasPuntosVencidos(Quarter().Desde, Quarter().Hasta);
                    break;
                }
            }
            else
            {
                MessageBoxUtil.ShowError("Los filtros ingresados son inválidos.");
            }
        }
Exemple #22
0
        public void SaveProjectWhenClose(IProject iprj, FormClosingEventArgs a)
        {
            DialogResult         result;
            GeneralProjectEntity entity = iprj as GeneralProjectEntity;

            LockMainForm.Lock();
            if (!this.m_MainFormUIManager.MainForm.IsLicClose)
            {
                result = MessageBoxUtil.ShowYesNoCancel(FrameworkResource.PROJECT_SAVE, new string[] { entity.Name });
                if (DialogResult.Yes == result)
                {
                    result = ProjectFileManager.Instance().SaveProjectFile() ? DialogResult.OK : DialogResult.Cancel;
                }
                if (DialogResult.Cancel == result)
                {
                    a.Cancel = true;
                }
            }
            else
            {
                result = MessageBoxUtil.ShowYesNo(FrameworkResource.PROJECT_SAVE, new string[] { entity.Name });
                if (DialogResult.Yes == result)
                {
                    ProjectFileManager.Instance().SaveProjectFile();
                }
            }
            LockMainForm.Unlock();
        }
Exemple #23
0
        private bool ValidateDates()
        {
            if (DateTimeUtil.Before(publicacionSeleccionada.FechaHoraDeEspectaculo, ConfigurationManager.Instance().GetSystemDateTime()))
            {
                MessageBoxUtil.ShowError("La fecha y hora de espectaculo no puede ser anterior a la fecha de hoy.");
                return(false);
            }

            if (!DateTimeUtil.Before(publicacionSeleccionada.FechaDePublicacion, publicacionSeleccionada.FechaHoraDeEspectaculo))
            {
                MessageBoxUtil.ShowError("La fecha y hora de espectaculo debe ser posterior a la fecha de publicacion.");
                return(false);
            }

            if (!DateTimeUtil.Before(publicacionSeleccionada.FechaHoraDeEspectaculo, publicacionSeleccionada.FechaDeVencimiento))
            {
                MessageBoxUtil.ShowError("La fecha de vencimiento debe ser posterior a la fecha y hora de publicacion.");
                return(false);
            }

            if (!DateTimeUtil.Before(publicacionSeleccionada.FechaDePublicacion, publicacionSeleccionada.FechaDeVencimiento))
            {
                MessageBoxUtil.ShowError("La fecha de vencimiento debe ser posterior a la fecha de publicacion.");
                return(false);
            }
            return(true);
        }
        private void dgvOfertas_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (inputCantidadUnidades.Text == "")
            {
                MessageBoxUtil.ShowError("Ingrese la cantidad de unidades a comprar");
            }
            else if (!TextFieldUtil.IsDigitsOnly(inputCantidadUnidades.Text))
            {
                MessageBoxUtil.ShowError("La cantidad de unidades debe ser un numero natural");
            }
            else
            {
                if (MessageBox.Show("¿Desea comprar " + inputCantidadUnidades.Text + " unidades de " + dgvOfertas.CurrentRow.Cells["descripcion"].Value.ToString() + "?", "Atención", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    StoredProcedureParameters inputParameters = new StoredProcedureParameters()
                                                                .AddParameter("@id_cliente_comprador", new RepositorioClientes().ObtenerIdClienteDeUsuario(Session.Instance.IdUsuario))
                                                                .AddParameter("@codigo_oferta", dgvOfertas.CurrentRow.Cells["codigo_oferta"].Value.ToString())
                                                                .AddParameter("@cant_unidades", Int32.Parse(inputCantidadUnidades.Text))
                                                                .AddParameter("@fecha", DateTime.Parse(ConfigurationManager.AppSettings["FechaSistema"]));

                    try
                    {
                        new Conexion().ExecDataTableStoredProcedure(StoredProcedures.ComprarOferta, inputParameters);

                        MessageBoxUtil.ShowInfo("Compra exitosa!");
                        this.LlenarTablaOfertas();
                    }
                    catch (SqlException ex) { MessageBoxUtil.ShowError(ex.Message); }
                }
            }
        }
Exemple #25
0
        private void grillaProveedores_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            Conexion con = new Conexion();

            int    idProveedor    = int.Parse(grillaProveedores.CurrentRow.Cells["id_proveedor"].Value.ToString());
            string nombreContacto = grillaProveedores.CurrentRow.Cells["nombre_contacto"].Value.ToString();

            if (MessageBox.Show("¿Desea eliminar el proveedor " + nombreContacto + " ?", "Atención", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                int id_usuario = con.ExecSingleOutputSqlQuery <int>("SELECT id_usuario FROM LOS_BORBOTONES.Proveedores WHERE id_proveedor = " + idProveedor);

                bool estabaHabilitado = con.ExecSingleOutputSqlQuery <bool>("SELECT habilitado FROM LOS_BORBOTONES.Usuarios WHERE id_usuario = " + id_usuario);
                if (!estabaHabilitado)
                {
                    MessageBoxUtil.ShowError("El proveedor ya se encontraba deshabilitado");
                }
                else
                {
                    StoredProcedureParameters param = new StoredProcedureParameters()
                                                      .AddParameter("@idUsuario", id_usuario);

                    try
                    {
                        con.ExecDataTableStoredProcedure(StoredProcedures.EliminarUsuario, param);
                        MessageBoxUtil.ShowInfo("Proveedor deshabilitado exitosamente");
                    }
                    catch (Exception ex)
                    {
                        MessageBoxUtil.ShowError(ex.Message);
                    }
                }
            }
        }
        private async void btnDevolucion_Click(object sender, EventArgs e)
        {
            if (dgvRentDevolutions.CurrentRow == null)
            {
                MessageBoxUtil.MessageOk(this, "Error you must select a row");
            }


            dtpDevolutionDate.Enabled = true;

            var currentRow = dgvRentDevolutions.CurrentRow;

            txtId.Text          = currentRow.Cells[DataGridColumnNames.ID_COLUMN].Value.ToString();
            nudAmount.Value     = Convert.ToDecimal(currentRow.Cells[DataGridColumnNames.AMOUNT].Value);
            nupDayQuantiy.Value = Convert.ToDecimal(currentRow.Cells[DataGridColumnNames.DAY_QUANTITY].Value);
            dtpRentDate.Value   = (DateTime)currentRow.Cells[DataGridColumnNames.RENT_DATE].Value;
            var car = await carService.GetByIdAsync((int)currentRow.Cells[DataGridColumnNames.CAR_ID].Value);

            selectedCart = mapper.Map <CarViewModel>(car);
            var client = await clientService.GetByIdAsync((int)currentRow.Cells[DataGridColumnNames.CLIENT_ID].Value);

            selectedClient          = mapper.Map <ClientViewModel>(client);
            txtCarName.Text         = selectedCart.Name;
            txtClient.Text          = selectedClient.Name;
            tabControl1.SelectedTab = tbpMantenance;
            btnEdit.Enabled         = false;
            btnNew.Enabled          = false;
            btnSave.Enabled         = true;
        }
Exemple #27
0
        private async void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (!chkDelete.Checked)
                {
                    MessageBoxUtil.MessageError(this, AlertMessages.NOT_RECORD_SELECTED_FOR_DELETE);
                    return;
                }

                DialogResult Opcion;
                Opcion = MessageBox.Show(AlertMessages.CONFIRM_DELETION, Constanst.SYSTEM_NAME,
                                         MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

                if (Opcion == DialogResult.OK)
                {
                    foreach (DataGridViewRow row in dgvPersonTypes.Rows)
                    {
                        if (Convert.ToBoolean(row.Cells[DataGridColumnNames.DELETE_COLUMN].Value))
                        {
                            int id = Convert.ToInt32(row.Cells[DataGridColumnNames.ID_COLUMN].Value);

                            await personTypeService.DeleteAsync(id);

                            MessageBoxUtil.MessageOk(this, AlertMessages.DELETED_SUCCESSFULLY);
                        }
                    }
                }
                LoadPersonTypes();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Exemple #28
0
        //保存按钮的功能实现
        private void barButtonItemSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            decimal ID = decimal.Parse(gridViewBillOutList.GetFocusedDataRow()["ID"].ToString());

            if (this.UIState_BillOutMain == UIState.Edit && sMode == 0)
            {
                for (int rowIndex = 0; rowIndex < this.gridViewBillOutDetail.RowCount; rowIndex++)
                {
                    decimal Seq  = Convert.ToDecimal(this.gridViewBillOutDetail.GetRowCellValue(rowIndex, "SEQ"));
                    decimal NUMS = Convert.ToDecimal(this.gridViewBillOutDetail.GetRowCellValue(rowIndex, "NUMS"));
                    decimal BUYING_PRICE_SHOW = Convert.ToDecimal(this.gridViewBillOutDetail.GetRowCellValue(rowIndex, "BUYING_PRICE_SHOW"));
                    if (billOutMain.updateBoutTempDetail(ID, Seq, NUMS, BUYING_PRICE_SHOW))
                    {
                    }
                    else
                    {
                        MessageBoxUtil.ShowWarning("修改入库明细失败");
                        return;
                    }
                }
                this.UIState_BillOutMain = UIState.Default;
                ShowUIState();
                LoadBillInMain();
                MessageBoxUtil.ShowInformation("修改入库明细成功");
            }
        }
Exemple #29
0
        private void dgvRoles_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int    idRol      = int.Parse(dgvRoles.CurrentRow.Cells["id_rol"].Value.ToString());
            string nombre     = dgvRoles.CurrentRow.Cells["nombre"].Value.ToString();
            bool   habilitado = bool.Parse(dgvRoles.CurrentRow.Cells["habilitado"].Value.ToString());

            if (!habilitado)
            {
                MessageBoxUtil.ShowError("El rol ya se encuentra deshabilitado");
            }
            else
            {
                if (MessageBox.Show("¿Desea deshabilitar el rol " + nombre + " ?", "Atención", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    StoredProcedureParameters param = new StoredProcedureParameters()
                                                      .AddParameter("@id_rol", idRol);

                    try
                    {
                        new Conexion().ExecDataTableStoredProcedure(StoredProcedures.BajaRol, param);
                        MessageBoxUtil.ShowInfo("Rol deshabilitado exitosamente");
                        this.LlenarGrilla();
                    }
                    catch (Exception ex)
                    {
                        MessageBoxUtil.ShowError(ex.Message);
                    }
                }
            }
        }
Exemple #30
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (!e.Cancel)
     {
         if (_worker.IsBusy)
         {
             var dr = MessageBoxUtil.Question("当前正在导入文档,是否取消导入?");
             if (dr == DialogResult.Yes)
             {
                 _worker.CancelAsync();
                 if (_worker.IsBusy)
                 {
                     Thread.Sleep(1000);
                 }
             }
             else
             {
                 e.Cancel = true;
             }
         }
         if (!e.Cancel)
         {
             if (_vault != null && _vault.PropSets.Count > 0)
             {
                 _vault.Save(ConfigPath);
             }
             //ExportExcel(false, false);
         }
     }
 }