private void btnGrabar_Click(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; if (!ValidarIngreso()) { GroupStyleBL objBL_GroupStyle = new GroupStyleBL(); GroupStyleBE objGroupStyle = new GroupStyleBE(); objGroupStyle.IdGroupStyle = IdGroupStyle; objGroupStyle.NameGroupStyle = txtDescripcion.Text; objGroupStyle.FlagState = true; objGroupStyle.Login = Parametros.strUsuarioLogin; objGroupStyle.Machine = WindowsIdentity.GetCurrent().Name.ToString(); objGroupStyle.IdCompany = Parametros.intEmpresaId; if (pOperacion == Operacion.Nuevo) { objBL_GroupStyle.Inserta(objGroupStyle); } else { objBL_GroupStyle.Actualiza(objGroupStyle); } this.Close(); } } catch (Exception ex) { Cursor = Cursors.Default; XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
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()) { GroupStyleBE objE_GroupStyle = new GroupStyleBE(); objE_GroupStyle.IdGroupStyle = int.Parse(gvGroupStyle.GetFocusedRowCellValue("IdGroupStyle").ToString()); objE_GroupStyle.Login = Parametros.strUsuarioLogin; objE_GroupStyle.Machine = WindowsIdentity.GetCurrent().Name.ToString(); objE_GroupStyle.IdCompany = Parametros.intEmpresaId; GroupStyleBL objBL_GroupStyle = new GroupStyleBL(); objBL_GroupStyle.Elimina(objE_GroupStyle); 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); } }
public void Elimina(GroupStyleBE pItem) { try { GroupStyleDL GroupStyle = new GroupStyleDL(); GroupStyle.Elimina(pItem); } catch (Exception ex) { throw ex; } }
public void Actualiza(GroupStyleBE pItem) { try { GroupStyleDL GroupStyle = new GroupStyleDL(); GroupStyle.Actualiza(pItem); } catch (Exception ex) { throw ex; } }
public GroupStyleBE SeleccionaDescripcion(int IdCompany, string NameGroupStyle) { try { GroupStyleDL GroupStyle = new GroupStyleDL(); GroupStyleBE objEmp = GroupStyle.SeleccionaDescripcion(IdCompany, NameGroupStyle); return(objEmp); } catch (Exception ex) { throw ex; } }
public GroupStyleBE Selecciona(int IdGroupStyle) { try { GroupStyleDL GroupStyle = new GroupStyleDL(); GroupStyleBE objEmp = GroupStyle.Selecciona(IdGroupStyle); return(objEmp); } catch (Exception ex) { throw ex; } }
public void Elimina(GroupStyleBE pItem) { Database db = DatabaseFactory.CreateDatabase("cnERPBD"); DbCommand dbCommand = db.GetStoredProcCommand("usp_GroupStyle_Elimina"); db.AddInParameter(dbCommand, "pIdGroupStyle", DbType.Int32, pItem.IdGroupStyle); db.AddInParameter(dbCommand, "pIdCompany", DbType.Int32, pItem.IdCompany); db.AddInParameter(dbCommand, "pLogin", DbType.String, pItem.Login); db.AddInParameter(dbCommand, "pMachine", DbType.String, pItem.Machine); db.ExecuteNonQuery(dbCommand); }
private void frmManGroupStyleEdit_Load(object sender, EventArgs e) { if (pOperacion == Operacion.Nuevo) { this.Text = "GroupStyle - New"; } else if (pOperacion == Operacion.Modificar) { this.Text = "GroupStyle - Update"; GroupStyleBE objE_GroupStyle = null; objE_GroupStyle = new GroupStyleBL().Selecciona(IdGroupStyle); if (objE_GroupStyle != null) { txtDescripcion.Text = objE_GroupStyle.NameGroupStyle.Trim(); } } txtDescripcion.Select(); }
public GroupStyleBE Selecciona(int IdGroupStyle) { Database db = DatabaseFactory.CreateDatabase("cnERPBD"); DbCommand dbCommand = db.GetStoredProcCommand("usp_GroupStyle_Selecciona"); db.AddInParameter(dbCommand, "pidGroupStyle", DbType.Int32, IdGroupStyle); IDataReader reader = db.ExecuteReader(dbCommand); GroupStyleBE GroupStyle = null; while (reader.Read()) { GroupStyle = new GroupStyleBE(); GroupStyle.IdGroupStyle = Int32.Parse(reader["idGroupStyle"].ToString()); GroupStyle.IdCompany = Int32.Parse(reader["IdCompany"].ToString()); GroupStyle.NameGroupStyle = reader["NameGroupStyle"].ToString(); GroupStyle.FlagState = Boolean.Parse(reader["FlagState"].ToString()); } reader.Close(); reader.Dispose(); return(GroupStyle); }
public void InicializarModificar() { if (gvGroupStyle.RowCount > 0) { GroupStyleBE objGroupStyle = new GroupStyleBE(); objGroupStyle.IdGroupStyle = int.Parse(gvGroupStyle.GetFocusedRowCellValue("IdGroupStyle").ToString()); frmManGroupStyleEdit objManGroupStyleEdit = new frmManGroupStyleEdit(); objManGroupStyleEdit.pOperacion = frmManGroupStyleEdit.Operacion.Modificar; objManGroupStyleEdit.IdGroupStyle = objGroupStyle.IdGroupStyle; objManGroupStyleEdit.pGroupStyleBE = objGroupStyle; objManGroupStyleEdit.StartPosition = FormStartPosition.CenterParent; objManGroupStyleEdit.ShowDialog(); Cargar(); } else { MessageBox.Show("No se pudo editar"); } }
public List <GroupStyleBE> ListaTodosActivo(int IdCompany) { Database db = DatabaseFactory.CreateDatabase("cnERPBD"); DbCommand dbCommand = db.GetStoredProcCommand("usp_GroupStyle_ListaTodosActivo"); db.AddInParameter(dbCommand, "pIdCompany", DbType.Int32, IdCompany); IDataReader reader = db.ExecuteReader(dbCommand); List <GroupStyleBE> GroupStylelist = new List <GroupStyleBE>(); GroupStyleBE GroupStyle; while (reader.Read()) { GroupStyle = new GroupStyleBE(); GroupStyle.IdGroupStyle = Int32.Parse(reader["idGroupStyle"].ToString()); GroupStyle.IdCompany = Int32.Parse(reader["IdCompany"].ToString()); GroupStyle.NameGroupStyle = reader["NameGroupStyle"].ToString(); GroupStyle.FlagState = Boolean.Parse(reader["FlagState"].ToString()); GroupStylelist.Add(GroupStyle); } reader.Close(); reader.Dispose(); return(GroupStylelist); }