Пример #1
0
        public ActionResult login()
        {
            try
            {
                dynamic pageObject = null, var_params = XVar.Array();
                XTempl  xt;
                CommonFunctions.add_nocache_headers();
                {
                    TLayout t_layout = null;

                    t_layout                    = new TLayout(new XVar("login_bootstrap"), new XVar("OfficeOffice"), new XVar("MobileOffice"));
                    t_layout.version            = 3;
                    t_layout.bootstrapTheme     = "default";
                    t_layout.customCssPageName  = "_login";
                    t_layout.blocks["top"]      = XVar.Array();
                    t_layout.containers["page"] = XVar.Array();
                    t_layout.containers["page"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "page_1"));
                    t_layout.containers["page_1"] = XVar.Array();
                    t_layout.containers["page_1"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "panel"));
                    t_layout.containers["panel"] = XVar.Array();
                    t_layout.containers["panel"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "header"));
                    t_layout.containers["header"] = XVar.Array();
                    t_layout.containers["header"].Add(new XVar("name", "loginheader", "block", "loginheader", "substyle", 1));

                    t_layout.skins["header"] = "";


                    t_layout.containers["panel"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "body"));
                    t_layout.containers["body"] = XVar.Array();
                    t_layout.containers["body"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "header_1"));
                    t_layout.containers["header_1"] = XVar.Array();
                    t_layout.containers["header_1"].Add(new XVar("name", "message", "block", "message_block", "substyle", 1));

                    t_layout.skins["header_1"] = "";


                    t_layout.containers["body"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "fields"));
                    t_layout.containers["fields"] = XVar.Array();
                    t_layout.containers["fields"].Add(new XVar("name", "loginfields", "block", "", "substyle", 1));

                    t_layout.skins["fields"] = "";


                    t_layout.containers["body"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "header_2"));
                    t_layout.containers["header_2"] = XVar.Array();
                    t_layout.containers["header_2"].Add(new XVar("name", "loginbuttons", "block", "loginbuttons", "substyle", 1));

                    t_layout.skins["header_2"] = "";


                    t_layout.containers["body"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "fb"));
                    t_layout.containers["fb"] = XVar.Array();
                    t_layout.containers["fb"].Add(new XVar("name", "facebookbutton", "block", "facebookbutton", "substyle", 1));

                    t_layout.skins["fb"] = "";


                    t_layout.skins["body"] = "";


                    t_layout.skins["panel"] = "";


                    t_layout.containers["page_1"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "register"));
                    t_layout.containers["register"] = XVar.Array();
                    t_layout.containers["register"].Add(new XVar("name", "bsloginregister", "block", "", "substyle", 1));

                    t_layout.skins["register"] = "";


                    t_layout.skins["page_1"] = "";


                    t_layout.skins["page"] = "";

                    t_layout.blocks["top"].Add("page");
                    GlobalVars.page_layouts["login"] = t_layout;
                }

                xt         = XVar.UnPackXTempl(new XTempl());
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(CommonFunctions.postvalue_number(new XVar("id")), "id");
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(Constants.PAGE_LOGIN, "pageType");
                var_params.InitAndSetArrayItem(Constants.GLOBAL_PAGES, "pageTable");
                var_params.InitAndSetArrayItem(false, "needSearchClauseObj");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("value_captcha_1")), "captchaValue");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("notRedirect")), "notRedirect");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("remember_password")), "rememberPassword");
                var_params.InitAndSetArrayItem(LoginPage.readLoginModeFromRequest(), "mode");
                var_params.InitAndSetArrayItem(LoginPage.readActionFromRequest(), "action");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("message")), "message");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("username")), "var_pUsername");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("password")), "var_pPassword");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("return")), "redirectAfterLogin");
                var_params.InitAndSetArrayItem(GlobalVars.cLoginTable, "tName");
                GlobalVars.pageObject = XVar.Clone(new LoginPage((XVar)(var_params)));
                GlobalVars.pageObject.init();
                GlobalVars.pageObject.process();
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
Пример #2
0
        public ActionResult login()
        {
            try
            {
                dynamic pageObject = null, var_params = XVar.Array();
                XTempl  xt;
                CommonFunctions.add_nocache_headers();
                {
                    TLayout t_layout = null;

                    t_layout                     = new TLayout(new XVar("login2"), new XVar("AvenueAvenue"), new XVar("MobileAvenue"));
                    t_layout.version             = 2;
                    t_layout.blocks["top"]       = XVar.Array();
                    t_layout.containers["login"] = XVar.Array();
                    t_layout.containers["login"].Add(new XVar("name", "loginheader", "block", "loginheader", "substyle", 2));

                    t_layout.containers["login"].Add(new XVar("name", "message", "block", "message_block", "substyle", 1));

                    t_layout.containers["login"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "fields"));
                    t_layout.containers["fields"] = XVar.Array();
                    t_layout.containers["fields"].Add(new XVar("name", "loginfields", "block", "", "substyle", 1));

                    t_layout.containers["fields"].Add(new XVar("name", "loginbuttons", "block", "loginbuttons", "substyle", 2));

                    t_layout.skins["fields"] = "fields";


                    t_layout.skins["login"] = "******";

                    t_layout.blocks["top"].Add("login");
                    GlobalVars.page_layouts["login"] = t_layout;

                    t_layout.skinsparams                        = XVar.Array();
                    t_layout.skinsparams["empty"]               = XVar.Array();
                    t_layout.skinsparams["empty"]["button"]     = "button2";
                    t_layout.skinsparams["menu"]                = XVar.Array();
                    t_layout.skinsparams["menu"]["button"]      = "button1";
                    t_layout.skinsparams["hmenu"]               = XVar.Array();
                    t_layout.skinsparams["hmenu"]["button"]     = "button1";
                    t_layout.skinsparams["undermenu"]           = XVar.Array();
                    t_layout.skinsparams["undermenu"]["button"] = "button1";
                    t_layout.skinsparams["fields"]              = XVar.Array();
                    t_layout.skinsparams["fields"]["button"]    = "button1";
                    t_layout.skinsparams["form"]                = XVar.Array();
                    t_layout.skinsparams["form"]["button"]      = "button1";
                    t_layout.skinsparams["1"]                   = XVar.Array();
                    t_layout.skinsparams["1"]["button"]         = "button1";
                    t_layout.skinsparams["2"]                   = XVar.Array();
                    t_layout.skinsparams["2"]["button"]         = "button1";
                    t_layout.skinsparams["3"]                   = XVar.Array();
                    t_layout.skinsparams["3"]["button"]         = "button1";
                }

                xt         = XVar.UnPackXTempl(new XTempl());
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("id")), "id");
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(Constants.PAGE_LOGIN, "pageType");
                var_params.InitAndSetArrayItem(Constants.NOT_TABLE_BASED_TNAME, "tName");
                var_params.InitAndSetArrayItem("login.cshtml", "templatefile");
                var_params.InitAndSetArrayItem(false, "needSearchClauseObj");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("value_captcha_1")), "captchaValue");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("notRedirect")), "notRedirect");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("remember_password")), "rememberPassword");
                var_params.InitAndSetArrayItem(LoginPage.readLoginModeFromRequest(), "mode");
                var_params.InitAndSetArrayItem(LoginPage.readActionFromRequest(), "action");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("message")), "message");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("username")), "var_pUsername");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("password")), "var_pPassword");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("return")), "redirectAfterLogin");
                GlobalVars.pageObject = XVar.Clone(new LoginPage((XVar)(var_params)));
                GlobalVars.pageObject.init();
                GlobalVars.pageObject.process();
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }