예제 #1
0
    protected void AfterSave(object sender, EventArgs e)
    {
        if (GetUpperNewsletterSource() != NewsletterSource.Dynamic)
        {
            var templateIDsString = ValidationHelper.GetString(NewForm.GetFieldValue("NewsletterTemplateIDs"), "");
            AddTemplatesToNewsletter(templateIDsString);
        }

        if ((GetUpperNewsletterSource() == NewsletterSource.Dynamic) && chkSchedule.Checked)
        {
            // If Scheduling is enabled, create task
            CreateTask();
        }
        else
        {
            // Redirect to newly created newsletter
            Redirect();
        }
    }
예제 #2
0
    protected void ValidateValues(object sender, EventArgs e)
    {
        // Validate unsubscription template
        if (ValidationHelper.GetInteger(NewForm.GetFieldValue("NewsletterUnsubscriptionTemplateID"), 0) == 0)
        {
            ShowError(GetString("Newsletter_Edit.NoUnsubscriptionTemplateSelected"));
            NewForm.StopProcessing = true;
        }

        // Validate subscription template
        if (IsNewsletterType() && ValidationHelper.GetInteger(NewForm.GetFieldValue("NewsletterSubscriptionTemplateID"), 0) == 0)
        {
            ShowError(GetString("Newsletter_Edit.NoSubscriptionTemplateSelected"));
            NewForm.StopProcessing = true;
        }

        // If Dynamic, validate schedule interval and Source page URL
        if (GetUpperNewsletterSource() == NewsletterSource.Dynamic)
        {
            if (ValidationHelper.GetString(NewForm.GetFieldValue("NewsletterDynamicURL"), string.Empty) == string.Empty)
            {
                // Source page URL can not be empty
                ShowError(GetString("newsletter_edit.sourcepageurlempty"));
                NewForm.StopProcessing = true;
            }

            if (chkSchedule.Checked)
            {
                if (!ScheduleInterval.CheckOneDayMinimum())
                {
                    // Problem occurred while setting schedule interval for dynamic newsletter
                    ShowError(GetString("Newsletter_Edit.NoDaySelected"));
                    NewForm.StopProcessing = true;
                }

                if (SchedulingHelper.DecodeInterval(ScheduleInterval.ScheduleInterval).StartTime == DateTime.MinValue)
                {
                    ShowError(GetString("Newsletter.IncorrectDate"));
                    NewForm.StopProcessing = true;
                }
            }
        }
    }
예제 #3
0
        public void TestMethod()
        {
            IWebDriver driver = new ChromeDriver();

            driver.Url = "C:\\Users\\admin\\Documents\\Training\\html_hw\\index.html";

            NewForm NF = new NewForm(driver);

            NF.IndexAssertion();
            NF.addNewForm();

            Employee employee = EmployeesCreator.createEmployee();

            NewEmployee NE = new NewEmployee(driver);

            NE.AddNewEmployee(employee);

            NF.IndexAssertion();

            driver.Close();
        }
        private void Command()
        {
            INewForm rf = new NewForm();

            rf.Types        = Enum.GetNames(typeof(ToolTypes));
            rf.SelectedType = ToolTypes.CAN;
            if (rf.ShowDialog() == DialogResult.OK)
            {
                if (_table.FirstOrDefault(n => n.Name == rf.NewName) != null)
                {
                    MessageBox.Show(CultureService.Instance.GetString(CultureText.text_AlreadyExists), Application.CompanyName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (string.IsNullOrWhiteSpace(rf.NewName) || string.IsNullOrEmpty(rf.NewName))
                {
                    MessageBox.Show(CultureService.Instance.GetString(CultureText.text_TheFieldCantBeEmtpy), Application.CompanyName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    _table.Add(new ToolTableItem(rf.NewName, rf.SelectedType));
                }
            }
        }
예제 #5
0
 private EmailCommunicationTypeEnum GetSelectedCommunicationType()
 {
     return((EmailCommunicationTypeEnum)ValidationHelper.GetInteger(NewForm.GetFieldValue("NewsletterType"), 0));
 }
예제 #6
0
 /// <summary>
 /// Returns newsletter source (upper).
 /// </summary>
 /// <returns>Newsletter source string</returns>
 private string GetUpperNewsletterSource()
 {
     return(ValidationHelper.GetString(NewForm.GetFieldValue("NewsletterSource"), "").ToUpperInvariant());
 }
예제 #7
0
 /// <summary>
 /// Returns newsletter type (upper).
 /// </summary>
 /// <returns>Newsletter Type string</returns>
 private string GetUpperNewsletterType()
 {
     return(ValidationHelper.GetString(NewForm.GetFieldValue("NewsletterType"), "").ToUpperCSafe());
 }
        private void button1_Click_1(object sender, EventArgs e)
        {
            NewForm f1 = new NewForm();

            f1.show();
        }
        /// <summary>
        /// ͼ�δ洢���ϵȡ�
        /// </summary>		
        private void menuNew_Click(object sender, System.EventArgs e)
        {
            drawingList = new DShapeList();
            drawingListUndo = new DShapeList();
            tempPoint = new DShapeList();
            pointViewList = new DShapeList();
            notchangeList = new DShapeList();
            notchangeListUndo = new DShapeList();

            newForm = new NewForm();
            newCircle = new CircleForm();

            pointCollection = new ArrayList();

            regionCollection = new NewRegion();
            regionCollectionUndo = new NewRegion();
            pointArray = new PointArrayCollection();
            pointArrayUndo = new PointArrayCollection();

            regionArrayCollection = new NewRegionArray();
            regionArrayCollectionUndo = new NewRegionArray();
            drawImageType = new Type();
            drawImageTypeUndo = new Type();
            newType = ImageType.Empty;

            picked = false;
            changed = false;
            mouseMove = false;
            eraser = false;
            regionIndex = 0;

            Drawing.Invalidate();

            fileName = "NewFile";
            SetFormTitle();
        }