Example #1
0
        public ActionResult Modificar(int IdBanco = 0)
        {
            tb_banco_Info model = bus_banco.get_info(IdBanco);

            if (model == null)
            {
                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
Example #2
0
 public ActionResult Modificar(int IdBanco = 0)
 {
     #region Validar Session
     if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
     {
         return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
     }
     SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
     SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
     #endregion
     tb_banco_Info model = bus_banco.get_info(IdBanco);
     if (model == null)
     {
         return(RedirectToAction("Index"));
     }
     model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual);
     model.Lst_det         = bus_banco_det.get_list(Convert.ToInt32(SessionFixed.IdEmpresa), model.IdBanco);
     Session["IdBancoPro"] = IdBanco;
     List_Det.set_list(model.Lst_det, model.IdTransaccionSession);
     return(View(model));
 }
Example #3
0
        public ActionResult Consultar(int IdBanco = 0, bool Exito = false)
        {
            #region Validar Session
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion

            tb_banco_Info model = bus_banco.get_info(IdBanco);
            if (model == null)
            {
                return(RedirectToAction("Index"));
            }

            #region Permisos
            seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "General", "Banco", "Index");
            if (model.Estado == "I")
            {
                info.Modificar = false;
                info.Anular    = false;
            }
            model.Nuevo     = (info.Nuevo == true ? 1 : 0);
            model.Modificar = (info.Modificar == true ? 1 : 0);
            model.Anular    = (info.Anular == true ? 1 : 0);
            #endregion

            if (Exito)
            {
                ViewBag.MensajeSuccess = MensajeSuccess;
            }

            model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual);
            model.Lst_det         = bus_banco_det.get_list(Convert.ToInt32(SessionFixed.IdEmpresa), model.IdBanco);
            Session["IdBancoPro"] = IdBanco;
            List_Det.set_list(model.Lst_det, model.IdTransaccionSession);
            return(View(model));
        }
Example #4
0
        public static void FileUploadComplete(object sender, DevExpress.Web.FileUploadCompleteEventArgs e)
        {
            #region Variables

            ba_Banco_Cuenta_List        ListaBanco  = new ba_Banco_Cuenta_List();
            List <ba_Banco_Cuenta_Info> Lista_Banco = new List <ba_Banco_Cuenta_Info>();
            ba_Banco_Cbte_List          ListaCbte   = new ba_Banco_Cbte_List();
            List <ba_Cbte_Ban_Info>     Lista_Cbte  = new List <ba_Cbte_Ban_Info>();
            tb_banco_Bus    bus_banco    = new tb_banco_Bus();
            tb_sucursal_Bus bus_sucursal = new tb_sucursal_Bus();

            int     cont = 0;
            decimal IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual);
            int     IdEmpresa            = Convert.ToInt32(SessionFixed.IdEmpresa);
            #endregion


            Stream stream = new MemoryStream(e.UploadedFile.FileBytes);
            if (stream.Length > 0)
            {
                IExcelDataReader reader = null;
                reader = ExcelReaderFactory.CreateOpenXmlReader(stream);

                #region Banco
                while (reader.Read())
                {
                    if (!reader.IsDBNull(0) && cont > 0)
                    {
                        ba_Banco_Cuenta_Info info = new ba_Banco_Cuenta_Info
                        {
                            IdEmpresa          = IdEmpresa,
                            IdBanco            = Convert.ToInt32(reader.GetValue(0)),
                            IdBanco_Financiero = Convert.ToInt32(reader.GetValue(1)),
                            ba_Tipo            = Convert.ToString(reader.GetValue(2)),
                            ba_Num_Cuenta      = Convert.ToString(reader.GetValue(3)),
                            ba_num_digito_cheq = Convert.ToInt32(reader.GetValue(4)),
                            IdCtaCble          = null,
                            IdUsuario          = SessionFixed.IdUsuario,
                        };
                        #region GetInfo
                        tb_banco_Info banco = bus_banco.get_info(info.IdBanco);
                        info.ba_descripcion          = banco.ba_descripcion + " " + info.ba_Tipo + " " + info.ba_Num_Cuenta;
                        info.Imprimir_Solo_el_cheque = false;
                        Lista_Banco.Add(info);
                        #endregion
                    }
                    else
                    {
                        cont++;
                    }
                }
                ListaBanco.set_list(Lista_Banco, IdTransaccionSession);
                #endregion

                cont = 0;
                //Para avanzar a la siguiente hoja de excel
                reader.NextResult();

                #region Cbte
                while (reader.Read())
                {
                    if (!reader.IsDBNull(0) && cont > 0)
                    {
                        ba_Cbte_Ban_Info info = new ba_Cbte_Ban_Info
                        {
                            IdEmpresa      = IdEmpresa,
                            IdTipo_Persona = Convert.ToString(reader.GetValue(0)),
                            Su_Descripcion = Convert.ToString(reader.GetValue(1)),
                            IdBanco        = Convert.ToInt32(reader.GetValue(2)),
                            cb_Fecha       = Convert.ToDateTime(reader.GetValue(3)),
                            cb_Observacion = Convert.ToString(reader.GetValue(4)),
                            cb_Valor       = Convert.ToInt32(reader.GetValue(5)),


                            IdUsuario = SessionFixed.IdUsuario,
                        };
                        #region GetInfo
                        tb_sucursal_Info sucursal = bus_sucursal.GetInfo(IdEmpresa, info.Su_Descripcion);
                        info.Su_Descripcion = sucursal.Su_Descripcion;
                        info.IdSucursal     = sucursal.IdSucursal;

                        Lista_Cbte.Add(info);
                        #endregion
                    }
                    else
                    {
                        cont++;
                    }
                }
                var ListCuenta = ListaBanco.get_list(IdTransaccionSession);

                var lst = (from q in ListCuenta
                           join c in Lista_Cbte
                           on q.IdBanco equals c.IdBanco
                           select new ba_Cbte_Ban_Info
                {
                    IdEmpresa = c.IdEmpresa,
                    IdTipo_Persona = c.IdTipo_Persona,
                    IdSucursal = c.IdSucursal,
                    ba_descripcion = q.ba_descripcion,
                    Su_Descripcion = c.Su_Descripcion,
                    IdBanco = c.IdBanco,
                    cb_Valor = c.cb_Valor,
                    cb_Fecha = c.cb_Fecha,
                    cb_Observacion = c.cb_Observacion
                }).ToList();

                Lista_Cbte = lst;
                ListaCbte.set_list(Lista_Cbte, IdTransaccionSession);
                #endregion
            }
        }