public Boolean ModificarDB(ro_empresa_x_TipoLiqui_Info prI, ref string mensaje) { try { using (EntitiesRoles context = new EntitiesRoles()) { var contact = context.ro_empresa_x_TipoLiqui_Rol.First(VProdu => VProdu.IdEmpresa == prI.IdEmpresa && VProdu.IdTipoLiqui_Rol == prI.IdTipoLiqui_Rol && prI.Secuencia == VProdu.Secuencia); contact.PorcSueldo = prI.PorcSueldo; context.SaveChanges(); mensaje = "Grabacion ok..."; } 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 GrabarDB(ro_empresa_x_TipoLiqui_Info prI, ref string mensaje) { try { return(oData.GrabarDB(prI, ref mensaje)); } 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("", "GrabarDB", ex.Message), ex) { EntityType = typeof(ro_empresa_x_TipoLiqui_bus) }; } }
public Boolean GrabarDB(ro_empresa_x_TipoLiqui_Info ro_info, ref string mensaje) { try { int Secuencia; using (EntitiesRoles context = new EntitiesRoles()) { EntitiesRoles EDB = new EntitiesRoles(); Secuencia = GetSecuencia(ro_info.IdEmpresa); ro_info.Secuencia = Secuencia; var Q = from per in EDB.ro_empresa_x_TipoLiqui_Rol where per.IdTipoLiqui_Rol == ro_info.IdTipoLiqui_Rol && per.IdEmpresa == ro_info.IdEmpresa select per; var address = new ro_empresa_x_TipoLiqui_Rol(); address.IdEmpresa = ro_info.IdEmpresa; address.IdTipoLiqui_Rol = (ro_info.IdTipoLiqui_Rol + GetSecuencia(ro_info.IdEmpresa)); address.Secuencia = GetSecuencia(ro_info.IdEmpresa); address.PorcSueldo = ro_info.PorcSueldo; context.ro_empresa_x_TipoLiqui_Rol.Add(address); context.SaveChanges(); mensaje = "Grabacion ok.."; } 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()); } }