protected void Page_Load(object sender, EventArgs e) { WebUtility.AdminLoginAuth(); group = bll_adGroup.GetModel(Request.QueryString["gid"]); if (group == null) { WebUtility.ShowError(WebUtility.ERROR102); } if (!bll_admin.RuleAuth("广告_" + group.Title)) { WebUtility.ShowError(WebUtility.ERROR101); } if (group.Display == 1) { iPageSize = 20; } if (!Page.IsPostBack) { Action(); BindInfo(); } }
public bool DeleteAddGroup(AdGroupModel data) { try { IWebElement AdGroup = GetAddGroup(data); if (AdGroup != null) { Element.MoveTo(AdGroup); AdGroup.FindElement(By.CssSelector("button[data-ng-click='deleteGroup(adgroup)']")).Click(); IList <string> result = Wait.UntilToastMessageShow(); if (result.Any(e => e == "Delete error")) { throw new Exception("Unable to Delete old Group"); } } return(true); } catch (Exception ex) { if (ex.Message == "Unable to Delete old Group") { throw new Exception("Unable to Delete old Group"); } return(false); } }
protected void Page_Load(object sender, EventArgs e) { WebUtility.AdminLoginAuth(); group = bll_adGroup.GetModel(Request.QueryString["gid"]); if (group == null) { WebUtility.ShowError(WebUtility.ERROR102); } if (!bll_admin.RuleAuth("广告_" + group.Title)) { WebUtility.ShowError(WebUtility.ERROR101); } imageSpec = new Filespec().GetModelByCode("image"); if (imageSpec == null) { WebUtility.ShowError(WebUtility.ERROR103); } adFixed = bll_adFixed.GetModel(Request.QueryString["pkid"]); if (adFixed == null) { adFixed = new AdFixedModel(); } if (!Page.IsPostBack) { BindInfo(); } }
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { AdGroupModel adGroup = (AdGroupModel)e.Item.DataItem; ((HtmlTableCell)e.Item.FindControl("Eval_Display")).InnerText = XMLHelper.GetXmlDataVal(adGroup.Display.ToString(), "AdDisplay"); ((HtmlTableCell)e.Item.FindControl("Eval_Status")).InnerHtml = bll_adGroup.GetStatus(adGroup, "in"); ((HtmlTableCell)e.Item.FindControl("Eval_CreateTime")).InnerText = DateHelper.ToShortDate(adGroup.CreateTime); }
public bool CreateNewAddGroup(AdGroupModel data) { //this.OpenAdGroupPanel(); Element.ScrolToTop(); CreateAddGroupBtn.Click(); Wait.UntilDisply(AdGroupForm_AdTypeDD); this.FillAddGroupData(data); this.SaveAddGroup(data); return(true); }
public IWebElement GetAddGroup(AdGroupModel data) { this.OpenAdGroupPanel(); IWebElement AdGroup; IList <IWebElement> AddGroupList = AddGroupForm.FindElements(By.ClassName("box")); // AdGroup=AddGroupList.FirstOrDefault(e => e.FindElement(By.CssSelector("div[style='word-wrap:break-word;font-weight:bold']")).Text.Contains(data.GroupName)); AdGroup = AddGroupList.FirstOrDefault(e => e.Text.Contains(data.GroupName)); return(AdGroup); }
protected void Page_Load(object sender, EventArgs e) { WebUtility.AdminLoginAuth(); adGroup = bll_adGroup.GetModel(Request.QueryString["pkid"]); if (adGroup == null) { adGroup = new AdGroupModel(); } filespec = new Filespec().GetModelByCode("image"); if (filespec == null) { WebUtility.ShowError(WebUtility.ERROR103); } if (!Page.IsPostBack) { BindInfo(); } }
private void SaveAddGroup(AdGroupModel data) { this.AdGroupForm_SaveBtn.Click(); IList <string> Result = Wait.UntilToastMessageShow(); if (Result.Any(e => e == "Saved successfully")) { //AdGroupForm_CancelBtn.Click(); Wait.Second(1); Logger.Log(LogingType.TestCasePass, "Ad Group Save Successfully"); } else { AdGroupForm_CancelBtn.Click(); Wait.Second(1); Modal.DirtyclickYes(); Wait.MLSeconds(100); Logger.Log(LogingType.TextCaseFail, "Ad Group Save Failed - " + Result.ToString()); throw new Exception(String.Join(",", Result.ToArray())); } }
private void FillAddGroupData(AdGroupModel data) { if (!String.IsNullOrEmpty(data.ProductGroup)) { Select.ByText(AdGroupForm_ApplicationDD, data.ProductGroup); Wait.Second(2); } if (!String.IsNullOrEmpty(data.AddType)) { Select.ByText(AdGroupForm_AdTypeDD, data.AddType); Wait.MLSeconds(200); } if (!String.IsNullOrEmpty(data.GroupName)) { this.AdGroupForm_GroupNameField.Clear(); this.AdGroupForm_GroupNameField.SendKeys(data.GroupName); Wait.MLSeconds(200); } if (data.Impression != null) { this.AdGroupForm_ImpressionsField.Clear(); this.AdGroupForm_ImpressionsField.SendKeys(data.Impression.ToString()); Wait.MLSeconds(200); } if (data.Budget != null) { this.AdGroupForm_BudgetField.Clear(); this.AdGroupForm_BudgetField.SendKeys(data.Budget.ToString()); Wait.MLSeconds(200); } if (data.EndDate != null) { this.AdGroupForm_EndDateField.Clear(); this.AdGroupForm_EndDateField.SendKeys(data.EndDate.ToString()); Wait.MLSeconds(200); } }