示例#1
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            base.AddCommandLineArguments(arguments);

            if (BaseProjectPath != null)
            {
                arguments.Add("-bp", BaseProjectPath);
            }

            if (Location != null)
            {
                arguments.Add("-a", Location);
            }

            if (Lock)
            {
                arguments.Add("-l");
            }

            if (MakeWritable)
            {
                arguments.Add("-w");
            }

            if (!MaxDateTime.Equals(DateTime.MaxValue))
            {
                arguments.Add("-d", MaxDateTime);
            }

            if (OverrideWorkfileLocation)
            {
                arguments.Add("-o");
            }

            if (PromotionGroup != null)
            {
                arguments.Add("-g", PromotionGroup);
            }

            if (Revision != Double.MaxValue)
            {
                arguments.Add("-r", Revision);
            }

            if (Touch)
            {
                arguments.Add("-t");
            }

            if (UpdateOnly)
            {
                arguments.Add("-u");
            }

            if (VersionLabel != null)
            {
                arguments.Add("-v", VersionLabel);
            }
        }
示例#2
0
文件: MaxTest.cs 项目: ywscr/NBi
        public void Execute_DateTime_CorrectValue()
        {
            var list = new List <object>()
            {
                new DateTime(2010, 1, 1), new DateTime(2016, 1, 1), new DateTime(2019, 1, 1)
            };
            var aggregation = new MaxDateTime();

            Assert.That(aggregation.Execute(list), Is.EqualTo(new DateTime(2019, 1, 1)));
        }
        private IList <ContactForm> GetRequestedContactForms()
        {
            List <string> formTypes = new List <string>();
            DateTime?     startingDate;
            DateTime?     endingDate;

            try
            {
                // Add FormTypes
                //formType = GetValidFormType(wf_FormTypes.SelectedValue);
                formTypes = GetFormTypes();

                // Check Starting Date
                startingDate = GetValidStartDate(wf_StartingFrom);
                if (!startingDate.HasValue)
                {
                    return(null);
                }

                endingDate = GetValidEndDate(wf_EndingOn);
                if (!endingDate.HasValue)
                {
                    return(null);
                }
                else
                {
                    if (endingDate < MaxDateTime.AddDays(-1))
                    {
                        endingDate = ((DateTime)endingDate).AddDays(1).AddMilliseconds(-1);
                    }
                }


                UpdatePreviewDescription(formTypes, startingDate, endingDate);

                return(ContactFormDao.GetContactsByCriteria(formTypes, startingDate.Value, endingDate.Value));
            }
            catch (ArgumentOutOfRangeException outOfRangeException)
            {
                wf_Status.Text    = outOfRangeException.Message;
                wf_Status.Visible = true;
                return(null);
            }
            catch (ArgumentException ex)
            {
                wf_Status.Text    = ex.Message;
                wf_Status.Visible = true;
                return(null);
            }
        }
示例#4
0
    private DataTable GetRequestedSurveys()
    {
        string   surveyName;
        DateTime?startingDate;
        DateTime?endingDate;

        try
        {
            // Check FormType
            surveyName = GetValidSurveyName(wf_FormTypes.SelectedValue);

            // Check Starting Date
            startingDate = GetValidStartDate(wf_StartingFrom);
            if (!startingDate.HasValue)
            {
                return(null);
            }

            endingDate = GetValidEndDate(wf_EndingOn);
            if (!endingDate.HasValue)
            {
                return(null);
            }
            else
            {
                if (endingDate < MaxDateTime.AddDays(-1))
                {
                    endingDate = ((DateTime)endingDate).AddDays(1).AddMilliseconds(-1);
                }
            }


            UpdatePreviewDescription(surveyName, startingDate, endingDate);

            return(SurveyDAO.Instance.GetSurveyDetails(surveyName, startingDate, endingDate));
        }
        catch (ArgumentOutOfRangeException outOfRangeException)
        {
            wf_Status.Text    = outOfRangeException.Message;
            wf_Status.Visible = true;
            return(null);
        }
        catch (ArgumentException ex)
        {
            wf_Status.Text    = ex.Message;
            wf_Status.Visible = true;
            return(null);
        }
    }
示例#5
0
 protected virtual bool IsDateValid(PersianDateTime dt)
 {
     if (dt == null)
     {
         return(false);
     }
     if (MaxDateTime != null && dt.ToGorgian() > MaxDateTime.ToGorgian().Date)
     {
         return(false);
     }
     if (MinDateTime != null && dt.ToGorgian() < MinDateTime.ToGorgian().Date)
     {
         return(false);
     }
     return(true);
 }
示例#6
0
    private IList <ContactForm> GetRequestedContactForms()
    {
        string   formType;
        DateTime?startingDate;
        DateTime?endingDate;

        try
        {
            var formTypes = new List <string>();

            // Grab the business area
            var businessArea = GetValidBusinessArea(wf_BusinessTypes.SelectedValue);

            // Check FormType
            formType = GetValidFormType(wf_FormTypes.SelectedValue);

            if (!string.IsNullOrEmpty(formType))
            {
                formTypes.Add(formType);
            }
            else
            {
                formTypes.AddRange(ContactFormDao.GetContactFormTypes(businessArea).Select(x => x.SourceFormName));
            }

            // Check Starting Date
            startingDate = GetValidStartDate(wf_StartingFrom);
            if (!startingDate.HasValue)
            {
                return(null);
            }

            endingDate = GetValidEndDate(wf_EndingOn);
            if (!endingDate.HasValue)
            {
                return(null);
            }
            else
            {
                if (endingDate < MaxDateTime.AddDays(-1))
                {
                    endingDate = ((DateTime)endingDate).AddDays(1).AddMilliseconds(-1);
                }
            }


            UpdatePreviewDescription(businessArea, formType, startingDate, endingDate);

            return(ContactFormDao.GetContactsByCriteria(businessArea, formTypes, startingDate.Value, endingDate.Value));
        }
        catch (ArgumentOutOfRangeException outOfRangeException)
        {
            wf_Status.Text    = outOfRangeException.Message;
            wf_Status.Visible = true;
            return(null);
        }
        catch (ArgumentException ex)
        {
            wf_Status.Text    = ex.Message;
            wf_Status.Visible = true;
            return(null);
        }
    }