Exemplo n.º 1
0
        public ActionResult editarCuenta(long?editID)
        {
            if (Session["USER_ID"] != null)
            {
                if (Session["CURRENT_COMU"] != null)
                {
                    if (editID != null)
                    {
                        try
                        {
                            long userId       = (long)Session["USER_ID"];
                            long communityAct = Convert.ToInt64(Session["CURRENT_COMU"]);
                            bank banItem      = entities.banks.Where(m => m.id == editID).FirstOrDefault();
                            if (banItem != null)
                            {
                                user curUser = entities.users.Find(userId);
                                List <ShowMessage> pubMessageList = ep.GetChatMessages(userId);
                                BancosViewModel    viewModel      = new BancosViewModel();

                                titulosList             = ep.GetTitulosByTitular(userId);
                                listComunities          = ep.GetCommunityListByTitular(titulosList);
                                viewModel.communityList = listComunities;

                                viewModel.side_menu              = "cuotas";
                                viewModel.side_sub_menu          = "bancos_listado";
                                viewModel.document_category_list = entities.document_type.Where(x => x.community_id == communityAct).ToList();
                                viewModel.curUser        = curUser;
                                viewModel.pubTaskList    = ep.GetNotifiTaskList(userId);
                                viewModel.pubMessageList = pubMessageList;
                                viewModel.messageCount   = ep.GetUnreadMessageCount(pubMessageList);
                                viewModel.bankItem       = banItem;
                                return(View(viewModel));
                            }
                            else
                            {
                                return(Redirect(Url.Action("listadoCuentas", "cuotas", new { area = "coadmin", Error = "No existe ese elemento" })));
                            }
                        }
                        catch (Exception ex)
                        {
                            return(Redirect(Url.Action("Index", "Error")));
                        }
                    }
                    else
                    {
                        return(Redirect(Url.Action("NotFound", "Error")));
                    }
                }
                else
                {
                    return(Redirect(Url.Action("listadoCuentas", "cuotas", new { area = "coadmin", Error = "No puede editar cuentas. Usted no administra ninguna comunidad. Comuníquese con el Webmaster..." })));
                }
            }
            else
            {
                return(Redirect(ep.GetLogoutUrl()));
            }
        }
Exemplo n.º 2
0
        public ActionResult listadoCuentas(string Error)
        {
            if (Session["USER_ID"] != null)
            {
                try
                {
                    long            userId    = (long)Session["USER_ID"];
                    user            curUser   = entities.users.Find(userId);
                    BancosViewModel viewModel = new BancosViewModel();

                    communityList           = ep.GetCommunityList(userId);
                    viewModel.communityList = communityList;
                    long communityAct = Convert.ToInt64(Session["CURRENT_COMU"]);

                    List <bank> bankList = new List <bank>();

                    if (Session["CURRENT_COMU"] != null)
                    {
                        bankList = entities.banks.ToList();
                    }
                    else
                    {
                        bankList.Clear();
                    }

                    List <ShowMessage> pubMessageList = ep.GetChatMessages(userId);
                    viewModel.banks                  = bankList;
                    viewModel.side_menu              = "cuotas";
                    viewModel.side_sub_menu          = "bancos_listado";
                    viewModel.document_category_list = entities.document_type.Where(x => x.community_id == communityAct).ToList();
                    viewModel.curUser                = curUser;
                    viewModel.pubTaskList            = ep.GetNotifiTaskList(userId);
                    viewModel.pubMessageList         = pubMessageList;
                    viewModel.messageCount           = ep.GetUnreadMessageCount(pubMessageList);
                    ViewBag.msgError                 = Error;
                    return(View(viewModel));
                }
                catch (Exception ex)
                {
                    return(Redirect(Url.Action("Index", "Error")));
                }
            }
            else
            {
                return(Redirect(ep.GetLogoutUrl()));
            }
        }