public FormGrupoClienteNuevo(GrupoCliente grupoCliente) { InitializeComponent(); this.nuevo = false; textNombreGCL.Text = grupoCliente.nombreGrupo; textDescripcionGCL.Text = grupoCliente.descripcion; textMinimoOrdenGCL.Text = grupoCliente.minimoOrden.ToString(); chkActivoGCL.Checked = Convert.ToBoolean(grupoCliente.estado); currentIDGrupoCLiente = grupoCliente.idGrupoCliente; }
public async Task <Response> eliminar(GrupoCliente param) { try { // localhost:8080/admeli/xcore2/xcore/services.php/gcliente/eliminar return(await webService.POST <GrupoCliente, Response>("gcliente", "eliminar", param)); } catch (Exception ex) { throw ex; } }
private void crearObjeto() { grupoCliente = new GrupoCliente(); if (!nuevo) { grupoCliente.idGrupoCliente = currentIDGrupoCLiente; // Llenar el id categoria cuando este en esdo modificar } grupoCliente.nombreGrupo = textNombreGCL.Text; grupoCliente.descripcion = textDescripcionGCL.Text; grupoCliente.minimoOrden = (textMinimoOrdenGCL.Text == "") ? 0 : Convert.ToInt32(textMinimoOrdenGCL.Text); grupoCliente.estado = Convert.ToInt32(chkActivoGCL.Checked); }
public int PersistirGrupoClienteSalesForce(string idSalesForceClienteMae, string descricaoGrupoCliente) { _variables.UserName = "******"; GrupoCliente grupoCliente = new GrupoCliente { FlStatus = true, DescGrupoCliente = descricaoGrupoCliente, IdClienteMae = idSalesForceClienteMae }; _grupoClienteRepository.Adicionar(grupoCliente); _unitOfWork.Commit(); return(grupoCliente.Id); }
private async void ExecuteAnular() { try { // Estados this.IsRunning = true; this.IsEnabled = false; /// Verificacion si el registro esta anulado if (this.estado == 0) { await App.Current.MainPage.DisplayAlert("Anular", "Este registro ya esta anulado \n" + this.nombreGrupo, "Aceptar"); return; } // pregunta al usuario (Confirmacion) if (await App.Current.MainPage.DisplayAlert("Anular", "¿esta seguro de anular este registro? \n" + this.nombreGrupo, "Aceptar", "Cancelar") == false) { return; } // Preparando el objeto para enviar GrupoCliente grupoCliente = new GrupoCliente(); grupoCliente.idGrupoCliente = this.idGrupoCliente; /// Ejecutando el webservice // localhost:8080/admeli/xcore2/xcore/services.php/gcliente/desactivar Response response = await webService.POST <GrupoCliente, Response>("gcliente", "desactivar", grupoCliente); // Message response await App.Current.MainPage.DisplayAlert("Anular", response.Message, "Aceptar"); // Refrescar la lista GrupoClienteViewModel.GetInstance().ExecuteRefresh(); } catch (Exception ex) { // Error message await App.Current.MainPage.DisplayAlert("Error", ex.Message, "Aceptar"); } finally { // Estados this.IsRunning = false; this.IsEnabled = true; } }
private async void executeAnular() { // Verificando la existencia de datos en el datagridview if (dataGridView.Rows.Count == 0) { MessageBox.Show("No hay un registro seleccionado", "Desactivar o anular", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } // Pregunta de seguridad de anular DialogResult dialog = MessageBox.Show("¿Está seguro de anular este registro?", "Anular", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (dialog == DialogResult.No) { return; } try { loadState(true); int index = dataGridView.CurrentRow.Index; // Identificando la fila actual del datagridview currentGrupoCliente = new GrupoCliente(); //creando una instancia del objeto correspondiente currentGrupoCliente.idGrupoCliente = Convert.ToInt32(dataGridView.Rows[index].Cells[0].Value); // obteniedo el idRegistro del datagridview // Comprobando si el registro ya esta desactivado if (grupoClientes.Find(x => x.idGrupoCliente == currentGrupoCliente.idGrupoCliente).estado == 0) { MessageBox.Show("Este registro ya esta desactivado", "Desactivar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } // Procediendo con las desactivacion Response response = await grupoClienteModel.desactivar(currentGrupoCliente); MessageBox.Show(response.msj, "Desactivar", MessageBoxButtons.OK, MessageBoxIcon.Information); cargarRegistros(); // recargando los registros en el datagridview } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message, "Eliminar", MessageBoxButtons.OK, MessageBoxIcon.Warning); } finally { loadState(false); } }
private void executeModificar() { // Verificando la existencia de datos en el datagridview if (dataGridView.Rows.Count == 0) { MessageBox.Show("No hay un registro seleccionado", "Eliminar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } int index = dataGridView.CurrentRow.Index; // Identificando la fila actual del datagridview int idGrupoCliente = Convert.ToInt32(dataGridView.Rows[index].Cells[0].Value); // obteniedo el idRegistro del datagridview currentGrupoCliente = grupoClientes.Find(x => x.idGrupoCliente == idGrupoCliente); // Buscando la registro especifico en la lista de registros // Mostrando el formulario de modificacion FormGrupoClienteNuevo formGrupoCliente = new FormGrupoClienteNuevo(currentGrupoCliente); formGrupoCliente.ShowDialog(); cargarRegistros(); // recargando loas registros en el datagridview }
private void decorationDataGridView() { if (dataGridView.Rows.Count == 0) { return; } foreach (DataGridViewRow row in dataGridView.Rows) { int idGrupoCliente = Convert.ToInt32(row.Cells[0].Value); // obteniedo el idCategoria del datagridview currentGrupoCliente = grupoClientes.Find(x => x.idGrupoCliente == idGrupoCliente); // Buscando la categoria en las lista de categorias if (currentGrupoCliente.estado == 0) { dataGridView.ClearSelection(); row.DefaultCellStyle.BackColor = Color.FromArgb(255, 224, 224); row.DefaultCellStyle.ForeColor = Color.FromArgb(250, 5, 73); } } }
static void Main(string[] args) { var carro = new CarroServico(); carro.Salvar(new Carro() { Id = 132, Descricao = "Teste Classe", Cor = "Prata", Ano = 2012 }); var grupoCliente = new GrupoCliente() { Nome = "Belo Horizonte" }; NegocioService.Salvar(grupoCliente); Console.WriteLine("Hello World!"); }
private async void executeEliminar() { // Verificando la existencia de datos en el datagridview if (dataGridView.Rows.Count == 0) { MessageBox.Show("No hay un registro seleccionado", "Eliminar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } // Pregunta de seguridad de eliminacion DialogResult dialog = MessageBox.Show("¿Está seguro de eliminar este registro?", "Eliminar", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (dialog == DialogResult.No) { return; } try { int index = dataGridView.CurrentRow.Index; // Identificando la fila actual del datagridview currentGrupoCliente = new GrupoCliente(); //creando una instancia del objeto categoria currentGrupoCliente.idGrupoCliente = Convert.ToInt32(dataGridView.Rows[index].Cells[0].Value); // obteniedo el idCategoria del datagridview loadState(true); // cambiando el estado Response response = await grupoClienteModel.eliminar(currentGrupoCliente); // Eliminando con el webservice correspondiente MessageBox.Show(response.msj, "Eliminar", MessageBoxButtons.OK, MessageBoxIcon.Information); cargarRegistros(); // recargando el datagridview } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message, "Eliminar", MessageBoxButtons.OK, MessageBoxIcon.Warning); } finally { loadState(false); // cambiando el estado } }