public bool ActualizarDB(int IdInstitucion, decimal IdContrato, bool estado_contrato_pago_garantizado)
        {
            try
            {
                using (Entities_Academico Context = new Entities_Academico())
                {
                    Aca_Contrato_x_Estudiante Entity = Context.Aca_Contrato_x_Estudiante.FirstOrDefault(q => q.IdInstitucion == IdInstitucion && q.IdContrato == IdContrato);
                    if (Entity != null)
                    {
                        Entity.estado_contrato_pago_garantizado = estado_contrato_pago_garantizado;
                        Context.SaveChanges();
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                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 bool GrabarDB(Aca_Contrato_x_Estudiante_Info info, ref int IdContrato_x_Estudiante, ref string mensaje)
        {
            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    Aca_Contrato_x_Estudiante Contrato_x_Estudiante = new Aca_Contrato_x_Estudiante();
                    Contrato_x_Estudiante.IdInstitucion   = info.IdInstitucion;
                    IdContrato_x_Estudiante               = GetId();
                    Contrato_x_Estudiante.IdContrato      = IdContrato_x_Estudiante;
                    Contrato_x_Estudiante.IdMatricula     = info.IdMatricula;
                    Contrato_x_Estudiante.IdSede          = info.IdSede;
                    Contrato_x_Estudiante.IdAnioLectivo   = info.IdAnioLectivo;
                    Contrato_x_Estudiante.IdEstudiante    = info.IdEstudiante;
                    Contrato_x_Estudiante.FechaCreacion   = DateTime.Now;
                    Contrato_x_Estudiante.observacion     = info.observacion;
                    Contrato_x_Estudiante.estado          = true;
                    Contrato_x_Estudiante.UsuarioCreacion = info.UsuarioCreacion;
                    //Contrato_x_Estudiante.UsuarioModificacion = info.UsuarioModificacion;

                    Base.Aca_Contrato_x_Estudiante.Add(Contrato_x_Estudiante);
                    Base.SaveChanges();
                    mensaje = "Se ha procedido a grabar el Contrato_x_Estudiante #: " + IdContrato_x_Estudiante.ToString() + " exitosamente.";
                }
                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());
            }
        }