示例#1
0
        public Boolean getExiste(ro_Empleado_estudios_Info info)
        {
            try
            {
                Boolean Existe;

                Existe = false;

                EntitiesRoles OERol_Empleado = new EntitiesRoles();

                var select = from A in OERol_Empleado.ro_empleado_estudios
                             where A.IdEmpresa == info.IdEmpresa && A.IdEmpleado == info.IdEmpleado &&
                             A.Secuencia == info.Secuencia
                             select A;

                foreach (var item in select)
                {
                    Existe = true;
                }

                return(Existe);
            }
            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());
            }
        }
示例#2
0
        public Boolean ModificarDB(ro_Empleado_estudios_Info info, ref string msg)
        {
            try
            {
                using (EntitiesRoles context = new EntitiesRoles())
                {
                    var contact = context.ro_empleado_estudios.First(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdEmpleado == info.IdEmpleado);

                    contact.IdInstitucion = info.IdInstitucion;
                    contact.Carrera       = info.Carrera;
                    contact.IdEstudios    = info.IdEstudios;
                    contact.Observacion   = info.Observacion;

                    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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
示例#3
0
        public Boolean GrabarDB(ro_Empleado_estudios_Info Info, ref string msg)
        {
            try
            {
                List <ro_Empleado_estudios_Info> Lst = new List <ro_Empleado_estudios_Info>();
                using (EntitiesRoles Context = new EntitiesRoles())
                {
                    var Address = new ro_empleado_estudios();

                    int IdEstudios = getId(Info.IdEmpresa, Info.IdEmpleado);

                    Address.IdEmpresa     = Info.IdEmpresa;
                    Address.IdEmpleado    = Info.IdEmpleado;
                    Address.Secuencia     = IdEstudios;
                    Address.IdInstitucion = Info.IdInstitucion;
                    Address.Carrera       = Info.Carrera;
                    Address.IdEstudios    = Info.IdEstudios;
                    Address.Observacion   = Info.Observacion;

                    Context.ro_empleado_estudios.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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
示例#4
0
        public Boolean GrabarDB(ro_Empleado_estudios_Info info, ref string msg)
        {
            try
            {
                Boolean valorRetornar = false;

                if (oRo_Empleado_estudios_Data.getExiste(info))
                {
                    valorRetornar = oRo_Empleado_estudios_Data.ModificarDB(info, ref msg);
                }
                else
                {
                    valorRetornar = oRo_Empleado_estudios_Data.GrabarDB(info, ref msg);
                }

                return(valorRetornar);
            }
            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_Empleado_estudios_Bus)
                      };
            }
        }
示例#5
0
 public Boolean AnularDB(ro_Empleado_estudios_Info info)
 {
     try
     {
         return(oRo_Empleado_estudios_Data.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_Empleado_estudios_Bus)
               };
     }
 }
示例#6
0
        public List <ro_Empleado_estudios_Info> Get_List_Empleado_estudios(int IdEmpresa, decimal IdEmpleado)
        {
            EntitiesRoles oEnti = new EntitiesRoles();
            List <ro_Empleado_estudios_Info> lst = new List <ro_Empleado_estudios_Info>();

            try
            {
                var Objeto = from T in oEnti.ro_empleado_estudios
                             where T.IdEmpresa == IdEmpresa && T.IdEmpleado == IdEmpleado
                             select T;

                foreach (var item in Objeto)
                {
                    ro_Empleado_estudios_Info Info = new ro_Empleado_estudios_Info();

                    Info.IdEmpresa     = item.IdEmpresa;
                    Info.IdEmpleado    = item.IdEmpleado;
                    Info.Secuencia     = item.Secuencia;
                    Info.IdInstitucion = item.IdInstitucion;
                    Info.Carrera       = item.Carrera;
                    Info.IdEstudios    = item.IdEstudios;
                    Info.Observacion   = item.Observacion;

                    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());
            }
        }
示例#7
0
        public List <ro_Empleado_estudios_Info> Get_List_Empleado_estudios(int IdEmpresa)
        {
            List <ro_Empleado_estudios_Info> Lst = new List <ro_Empleado_estudios_Info>();

            try
            {
                EntitiesRoles oEnti = new EntitiesRoles();

                var Query = from q in oEnti.ro_empleado_estudios
                            where q.IdEmpresa == IdEmpresa
                            select q;

                foreach (var item in Query)
                {
                    ro_Empleado_estudios_Info Obj = new ro_Empleado_estudios_Info();
                    Obj.IdEmpresa     = item.IdEmpresa;
                    Obj.IdEmpleado    = item.IdEmpleado;
                    Obj.Secuencia     = item.Secuencia;
                    Obj.IdInstitucion = item.IdInstitucion;
                    Obj.Carrera       = item.Carrera;
                    Obj.IdEstudios    = item.IdEstudios;
                    Obj.Observacion   = item.Observacion;

                    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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }