public Boolean ModificarDB(tb_persona_direccion_tipo_Info Info, ref string msjError) { try { using (EntitiesGeneral Context = new EntitiesGeneral()) { var contact = Context.tb_persona_direccion_tipo.FirstOrDefault (af => af.IdTipoDireccion == Info.IdTipoDireccion); if (contact != null) { contact.nom_TipoDireccion = Info.nom_TipoDireccion; 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.ToString() + " " + ex.Message; msjError = mensaje; throw new Exception(ex.ToString()); } }
public Boolean GuardarDB(tb_persona_direccion_tipo_Info Info, ref int IdTipoDireccion, ref string msjError) { try { using (EntitiesGeneral Context = new EntitiesGeneral()) { var Address = new tb_persona_direccion_tipo(); Address.IdTipoDireccion = Info.IdTipoDireccion = IdTipoDireccion = GetId(); Address.nom_TipoDireccion = Info.nom_TipoDireccion; Context.tb_persona_direccion_tipo.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.ToString() + " " + ex.Message; msjError = mensaje; throw new Exception(ex.ToString()); } }
public tb_persona_direccion_tipo_Info Get_Info_persona_direccion(decimal IdTipoDireccion) { try { tb_persona_direccion_tipo_Info info = new tb_persona_direccion_tipo_Info(); EntitiesGeneral objEnti = new EntitiesGeneral(); var pais = from p in objEnti.tb_persona_direccion_tipo where p.IdTipoDireccion == IdTipoDireccion select p; foreach (var item in pais) { info = new tb_persona_direccion_tipo_Info(); info.IdTipoDireccion = item.IdTipoDireccion; info.nom_TipoDireccion = item.nom_TipoDireccion; } return(info); } 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.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public void Set_Info(tb_persona_direccion_tipo_Info _Info) { try { info = _Info; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LimpiarDatos() { try { info = new tb_persona_direccion_tipo_Info(); this.txtId.Text = ""; this.txtnombre.Text = ""; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public Boolean ModificarDB(tb_persona_direccion_tipo_Info Info, ref string msjError) { try { return(Odata.ModificarDB(Info, ref msjError)); } 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("", "ObtenerEmpresa", ex.Message), ex) { EntityType = typeof(tb_Empresa_Bus) }; } }
public tb_persona_direccion_tipo_Info Get_Info() { try { info = new tb_persona_direccion_tipo_Info(); info.IdTipoDireccion = (this.txtId.Text != "") ? Convert.ToInt32(this.txtId.Text) : 0; info.nom_TipoDireccion = this.txtnombre.Text; return(info); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(new tb_persona_direccion_tipo_Info()); } }