public Boolean AnularDB(in_responsable_Info info, ref string mensaje) { try { using (EntitiesInventario context = new EntitiesInventario()) { var contact = context.in_responsable.FirstOrDefault(var => var.IdEmpresa == info.IdEmpresa && var.IdResponsable == info.IdResponsable); if (contact != null) { contact.IdUsuarioUltAnu = info.IdUsuarioUltAnu; contact.MotiAnula = info.MotiAnula; contact.Fecha_UltAnu = DateTime.Now; contact.Estado = false; context.SaveChanges(); } } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
void ucGe_Menu_Mantenimiento_x_usuario1_event_btnAnular_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { Info = (in_responsable_Info)gv_Responsable.GetFocusedRow(); if (Info != null) { if (Info.Estado == false) { MessageBox.Show("El registro ya fue Anulado", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } else { frm = new FrmIn_responsable_Mant(Cl_Enumeradores.eTipo_action.Anular); frm.Text = frm.Text + "***ANULAR REGISTRO***"; frm._SetInfo = Info; frm.Show(); frm.MdiParent = this.MdiParent; frm.event_delegate_FrmIn_responsable_Mant_FormClosing += frm_event_delegate_FrmIn_responsable_Mant_FormClosing; } } else { MessageBox.Show("Seleccione un Registro a Anular", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public List <in_responsable_Info> Get_List_Responsable(int IdEmpresa) { List <in_responsable_Info> Lst = new List <in_responsable_Info>(); try { EntitiesInventario oEnti = new EntitiesInventario(); var Query = from q in oEnti.in_responsable where q.IdEmpresa == IdEmpresa select q; foreach (var item in Query) { in_responsable_Info Obj = new in_responsable_Info(); Obj.IdEmpresa = item.IdEmpresa; Obj.IdResponsable = item.IdResponsable; Obj.Nom_responsable = item.Nom_responsable; Obj.Estado = item.Estado; Obj.IdPersona = Convert.ToDecimal(item.IdPersona); Lst.Add(Obj); } return(Lst); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean GuardarDB(in_responsable_Info info, ref string mensaje) { try { using (EntitiesInventario Context = new EntitiesInventario()) { in_responsable Address = new in_responsable(); Address.IdEmpresa = info.IdEmpresa; Address.IdResponsable = info.IdResponsable = getIdResponsable(info.IdEmpresa, ref mensaje); Address.Nom_responsable = info.Nom_responsable.Trim(); Address.Estado = true; Address.IdPersona = (info.IdPersona == 0) ? null : info.IdPersona; Address.IdUsuario = info.IdUsuario; Address.Fecha_Transac = DateTime.Now; Context.in_responsable.Add(Address); Context.SaveChanges(); } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.ToString()); } }
private void gv_Responsable_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) { try { Info = (in_responsable_Info)gv_Responsable.GetFocusedRow(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public Boolean AnularDB(in_responsable_Info info, ref string msg) { try { return(odata.AnularDB(info, ref msg)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "AnularDB", ex.Message), ex) { EntityType = typeof(in_responsable_Bus) }; } }
public in_responsable_Info get_Info_Responsable() { try { InfoComprador = listComprador.FirstOrDefault(v => v.IdResponsable == Convert.ToDecimal(cmb_responsable.EditValue)); return(InfoComprador); } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); return(new in_responsable_Info()); } }
private void LimpiarDatos() { try { enu = Cl_Enumeradores.eTipo_action.grabar; Info = new in_responsable_Info(); txtIdResponsable.EditValue = ""; txtIdPersona.EditValue = ""; txtCedula.Text = ""; txtCedula.Enabled = true; txtNombre.Text = ""; ucGe_Menu_Superior_Mant1.Visible_bntGuardar_y_Salir = true; ucGe_Menu_Superior_Mant1.Visible_btnGuardar = true; txtCedula.Focus(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public Boolean ModificarDB(in_responsable_Info info, ref string mensaje) { try { using (EntitiesInventario context = new EntitiesInventario()) { var contact = context.in_responsable.First(var => var.IdEmpresa == info.IdEmpresa && var.IdResponsable == info.IdResponsable); contact.Nom_responsable = info.Nom_responsable; contact.Estado = info.Estado; context.SaveChanges(); } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.ToString()); } }