コード例 #1
0
        public ro_Tipo_Prestamo_Info Get_Info_Tipo_Prestamo(int IdEmpresa, int IdTPrestamo)
        {
            EntitiesRoles         oEnti = new EntitiesRoles();
            ro_Tipo_Prestamo_Info Info  = new ro_Tipo_Prestamo_Info();

            try
            {
                var Objeto = oEnti.ro_Tipo_Prestamo.First(var => var.IdEmpresa == IdEmpresa && var.IdTipoPrestamo == IdTPrestamo);

                Info.IdTipoPrestamo = Objeto.IdTipoPrestamo;
                Info.tp_Descripcion = Objeto.tp_Descripcion;
                Info.tp_Antiguedad  = Objeto.tp_Antiguedad;
                Info.tp_Monto       = Objeto.tp_Monto;
                Info.tp_Indice      = Objeto.tp_Indice;
                Info.tp_Orden       = Objeto.tp_Orden;
                Info.tp_Estado      = Objeto.tp_Estado;

                return(Info);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", 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 ModificarDB(ro_Tipo_Prestamo_Info info)
        {
            try
            {
                using (EntitiesRoles context = new EntitiesRoles())
                {
                    var contact = context.ro_Tipo_Prestamo.First(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdTipoPrestamo == info.IdTipoPrestamo);

                    contact.tp_Descripcion  = info.tp_Descripcion;
                    contact.tp_Antiguedad   = info.tp_Antiguedad;
                    contact.tp_Monto        = info.tp_Monto;
                    contact.tp_Indice       = info.tp_Indice;
                    contact.tp_Orden        = info.tp_Orden;
                    contact.tp_Estado       = info.tp_Estado;
                    contact.MotivoAnulacion = "";
                    context.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", 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 GuardarDB(ro_Tipo_Prestamo_Info Info)
        {
            try
            {
                List <ro_Tipo_Prestamo_Info> Lst = new List <ro_Tipo_Prestamo_Info>();
                using (EntitiesRoles Context = new EntitiesRoles())
                {
                    var Address = new ro_Tipo_Prestamo();

                    Info.IdTipoPrestamo    = getId(Info.IdEmpresa);
                    Address.IdEmpresa      = Info.IdEmpresa;
                    Address.IdTipoPrestamo = Info.IdTipoPrestamo;
                    Address.tp_Descripcion = Info.tp_Descripcion;
                    Address.tp_Monto       = Info.tp_Monto;
                    Address.tp_Estado      = Info.tp_Estado;

                    Context.ro_Tipo_Prestamo.Add(Address);
                    Context.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #4
0
 private void gridViewTprestamo_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         Info_Tprestamo = (ro_Tipo_Prestamo_Info)gridViewTprestamo.GetFocusedRow();
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString());
     }
 }
コード例 #5
0
 public Boolean AnularDB(ro_Tipo_Prestamo_Info info)
 {
     try
     {
         return(odata.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_Tipo_Prestamo_Bus)
               };
     }
 }
コード例 #6
0
        public List <ro_Tipo_Prestamo_Info> Get_List_Tipo_Prestamo(int IdEmpresa)
        {
            List <ro_Tipo_Prestamo_Info> Lst = new List <ro_Tipo_Prestamo_Info>();

            try
            {
                EntitiesRoles oEnti = new EntitiesRoles();
                var           Query = from q in oEnti.ro_Tipo_Prestamo
                                      where q.IdEmpresa == IdEmpresa
                                      orderby q.tp_Orden
                                      select q;

                foreach (var item in Query)
                {
                    ro_Tipo_Prestamo_Info Obj = new ro_Tipo_Prestamo_Info();

                    Obj.IdEmpresa = IdEmpresa;

                    Obj.IdTipoPrestamo = item.IdTipoPrestamo;
                    Obj.tp_Descripcion = item.tp_Descripcion;
                    Obj.tp_Antiguedad  = item.tp_Antiguedad;
                    Obj.tp_Monto       = item.tp_Monto;
                    Obj.tp_Indice      = item.tp_Indice;
                    Obj.tp_Orden       = item.tp_Orden;
                    Obj.tp_Estado      = item.tp_Estado;
                    Obj.MotiAnula      = item.MotivoAnulacion;

                    Lst.Add(Obj);
                }
                return(Lst);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }