public ro_TablaSectorial_Info Get_Info_TablaSectorial(int IdCodSectorial) { EntitiesRoles oEnti = new EntitiesRoles(); ro_TablaSectorial_Info Info = new ro_TablaSectorial_Info(); try { var Objeto = oEnti.ro_TablaSectorial.First(var => var.IdCodSectorial == IdCodSectorial); Info.CodigoIESS = Objeto.CodigoIESS; Info.Actividad = Objeto.Actividad; Info.EstructuraOcupacional = Objeto.EstructuraOcupacional; Info.Estado = Objeto.Estado; return(Info); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public List <ro_TablaSectorial_Info> Get_List_TablaSectorial() { List <ro_TablaSectorial_Info> Lst = new List <ro_TablaSectorial_Info>(); try { EntitiesRoles oEnti = new EntitiesRoles(); var Query = from q in oEnti.ro_TablaSectorial select q; foreach (var item in Query) { ro_TablaSectorial_Info Obj = new ro_TablaSectorial_Info(); Obj.IdCodSectorial = item.IdCodSectorial; Obj.CodigoIESS = item.CodigoIESS; Obj.Actividad = item.Actividad; Obj.EstructuraOcupacional = item.EstructuraOcupacional; Obj.Estado = item.Estado; Lst.Add(Obj); } return(Lst); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public Boolean GuardarDB(ref ro_TablaSectorial_Info Info) { try { List <ro_TablaSectorial_Info> Lst = new List <ro_TablaSectorial_Info>(); using (EntitiesRoles Context = new EntitiesRoles()) { var Address = new ro_TablaSectorial(); Info.IdCodSectorial = Address.IdCodSectorial = getId(Info.IdCodSectorial); Address.CodigoIESS = Info.CodigoIESS; Address.Actividad = Info.Actividad; Address.EstructuraOcupacional = Info.EstructuraOcupacional; Address.Estado = "A"; //contact = Address; //Context.ro_TablaSectorial.Add(contact); Context.ro_TablaSectorial.Add(Address); Context.SaveChanges(); } return(true); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public Boolean ModificarDB(ro_TablaSectorial_Info info) { try { using (EntitiesRoles context = new EntitiesRoles()) { var contact = context.ro_TablaSectorial.First(minfo => minfo.IdCodSectorial == info.IdCodSectorial); contact.CodigoIESS = info.CodigoIESS; contact.Actividad = info.Actividad; contact.EstructuraOcupacional = info.EstructuraOcupacional; contact.Estado = info.Estado; context.SaveChanges(); } return(true); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
private void gridViewTablaSectorial_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { try { InfoTablaSectorial = (ro_TablaSectorial_Info)gridViewTablaSectorial.GetFocusedRow(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString()); } }
public Boolean AnularDB(ro_TablaSectorial_Info info) { try { return(odata.AnularDB(info)); } 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(ro_TablaSectorial_Bus) }; } }