public ApplicationViewModel(CreateTeamPage createTeamPage, DernysPage dernysPage, LandingPage landingPage, EditCyclistPage editCyclistPage)
 {
     _createTeamPage = createTeamPage;
     _dernysPage = dernysPage;
     _landingPage = landingPage;
     _editCyclistPage = editCyclistPage;
     Navigate(typeof(LandingPage));
 }
예제 #2
0
        public void StartTest()
        {
            ExtentTest = Extent.CreateTest("SampleReporting");
            var LandingPage = new LandingPage(driver);
            var LoginPage   = LandingPage.ClickOnSignInButton();

            //LoginPage.EnterEmailOrMobileNumber("7620674796");
            //LoginPage.Continue();
            ExtentTest.Log(Status.Pass, "Pass");
            Extent.AddTestRunnerLogs("TestEnd");
        }
예제 #3
0
        public void CheckRegisterButtonIsOrangeLoggedUser()
        {
            var startPage = new LandingPage(this.driver);
            var loginPage = new Login(this.driver);

            loginPage.LogIntoServie(Properties.Settings.Default.UserAteam1, Properties.Settings.Default.PasswordAteam1);
            this.driver.Navigate().GoToUrl(Properties.Settings.Default.StartUrl);
            var regBtn = this.driver.FindElement(By.CssSelector("div[data-session]"));

            Assert.AreEqual("rgba(255, 119, 38, 1)", regBtn.GetCssValue("background-color"), "Registration button colour is not orange");
        }
예제 #4
0
        public async Task <ActionResult> Edit([Bind(Include = "LandingPageId,One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten,Eleven,Tweleve,Thirteen,Fourteen,Fifteen,Seventeen,Eighteen,Nineteen,Twenty,TwentyOne,TwentyTwo,TwentyThree,TwentyFour,TwentyFive,TwentySIx,TwentySeven,TwentyEight,TwentyNine,Thirty,ThirtyOne,ThirtyTwo,ThirtyThree,ThirtyFour,ThirtyFive,ThirtySix,ThirtySeven,ThirtyEight,ThirtyNine,Fourty,FourtyOne,fourtyTwo,FourtyThree,FourtyFour")] LandingPage landingPage)
        {
            if (ModelState.IsValid)
            {
                db.Entry(landingPage).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(landingPage));
        }
예제 #5
0
        /// <summary>
        /// 取得 LandingPage 詳細資料
        /// </summary>
        /// <param name="urlPart">自定義網址</param>
        /// <returns>Landing Page entity model</returns>
        public LandingPage GetLandingPage(string urlPart)
        {
            LandingPage landingPage = new LandingPage();

            if (!string.IsNullOrEmpty(urlPart))
            {
                landingPage = landingPageService.GetLandingPageData(urlPart);
            }

            return(landingPage);
        }
        public void GivenUserNavigatesToThePMSearchPageFromReceviersModal()
        {
            IJavaScriptExecutor jse         = (IJavaScriptExecutor)driver;
            LandingPage         landingPage = new LandingPage();

            Thread.Sleep(2000);
            landingPage.NagivagetoWelcomePage();
            driver.Manage().Window.Maximize();
            landingPage.lblPlantName.Click();
            Thread.Sleep(5000);
        }
예제 #7
0
 public void CreateAndDeleteRepo()
 {
     loginPage        = LoginPage.Goto(_driver);
     landingPage      = loginPage.LogIntoGithub(testAccLogin, testAccPassword);
     repoCreationPage = landingPage.StartRepoCreation();
     repositoryPage   = repoCreationPage.CreateNewRepoWithReadMe(repositoryName);
     repositoryPage.AddReadmeFile();
     settingsPage = repositoryPage.GoToSettings();
     landingPage  = settingsPage.DeleteRepo(repositoryName);
     Assert.IsFalse(landingPage.IsRepoPresent(repositoryName));
 }
예제 #8
0
        //
        public ActionResult Index(int id = 0)
        {
            LandingPage page = new LandingPage().Get(id);
            if (page == null || (page != null && page.id == 0)) {
                return RedirectToAction("Index", "Index");
            }

            ViewBag.landingPage = page;

            return View();
        }
예제 #9
0
        public override void TearDown()
        {
            Console.WriteLine("Before base");
            base.TearDown();
            Console.WriteLine("After base");

            if (!string.IsNullOrEmpty((LandingPage.UserName)))
            {
                LandingPage.LogOut();
            }
        }
예제 #10
0
        public ActionResult Past()
        {
            int websiteID = ViewBag.websiteID ?? 0;
            if (websiteID == 0) {
                return RedirectToAction("Index", "Website");
            }
            List<LandingPage> landingPages = new LandingPage().GetAllPast();
            ViewBag.landingPages = landingPages;

            return View();
        }
예제 #11
0
        public void CanLogIn()
        {
            _loginPage.GoTo();
            _driver.Url.Should().Be(LoginPage.PageUrl);

            _loginPage.FillUserPassword();
            _landingPage = _loginPage.Login();

            _driver.Url.Should().Be(LandingPage.PageUrl);
            _landingPage.IsAt().Should().BeTrue();
        }
예제 #12
0
        public void Test01()
        {
            var landingPage = new LandingPage(Session);

            landingPage.Go();

            var checkBoxPage = landingPage.NavigateToCheckboxesPage();

            Thread.Sleep(5000);

            checkBoxPage.Close();
        }
예제 #13
0
        public void Submit_EmptyPasswordError()
        {
            const string expectedError = "Password is required";

            LandingPage landingPage = new LandingPage(driver);

            LoginPage loginPage = landingPage.ClickLogin();

            loginPage.ClickSubmit();

            Assert.AreEqual(expectedError, loginPage.GetPasswordError());
        }
예제 #14
0
        public void EditParticipantMaximumNumberDefinition()
        {
            var loginPage = new Login(this.driver);

            loginPage.LogIntoServie(Properties.Settings.Default.UserAteam1, Properties.Settings.Default.PasswordAteam1);
            var dashboard = new Dashboard(this.driver);

            dashboard.AddSessionButton.Click();
            var session = new AddSession(this.driver);

            session.SessionLink.Click();
            var sessionData = new SessionData();

            sessionData.PlaceForSession   = 5;
            sessionData.IsSpacePerSession = true;
            sessionData.LevelAdvanced     = false;
            sessionData.LevelExpert       = false;
            sessionData.LevelOther        = false;
            sessionData.IstqbAdvancedLevelTechnicalTestAnalystEnglishPolish = false;
            sessionData.IstqbAdvancedLevelTestAnalystEnglishPolish          = false;
            sessionData.IstqbAdvancedLevelTestManagerEnglishPolish          = false;
            sessionData.IstqbAgileTesterExtensionEnglishPolish = false;
            sessionData.ReqbFoundationLevelEnglishPolish       = false;
            sessionData.IstqbImprovingTheTestProcessEnglish    = false;
            sessionData.IstqbTestManagementEnglish             = false;
            session.Populate(sessionData);
            var text = this.driver.VisibleText();

            Assert.IsTrue(text.Contains("ISTQB Foundation Level"));
            session.SaveSession.Click();
            Thread.Sleep(1500);
            text = this.driver.VisibleText();
            Assert.IsTrue(text.Contains(sessionData.SessionDate.ToString("HH:mm")));
            Assert.IsTrue(text.Contains(sessionData.PlaceForSession.ToString()));
            Assert.IsTrue(text.Contains(sessionData.PostCode));
            Assert.IsTrue(text.Contains(sessionData.Address));
            Assert.IsTrue(text.Contains(sessionData.City));
            session.DashboardLink.Click();
            var landingPage = new LandingPage(this.driver);

            landingPage.PgsLogo.Click();
            dashboard.DashboardLink.Click();
            dashboard.SwitchMonthByDate(sessionData.SessionDate);
            WebDriverExtensions.WaitForAjax(this.driver);
            dashboard.ClickSessionLinkNoCheck(sessionData.City);
            dashboard.EditSessionLink.Click();
            var    editSession = new EditSession(this.driver);
            string s           = editSession.SpaceForSession.Text;

            editSession.SpacePerProduct.Click();
            Assert.Equals(s, editSession.SpacePerProduct.Text);
        }
예제 #15
0
 public void EF_Master_Resident_List()
 {
     Browser.Open();
     LoginPage.SignIn();
     //Step 1  Select Reports &Forms Tile.
     LandingPage.NavigateToReportsFormsPage();
     //Step 2  Select the Master Resdient List option from the left hand navigation bar.
     DashboardPage.NavigateToMDSMasterResidentList();
     //Step 3  Click the Create Report Button.
     Driver.ClickOn(MDSMasterResidentListPage.createReportButton);
     //Step 4  "Leave the default neighborhood <All Neighborhoods>.
     //Click the Confirm button."
     Driver.ClickOn(MDSMasterResidentListPage.confirmBtn);
     //Step 5  Verify Each Column for the report is displayed with information pertaining to a particular resident.
     MDSMasterResidentListPage.VerifyColumnList("//td[@style='text-align: left;'][1]");
     MDSMasterResidentListPage.VerifyColumnList("//td[@style='text-align: left;'][2]");
     MDSMasterResidentListPage.VerifyColumnList("//td[@style='text-align: left;'][3]");
     MDSMasterResidentListPage.VerifyColumnList("//td[@style='text-align: left;'][4]");
     MDSMasterResidentListPage.VerifyColumnList("//td[@style='text-align: left;'][5]");
     MDSMasterResidentListPage.VerifyColumnList("//td[@style='text-align: left;'][6]");
     MDSMasterResidentListPage.VerifyColumnList("//td[@style='text-align: left;'][7]");
     MDSMasterResidentListPage.VerifyColumnList("//td[@style='text-align: right;'][1]");
     MDSMasterResidentListPage.VerifyColumnList("//td[@style='text-align: left;'][8]");
     MDSMasterResidentListPage.VerifyColumnList("//td[@style='text-align: left;'][9]");
     //Step 6  Verify If a neighborhood is not displayed that the Status of that resident is inactive.
     //Step 7  "Select 5 random residents from the list.
     Driver.ClickOn(By.XPath("(//div[@class='dx-checkbox-container'])[1]"));
     //Open a VistA terminal window and follow the attached document to verify that the information displayed in the report is the same information that is displayed in VistA."
     //Step 8  "Select a column Header and drag it to the column grouping area.
     //Verify that the report then sorts according to the header that was dragged to the column grouping area."
     //Step 9  "Drag the header back into the report.
     //Verify the sorting of the report is back to its origional state."
     //Step 10 Click the Export button.
     //Step 11 Click the Excel File option.
     //Step 12 "Select Save.
     //Save the exported report to the local computer.
     //Once it has been saved opn the saved document."
     //Step 13 Verify the report matches what is displayed on the Caribou MDS website.
     //Step 14 Close the saved document and return to the Caribou MDS website where the Master Resdient list is displayed.
     //Step 15 "Click the Export button.
     //Click the checkbox for selected rows.
     //Select rows from the report by checking the checkbox withing the respective column for that resident.
     //Click the Export button again.
     //Click the Excel File option.
     //Save the report to the local computer.
     //Once saved, open the report.
     //Verify the report matches what was selected previously to be displayed on the report."
     //Step 16 Close the saved document and return to the Caribou MDS website where the master resident list report is displayed.
     //Step 17 Click the Column Chooser button on the right side of the Master Resident Report.
     //Step 18 "Drag a column from the report into the column chooser dialog box.
     //Verify that once the column is displayed in the column chooser dialog box, the column is then taken off of the report and hidden."
 }
예제 #16
0
        public void VerifyARLandingPageDefaults()
        {
            Initialize();
            LandingPage.SelectFromToolbar("AR");

            Factory.AssertIsTrue(ARWindow.VerifyInvoices("All"), "UnPaid invoices are not displayed as All");
            Factory.AssertIsTrue(ARWindow.VerifyMyOrg("Is Collecting"), "My Org is not equal to Is Collecting on landing page");
            Factory.AssertIsTrue(ARWindow.VerifyOverDueDisplayed(), "Over dues are not displayed");
            //Factory.AssertIsTrue(ARWindow.VerifyCustomerProfileWindowDisplayedWhenCustomerNumberClicked(),
            //    "Customer profile page is not displayed when customer on landing page is clicked");

            Cleanup();
        }
        public ActionResult Edit(LandingPage landingPage)
        {
            if (ModelState.IsValid)
            {
                db.Entry(landingPage).State = EntityState.Modified;

                db.SaveChanges();

                return(RedirectToAction("Index", new { controller = "Home" }));
            }

            return(View(landingPage));
        }
예제 #18
0
        public void Submit_InvalidEmailFormatError()
        {
            const string expectedError = "Email is invalid";

            LandingPage landingPage = new LandingPage(driver);

            LoginPage loginPage = landingPage.ClickLogin();

            loginPage.EnterEmail("invalid")
            .ClickSubmit();

            Assert.AreEqual(expectedError, loginPage.GetEmailError());
        }
예제 #19
0
        public void load()
        {
            LandingPage land = new LandingPage();

            land = db.LandingPages.FirstOrDefault();
            db.Dashboards.FirstOrDefault();

            _mapper.Map(land, this);
            //Header = land?.Header??"";
            //Body = land?.Body??"";
            //ProductDetail = land?.ProductDetail ?? "";
            //logo = land?.logo ?? "";
        }
예제 #20
0
        public void Submit_AccountDoesNotExistError()
        {
            const string expectedError = "User not found";

            LandingPage landingPage = new LandingPage(driver);

            LoginPage loginPage = landingPage.ClickLogin();

            loginPage.EnterUsernamePassword(Users.InvalidUser)
            .ClickSubmit();

            Assert.AreEqual(expectedError, loginPage.GetEmailError());
        }
예제 #21
0
        public void Submit_IncorrectPasswordError()
        {
            const string expectedError = "Password is incorrect";

            LandingPage landingPage = new LandingPage(driver);

            LoginPage loginPage = landingPage.ClickLogin();

            loginPage.EnterUsernamePassword(Users.IncorrectPasswordUser)
            .ClickSubmit();

            Assert.AreEqual(expectedError, loginPage.GetPasswordError());
        }
        public ActionResult Create(LandingPage landingPage)
        {
            if (ModelState.IsValid)
            {
                db.LandingPages.Add(landingPage);

                db.SaveChanges();

                return(RedirectToAction("Index"));
            }

            return(View(landingPage));
        }
예제 #23
0
 public void CK_WIP___Verify_CAA_complete_by_date()
 {
     Browser.Open();
     LoginPage.SignIn();
     //Step 1  Select Work In Progress tile.
     LandingPage.NavigateToWorkInProgressPage();
     //Step 2  "Uncheck PPS assessments form on Work In Progress page
     Driver.ClickOn(WorkInProgressPage.ppsFilterButtonChecked);
     //        Admission assessment
     //        Annual assessment"
     //Step 3  Verify that CAA Complete by Date Column has displayed correctly on Work In Progress page for Admission assessment
     //Step 4  Verify that Complete by Date Column has displayed correctly on Work In Progress  for Annual assessment
 }
        public void GivenINavigateToTheAddProductsPage()
        {
            LandingPage landingPage = new LandingPage(driver);

            wait.Until(ExpectedConditions.ElementIsVisible(landingPage.shortcutMenuIcon));
            landingPage.menuIcon.Click();
            wait.Until(ExpectedConditions.ElementIsVisible(LandingPage.addProduct));
            landingPage.addProductMenu.Click();

            AddProductsPage addProductsPage = new AddProductsPage(driver);

            wait.Until(ExpectedConditions.ElementIsVisible(addProductsPage.detailsTab));
        }
예제 #25
0
        public void ARDefaultToAllCorporateARMUserTest()
        {
            WindowsActions.KillEllisProcesses();
            App = EllisHome.LaunchEllisAsARMUser();

            LandingPage.SelectFromToolbar("AR");
            SearchWindow.SelectSearchElements(null, "ITransactions", SearchWindow.SearchTypeConstants.Advanced);

            Factory.AssertIsTrue(ARAdvancedSearchWindow.VerifyDefaultDistrictSelected("All"),
                                 "Default district is not equal to All");

            Cleanup();
        }
 public new void TestIntialize()
 {
     base.TestIntialize();
     _landingPage = new LandingPage();
     _login       = _landingPage.NavigateToLoginPage();
     _dashBoard   = _login.EnterCredentialsAndLogin();
     _dashBoard.ClearShoppingCart();
     _dashBoard.SelectFictionBook();
     _dashBoard.EnterRandomQuantity();
     _dashBoard.AddToCart();
     _dashBoard.NavigateToShoppingCart();
     _checkout = _dashBoard.NavigateToCheckOutPage();
 }
        public void INavigateToTheAddSalesQuotePage()
        {
            LandingPage landingPage = new LandingPage(driver);

            wait.Until(ExpectedConditions.ElementIsVisible(landingPage.shortcutMenuIcon));
            landingPage.menuIcon.Click();
            wait.Until(ExpectedConditions.ElementIsVisible(LandingPage.addQuote));
            landingPage.addQuoteMenu.Click();

            SalesQuotePage salesQuotePage = new SalesQuotePage(driver);

            wait.Until(ExpectedConditions.ElementIsVisible(salesQuotePage.salesInvoiceTable));
        }
예제 #28
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            getJoke.TouchUpInside += (sender, e) =>
            {
                //9a. View Controller
                var landingController = new LandingPage().CreateViewController();

                //9b. Navigate to it
                NavigationController.PushViewController(landingController, true);
            };
        }
예제 #29
0
        public void GivenIAmInSignInPage()
        {
            LandingPage        landingPage = new LandingPage();
            AuthenticationPage signInPage  = new AuthenticationPage();

            Driver.Manage().Window.Maximize();
            Driver.Navigate().GoToUrl("http://automationpractice.com/index.php");
            Assert.IsTrue(Driver.Title.ToLower().Contains("my store"));
            Wait.Until(condition => condition.FindElement(By.ClassName("login")));
            landingPage.ClickSignIn();
            Wait.Until(condition => condition.FindElement(By.Id("SubmitCreate")));
            Assert.IsTrue(signInPage.IsVisible());
        }
예제 #30
0
        public void RegisterMultiUserToDifferentExmasWithLoggedInUser()
        {
            var startPage = new LandingPage(this.driver, true);
            var loginPage = new Login(this.driver);

            loginPage.LogIntoServie(Properties.Settings.Default.UserAteam1, Properties.Settings.Default.PasswordAteam1);
            startPage.PgsLogo.Click();
            var sessionId  = startPage.GetExistingSessionIdWithFreePlacesAndManyExams(4, 3);
            var examButton = this.driver.FindElement(By.CssSelector(string.Format("div[data-session='{0}']", sessionId)));

            examButton.FocusAtElement(this.driver);
            examButton.Click();
            var attendee     = new Attendee();
            var getAttendees = new GetAttendees(this.driver);

            getAttendees.Email.WaitForElement(1000);
            getAttendees.Populate(attendee);
            Assert.IsTrue(getAttendees.AddUserToList.Displayed);
            getAttendees.AddUserToList.Click();

            var attendee2 = new Attendee();

            attendee2.SelectedProductId = 1;
            getAttendees.Email.WaitForElement(1000);
            getAttendees.Populate(attendee2);
            Assert.IsTrue(getAttendees.AddUserToList.Displayed);
            getAttendees.AddUserToList.Click();
            Assert.IsTrue(this.driver.VisibleText().Contains("Uczestnicy\r\n2"));

            var attendee3 = new Attendee();

            attendee3.SelectedProductId = 2;
            getAttendees.Email.WaitForElement(1000);
            getAttendees.Populate(attendee3);
            Assert.IsTrue(getAttendees.AddUserToList.Displayed);
            getAttendees.AddUserToList.Click();
            Assert.IsTrue(this.driver.VisibleText().Contains("Uczestnicy\r\n3"));

            getAttendees.Forward.Click();
            var getPersonData = new GetPersonData(this.driver);
            var personData    = new ContactData();

            getPersonData.Populate(personData);
            getPersonData.Forward.Click();
            var getAddress = new GetAddress(this.driver);

            getAddress.Populate(personData);
            getAddress.Forward.Click();
            Assert.IsTrue(this.driver.VisibleText().Contains("Dziękujemy za zapisanie się na egzamin"));
            Assert.IsTrue(this.driver.VisibleText().Contains(personData.PersonDataEmail));
        }
예제 #31
0
        public void LoginComplete()
        {
            var page = landing = new LandingPage();

            LoLClient.QueueManager = landing;
            ContentFrame.Content   = page;

            if (Session.Current.LoginQueue.InGameCredentials?.InGame ?? false)
            {
                Session.Current.Credentials = Session.Current.LoginQueue.InGameCredentials;
                Session.Current.JoinGame();
                Session.Current.LoginQueue.InGameCredentials.InGame = false;
            }
        }
예제 #32
0
        /// <summary>
        /// Update an existnig LandingPage
        /// </summary>
        /// <returns>The LandingPage as returned from the API</returns>
        public LandingPage UpdateLandingPage(LandingPage landingPage)
        {
            RestRequest request = new RestRequest(Method.PUT)
            {
                Resource      = "/assets/landingPage/" + landingPage.id,
                RequestFormat = DataFormat.Json
            };

            request.AddBody(landingPage);

            IRestResponse <LandingPage> response = _client.Execute <LandingPage>(request);

            return(response.Data);
        }
예제 #33
0
 public void VerifyApp_version()
 {
     Currentpage = new LandingPage();
     Currentpage.As <LandingPage>().ClickOn_SignINwithEmailidLink();
     Currentpage = new SignInEmail();
     ExcelUtil.PopulateInCollection("./TestDataWestband.xlsx", "LoginData");
     Currentpage.As <SignInEmail>().SignIn(ExcelUtil.ReadData(3, "Userid"), ExcelUtil.ReadData(3, "Password"));
     Currentpage = new UserLoggedInPage();
     Currentpage.As <UserLoggedInPage>().Waitingelement_UserLogged(Currentpage.As <UserLoggedInPage>().Snakbar_Successfullmessage);
     Currentpage.As <UserLoggedInPage>().Waitingelement_UserLogged(Currentpage.As <UserLoggedInPage>().AllPolicyDisplayScreen);
     Currentpage.As <UserLoggedInPage>().ClickMenuBarTap();
     Currentpage.As <UserLoggedInPage>().ClickOnAnyLink(UserLoggedInPage.MenuBar_AccountSetting);
     // AppResult[] results = app.Query(x=>x.All());
 }
예제 #34
0
        public ActionResult Edit(int id = 0, string error = "")
        {
            int websiteID = ViewBag.websiteID ?? 0;
            if (websiteID == 0) {
                return RedirectToAction("Index", "Website");
            }
            List<Website> websites = new Website().GetAll();
            ViewBag.websites = websites;

            LandingPage landingPage = new LandingPage().Get(id);
            ViewBag.landingPage = landingPage;

            ViewBag.error = error;

            return View();
        }
예제 #35
0
    protected override void OnInit(EventArgs e)
    {
        LandingRepository landingRepository = new LandingRepository();
        landingPage = landingRepository.GetLandingPage(GeneralExtensions.GetQueryStringId());

        CommonRepository commonRepository = new CommonRepository();
        UserExtensions userExtensions = new UserExtensions();

        if (userExtensions.IsUserLoggedIn() && System.Web.HttpContext.Current.Request.RawUrl.Contains("resources"))
        {
            ltlServices.Text = commonRepository.GetServices("MemberResourcesCollectionId".GetAppKeyLong());
        }
        else
        {
            ltlServices.Text = commonRepository.GetServices(landingPage.ServicesCollectioId.ConvertToLong());

        }
    }
예제 #36
0
		protected override bool AuthorizeCore(HttpContextBase httpContext)
		{
			if (AllowAccess == AccessType.AnonymAccessOnly)
			{
				if (httpContext.Request.IsAuthenticated)
				{
					_landingPage = AccessHelper.GetLandingPage();
					return false;
				}
				else
					return true;
			}

			if (AllowAccess == AccessType.RegisteredUsers)
				return httpContext.Request.IsAuthenticated;

			bool isAllowedByRoles = base.AuthorizeCore(httpContext);

			if (!isAllowedByRoles)
			{
				if (!String.IsNullOrEmpty(httpContext.User.Identity.Name))
					_landingPage = AccessHelper.GetLandingPage();
				return false;
			}
			else
			{
				var routeValueDictionary = httpContext.Request.RequestContext.RouteData.Values;
				string controllerName = routeValueDictionary["controller"].ToString();
				string actionName = routeValueDictionary["action"].ToString();

				bool isAllowedByStatus = AccessHelper.IsActionAvaibleByStatus(controllerName, actionName, NormalizedRoles);
				if (!isAllowedByStatus)
				{
					_landingPage = AccessHelper.GetLandingPage();
				}

				return isAllowedByStatus;
			}
		}
예제 #37
0
 public string RemoveData(int id)
 {
     List<LandingPageData> datas = new List<LandingPageData>();
     datas = new LandingPage().RemoveData(id);
     return JsonConvert.SerializeObject(datas);
 }
예제 #38
0
 public string AddImage(int pageID, string image)
 {
     List<LandingPageImage> images = new List<LandingPageImage>();
     images = new LandingPage().AddImage(pageID, image);
     return JsonConvert.SerializeObject(images);
 }
예제 #39
0
 public string AddData(int pageID, string key, string value)
 {
     List<LandingPageData> datas = new List<LandingPageData>();
     datas = new LandingPage().AddData(pageID, key, value);
     return JsonConvert.SerializeObject(datas);
 }
예제 #40
0
        public ActionResult Save(int id = 0)
        {
            string name = Request.Form["name"] ?? null;
            int websiteID = (Request.Form["website"] != "") ? Convert.ToInt32(Request.Form["website"]) : 0;
            DateTime startDate = Convert.ToDateTime(Request.Form["startDate"]);
            DateTime endDate = Convert.ToDateTime(Request.Form["endDate"]);
            string url = Request.Form["url"] ?? "";
            string content = String.IsNullOrWhiteSpace(Request.Form["page_content"]) ? null : Request.Form["page_content"];
            string linkClasses = String.IsNullOrWhiteSpace(Request.Form["linkClasses"]) ? null : Request.Form["linkClasses"];
            string conversionID = String.IsNullOrWhiteSpace(Request.Form["conversionID"]) ? null : Request.Form["conversionID"];
            string conversionLabel = String.IsNullOrWhiteSpace(Request.Form["conversionLabel"]) ? null : Request.Form["conversionLabel"];
            bool newWindow = (Request.Form["newWindow"] == null) ? false : true;
            string menuPosition = Request.Form["menuPosition"];
            string error = "";

            LandingPage landingPage = new LandingPage();

            if (name == null || websiteID == 0) {
                error = "Please fill out all required fields";
                if (id == 0) {
                    return RedirectToAction("Add");
                }
            } else {
                try {
                    landingPage = landingPage.Save(id, name, websiteID, startDate, endDate, url, content, linkClasses, newWindow, conversionID, conversionLabel, menuPosition);
                    id = landingPage.id;
                } catch (Exception e) {
                    error = e.Message + " " + e.StackTrace;
                }
            }

            return RedirectToAction("Edit", new { id = id, error = error });
        }
예제 #41
0
 public string RemoveImage(int id)
 {
     List<LandingPageImage> images = new List<LandingPageImage>();
     images = new LandingPage().RemoveImage(id);
     return JsonConvert.SerializeObject(images);
 }