public Boolean GuardarDBIE(ro_Config_Rubros_x_empleado_Info Info) { try { List <ro_Config_Rubros_x_empleado_Info> Lst = new List <ro_Config_Rubros_x_empleado_Info>(); using (EntitiesRoles Context = new EntitiesRoles()) { var Address = new ro_Config_Rubros_x_empleado(); Address.IdEmpresa = Info.IdEmpresa; Address.IdRubro = Info.IdRubro; Address.OrdenPres = (Info.OrdenPres == 1) ? getIdI(Info.IdEmpresa) : getIdE(Info.IdEmpresa); //Address.OrdenPres = getId(Info.IdEmpresa); Address.Estado = "A"; Context.ro_Config_Rubros_x_empleado.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); mensaje = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }
public Boolean modificarRubrosxEmpleado(ro_Config_Rubros_x_empleado_Info Info, string msg) { try { using (EntitiesRoles context = new EntitiesRoles()) { var contact = context.ro_Config_Rubros_x_empleado.First( var => var.IdEmpresa == Info.IdEmpresa && var.IdRubro == Info.IdRubro); contact.OrdenPres = Info.OrdenPres; 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); mensaje = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }
public Boolean Borrar(ro_Config_Rubros_x_empleado_Info Info) { try { using (EntitiesRoles context = new EntitiesRoles()) { var contact = context.ro_Config_Rubros_x_empleado.FirstOrDefault(minfo => minfo.IdEmpresa == Info.IdEmpresa && minfo.IdRubro == Info.IdRubro); context.ro_Config_Rubros_x_empleado.Remove(contact); context.SaveChanges(); context.Dispose(); } 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); mensaje = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }
public List <ro_Config_Rubros_x_empleado_Info> Get_List_Config_Rubros_x_empleado(int IdEmpresa) { List <ro_Config_Rubros_x_empleado_Info> Lst = new List <ro_Config_Rubros_x_empleado_Info>(); try { EntitiesRoles oEnti = new EntitiesRoles(); var Query = from q in oEnti.ro_Config_Rubros_x_empleado where q.IdEmpresa == IdEmpresa select q; foreach (var item in Query) { ro_Config_Rubros_x_empleado_Info Obj = new ro_Config_Rubros_x_empleado_Info(); Obj.IdEmpresa = item.IdEmpresa; Obj.IdRubro = item.IdRubro; Obj.OrdenPres = item.OrdenPres; Obj.Estado = item.Estado; 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); mensaje = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }
public Boolean Borrar(ro_Config_Rubros_x_empleado_Info Info) { try { return(odata.Borrar(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("", "Borrar", ex.Message), ex) { EntityType = typeof(ro_Config_Rubros_x_empleado_Bus) }; } }
public Boolean modificarRubrosxEmpleado(ro_Config_Rubros_x_empleado_Info Info, string msg) { try { ro_Config_Rubros_x_empleado_Data data = new ro_Config_Rubros_x_empleado_Data(); return(data.modificarRubrosxEmpleado(Info, 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("", "modificarRubrosxEmpleado", ex.Message), ex) { EntityType = typeof(ro_Config_Rubros_x_empleado_Bus) }; } }
public List <ro_Config_Rubros_x_empleado_Info> Get_List_Config_Rubros_x_Ingreso(int IdEmpresa) { int i = 0;//Contador de secuencia para que aparezca en pantalla List <ro_Config_Rubros_x_empleado_Info> Lst = new List <ro_Config_Rubros_x_empleado_Info>(); try { EntitiesRoles oEnti = new EntitiesRoles(); var Query = from q in oEnti.ro_Config_Rubros_x_empleado join w in oEnti.ro_rubro_tipo on q.IdRubro equals w.IdRubro where w.ru_tipo == "I" && q.IdEmpresa == IdEmpresa orderby q.OrdenPres select new { q.IdEmpresa, q.IdRubro, q.Estado, q.OrdenPres }; foreach (var item in Query) { i++;//Contador de secuencia para que aparezca en pantalla ro_Config_Rubros_x_empleado_Info Obj = new ro_Config_Rubros_x_empleado_Info(); Obj.IdEmpresa = item.IdEmpresa; Obj.IdRubro = item.IdRubro; Obj.OrdenPres = item.OrdenPres; Obj.Estado = item.Estado; Obj.Secuencia = i; 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); mensaje = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }
public Boolean BorrarConfigRubroxEmpleadoE(ro_Config_Rubros_x_empleado_Info Info) { try { //31/10/2013 using (EntitiesRoles context = new EntitiesRoles()) { string query = "delete from ro_Config_Rubros_x_empleado where IdEmpresa = " + Info.IdEmpresa; context.Database.ExecuteSqlCommand(query); } 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); mensaje = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }
public ro_Config_Rubros_x_empleado_Info Get_Info_Config_Rubros(string IdRubro) { EntitiesRoles oEnti = new EntitiesRoles(); ro_Config_Rubros_x_empleado_Info Info = new ro_Config_Rubros_x_empleado_Info(); try { var Objeto = oEnti.ro_Config_Rubros_x_empleado.First(var => var.IdRubro == IdRubro); Info.IdEmpresa = Objeto.IdEmpresa; Info.OrdenPres = Objeto.OrdenPres; Info.Estado = Objeto.Estado; 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); mensaje = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }