示例#1
0
        public Boolean GrabarBD(ro_empleado_gastos_perso_x_otros_gast_deduci_Info info, ref string msg)
        {
            try
            {
                using (EntitiesRoles db = new EntitiesRoles())
                {
                    ro_empleado_gastos_perso_x_otros_gast_deduci item = new ro_empleado_gastos_perso_x_otros_gast_deduci();

                    item.IdEmpresa           = info.IdEmpresa;
                    item.IdEmpleado          = info.IdEmpleado;
                    item.Anio_fiscal         = info.Anio_fiscal;
                    item.secuencia           = getId(info.IdEmpresa, info.IdEmpleado, info.Anio_fiscal);
                    item.Valor_Pension_alim  = info.Valor_Pension_alim;
                    item.Valor_no_cub_x_aseg = info.Valor_no_cub_x_aseg;

                    db.ro_empleado_gastos_perso_x_otros_gast_deduci.Add(item);
                    db.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());
            }
        }
示例#2
0
 public Boolean GrabarBD(ro_empleado_gastos_perso_x_otros_gast_deduci_Info info, ref string msg)
 {
     try
     {
         return(Data.GrabarBD(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("", "GrabarBD", ex.Message), ex)
               {
                   EntityType = typeof(ro_empleado_gastos_perso_x_otros_gast_deduci_Bus)
               };
     }
 }
示例#3
0
        public List <ro_empleado_gastos_perso_x_otros_gast_deduci_Info> Get_List_empleado_gastos_perso_x_otros_gast_deduci(int IdEmpresa, decimal IdEmpleado, int anio)
        {
            List <ro_empleado_gastos_perso_x_otros_gast_deduci_Info> lst = new List <ro_empleado_gastos_perso_x_otros_gast_deduci_Info>();

            try
            {
                using (EntitiesRoles rol = new EntitiesRoles())
                {
                    var Consulta = from q in rol.ro_empleado_gastos_perso_x_otros_gast_deduci
                                   where q.IdEmpresa == IdEmpresa &&
                                   q.IdEmpleado == IdEmpleado &&
                                   q.Anio_fiscal == anio
                                   orderby q.IdEmpleado
                                   select q;

                    foreach (var item in Consulta)
                    {
                        ro_empleado_gastos_perso_x_otros_gast_deduci_Info info = new ro_empleado_gastos_perso_x_otros_gast_deduci_Info();
                        info.IdEmpresa           = item.IdEmpresa;
                        info.IdEmpleado          = item.IdEmpleado;
                        info.Anio_fiscal         = item.Anio_fiscal;
                        info.secuencia           = item.secuencia;
                        info.Valor_Pension_alim  = item.Valor_Pension_alim;
                        info.Valor_no_cub_x_aseg = item.Valor_no_cub_x_aseg;

                        lst.Add(info);
                    }
                }
                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.InnerException.ToString());
            }
        }
示例#4
0
 public Boolean EliminarDB(ro_empleado_gastos_perso_x_otros_gast_deduci_Info info)
 {
     try
     {
         using (EntitiesRoles ro = new EntitiesRoles())
         {
             ro_empleado_gastos_perso_x_otros_gast_deduci EGPXOGD = ro.ro_empleado_gastos_perso_x_otros_gast_deduci.First(v => v.IdEmpleado == info.IdEmpleado && v.IdEmpresa == info.IdEmpresa && v.Anio_fiscal == info.Anio_fiscal);
             ro.ro_empleado_gastos_perso_x_otros_gast_deduci.Remove(EGPXOGD);
             ro.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());
     }
 }