private void CargarDatosCorte() { corteBL bl = new corteBL(); dgvCorte.DataSource = bl.ListaCortesEnproceso(); dgvCorte.Columns[0].Visible = false; for (int i = 8; i < dgvCorte.ColumnCount; i++) { dgvCorte.Columns[i].Visible = false; } DiseñoBL bld = new DiseñoBL(); cbxDiseño.DisplayMember = "Corte"; cbxDiseño.ValueMember = "id"; cbxDiseño.DataSource = bld.ListaDiseñosActivos(); TallaBL blt = new TallaBL(); gtvTallas.DataSource = blt.ListaTallasActivas(); gtvTallas.Columns[0].Visible = false; gtvTallas.Columns[2].Visible = false; }
private void tlbMenu_DeleteClick() { try { Cursor = Cursors.WaitCursor; if (XtraMessageBox.Show("Be sure to delete the record?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (!ValidarIngreso()) { TallaBE objE_Talla = new TallaBE(); objE_Talla.IdTalla = int.Parse(gvTalla.GetFocusedRowCellValue("IdTalla").ToString()); objE_Talla.Login = Parametros.strUsuarioLogin; objE_Talla.Machine = WindowsIdentity.GetCurrent().Name.ToString(); objE_Talla.IdCompany = Parametros.intEmpresaId; TallaBL objBL_Talla = new TallaBL(); objBL_Talla.Elimina(objE_Talla); XtraMessageBox.Show("The record was successfully deleted.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); Cargar(); } } Cursor = Cursors.Default; } catch (Exception ex) { Cursor = Cursors.Default; XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnGrabar_Click(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; if (!ValidarIngreso()) { TallaBL objBL_Talla = new TallaBL(); TallaBE objTalla = new TallaBE(); objTalla.IdTalla = IdTalla; objTalla.NameTalla = txtDescripcion.Text; objTalla.FlagState = true; objTalla.Login = Parametros.strUsuarioLogin; objTalla.Machine = WindowsIdentity.GetCurrent().Name.ToString(); objTalla.IdCompany = Parametros.intEmpresaId; if (pOperacion == Operacion.Nuevo) objBL_Talla.Inserta(objTalla); else objBL_Talla.Actualiza(objTalla); this.Close(); } } catch (Exception ex) { Cursor = Cursors.Default; XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public async Task <IHttpActionResult> Eliminar(int Id, int IdCliente, string UsrModificador) { try { TallaBL oTallaBL = new TallaBL(IdCliente); TallaBE obe = new TallaBE(); obe.Id = Id; obe.UsrModificador = UsrModificador; bool rpta = false; rpta = oTallaBL.Eliminar(obe); if (rpta) { return(Ok(Models.Util.GetBodyResponse(200, "OK"))); } else { return(Ok(Models.Util.GetBodyResponse(300, "Ocurrió un error al actualizar."))); } } catch (Exception ex) { //LogSA.GrabarLogError("SOL TR", model.user, "EditarTareas", ex); return(Ok(Models.Util.GetBodyResponse(400, ex.Message))); } }
private void CargarDatosTallas() { TallaBL bl = new TallaBL(); dataGridView1.DataSource = bl.ListaTallas(); dataGridView1.Columns[0].Visible = false; dataGridView1.Columns[3].Visible = false; }
void ExportarExcel(string filename) { Excel._Application xlApp; Excel._Workbook xlLibro; Excel._Worksheet xlHoja; Excel.Sheets xlHojas; xlApp = new Excel.Application(); filename = Path.Combine(Directory.GetCurrentDirectory(), "Excel\\Talla.xlsx"); xlLibro = xlApp.Workbooks.Open(filename, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value); xlHojas = xlLibro.Sheets; xlHoja = (Excel._Worksheet)xlHojas[1]; Cursor.Current = Cursors.WaitCursor; try { int Row = 6; int Secuencia = 1; List <TallaBE> lstTalla = null; lstTalla = new TallaBL().ListaTodosActivo(Parametros.intEmpresaId); if (lstTalla.Count > 0) { xlHoja.Shapes.AddPicture(Path.Combine(Directory.GetCurrentDirectory(), "Logo.jpg"), Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, 1, 1, 100, 60); foreach (var item in lstTalla) { xlHoja.Cells[Row, 1] = item.IdTalla; xlHoja.Cells[Row, 2] = item.NameTalla; Row = Row + 1; Secuencia = Secuencia + 1; } } xlLibro.SaveAs("C:\\Excel\\Talla.xlsx", Excel.XlFileFormat.xlWorkbookDefault, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Excel.XlSaveAsAccessMode.xlExclusive, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value); xlLibro.Close(true, Missing.Value, Missing.Value); xlApp.Quit(); Cursor.Current = Cursors.Default; BSUtils.OpenExcel("C:\\Excel\\Talla.xlsx"); //XtraMessageBox.Show("It was imported correctly \n The file was generated C:\\Excel\\Talla.xlsx", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { xlLibro.Close(false, Missing.Value, Missing.Value); xlApp.Quit(); Cursor.Current = Cursors.Default; MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int id = dataGridView1.CurrentRow.Index; _talla = new Talla(); _talla.Id = (Convert.ToInt16(dataGridView1[0, id].Value)); TallaBL bl = new TallaBL(); //AdministradorCon admin = new AdministradorCon(); _talla = bl.ObtenerTalla((short)_talla.Id); txtTallasNombre.Text = _talla.Talla1.ToString(); rbtnTallasActivo.Checked = _talla.activo; btnEliminartallas.Visible = true; }
private void frmManTallaEdit_Load(object sender, EventArgs e) { if (pOperacion == Operacion.Nuevo) { this.Text = "Talla - New"; } else if (pOperacion == Operacion.Modificar) { this.Text = "Talla - Update"; TallaBE objE_Talla = null; objE_Talla = new TallaBL().Selecciona(IdTalla); if (objE_Talla != null) { txtDescripcion.Text = objE_Talla.NameTalla.Trim(); } } txtDescripcion.Select(); }
public IHttpActionResult GetDatosIniciales(string usuario, int idCliente) { try { TallaBL oTallaBL = new TallaBL(idCliente); Talla_DatosInicialesBE lobe = oTallaBL.ListarDatosIniciales(usuario, idCliente); if (lobe != null) { return(Ok(Models.Util.GetBodyResponse(200, lobe))); } else { return(Ok(Models.Util.GetBodyResponse(300, "No se encontraron registros."))); } } catch (Exception ex) { /*LogSA.GrabarLogError("SOL TR", user, "GetListarOrdOtrs", ex);*/ return(Ok(Models.Util.GetBodyResponse(400, ex.Message))); } }
public async Task <IHttpActionResult> Actualizar(TallaBE obe) { try { TallaBL oTallaBL = new TallaBL(obe.IdCliente); bool rpta = false; rpta = oTallaBL.Actualizar(obe); if (rpta) { return(Ok(Models.Util.GetBodyResponse(200, "OK"))); } else { return(Ok(Models.Util.GetBodyResponse(300, "Ocurrió un error al actualizar."))); } } catch (Exception ex) { //LogSA.GrabarLogError("SOL TR", model.user, "EditarTareas", ex); return(Ok(Models.Util.GetBodyResponse(400, ex.Message))); } }
private void btnEliminartallas_Click(object sender, EventArgs e) { string message = "Desea eliminar el lugar" + _talla.Talla1 + "?"; const string caption = "Form closing"; var result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation); //if the no button was pressed if (result == DialogResult.Yes) { TallaBL bl = new TallaBL(); if (bl.Eliminartallas((short)_talla.Id)) { MessageBox.Show("Eliminado correctamente"); Limpiar(); btnEliminartallas.Visible = false; CargarDatosTallas(); _talla = null; } } }
/*---Almacen End*/ /*---Tallas---*/ private void btnAceptartallas_Click(object sender, EventArgs e) { TallaBL bl = new TallaBL(); if (_talla == null) { _talla = new Talla(); } _talla.Talla1 = Convert.ToDouble(txtTallasNombre.Text); _talla.activo = rbtnTallasActivo.Checked; TallaBL blt = new TallaBL(); if (blt.AgregarActualizarTalla(_talla)) { Limpiar(); MessageBox.Show("La operacion fue exitosa"); CargarDatosTallas(); btnEliminartallas.Visible = false; _talla = null; } }