示例#1
0
        public BaseChartWeekRequestModels()
        {
            //DateFrom = CommonHelper.GetFirstDayOfWeek();
            //DateTo = DateFrom.AddDays(6);

            DateTo   = DateTime.Now.AddDays(-1);
            DateFrom = DateTo.AddDays(-6);
        }
示例#2
0
        public override IDAOFilter GetFilter()
        {
            IDataAccess da = SysAuditDat.ClassDataAccessor;
            IDAOFilter  f  = da.NewFilter();

            f.AddWhere(new FilterDateFromTo(SysAuditColumns.Dt, DateFrom, DateTo.AddDays(1)));

            if (!string.IsNullOrEmpty(Tbl))
            {
                Tbl = "%" + Tbl + "%";
                f.AddWhere(new FilterString(SysAuditColumns.Tbl, Tbl, true));
            }

            if (ID != 0)
            {
                //f.AddWhere(new FilterID(SysAuditColumns.TblID, ID));
                f.AddWhere(new FilterCustom(string.Format("OpContent.value('/*[1]/@id', 'int') = {0}", ID)));
            }

            if (!string.IsNullOrEmpty(User))
            {
                User = "******" + User + "%";
                f.AddWhere(new FilterString(SysAuditColumns.Usr, User, true));
            }

            if (!string.IsNullOrEmpty(Host))
            {
                Host = "%" + Host + "%";
                f.AddWhere(new FilterString(SysAuditColumns.ClientHost, Host, true));
            }

            if (!string.IsNullOrEmpty(Application))
            {
                Application = "%" + Application + "%";
                f.AddWhere(new FilterString(SysAuditColumns.ClientApplication, Application, true));
            }

            if (!string.IsNullOrEmpty(Server))
            {
                Server = "%" + Server + "%";
                f.AddWhere(new FilterString(SysAuditColumns.Srv, Server, true));
            }

            if (!string.IsNullOrEmpty(Base))
            {
                Base = "%" + Base + "%";
                f.AddWhere(new FilterString(SysAuditColumns.Db, Base, true));
            }

            return(f);
        }
示例#3
0
        private List <DateTime> GetFreeTimesForPerson(List <DateTime> freeTimes, IWeekScheduler person)
        {
            List <DateTime> ret = new List <DateTime>();

            if (freeTimes == null)
            {
                //Zjistit volné časy pro objekt
                DateTime dateNow = DateFrom;
                while (dateNow <= DateTo.AddDays(1).AddHours(-1))
                {
                    if (dateNow.Hour < 7 || dateNow.Hour > 18)
                    {
                        dateNow = dateNow.AddHours(1);
                        continue;
                    }

                    var ev = person.EventInTime(dateNow);
                    if (ev == null)
                    {
                        ret.Add(dateNow);
                    }
                    dateNow = dateNow.AddHours(1);
                }
            }
            else if (freeTimes.Count == 0)
            {
                ret = null;
            }
            else
            {
                //Porovnat volné časy s časy objektu
                foreach (var dateNow in freeTimes)
                {
                    var ev = person.EventInTime(dateNow);
                    if (ev == null)
                    {
                        ret.Add(dateNow);
                    }
                }
            }
            return(ret);
        }
示例#4
0
        public void PrepareParameters()
        {
            OverallFilter = new Filter();

            OverallFilter.PatientID = PatientID;
            OverallFilter.Modality  = Modality;
            OverallFilter.Batch     = Batch;

            string   date    = "01/01/1753";
            DateTime minDate = Convert.ToDateTime(date);

            if (DateFrom < minDate)
            {
                OverallFilter.AcquisitionDateFrom = minDate;
            }
            else
            {
                OverallFilter.AcquisitionDateFrom = DateFrom;
            }

            if (DateTo > DateTime.Today)
            {
                OverallFilter.AcquisitionDateTo = DateTime.Today.AddDays(1);
            }
            else
            {
                OverallFilter.AcquisitionDateTo = DateTo.AddDays(1);
            }

            if (IsFemale == true)
            {
                OverallFilter.Gender = "F";
            }
            else if (IsMale == true)
            {
                OverallFilter.Gender = "M";
            }
            else
            {
                OverallFilter.Gender = String.Empty;
            }
        }
 private bool ApplyDateFilter(Transaction x)
 {
     return(x.Date >= DateFrom.ToDayStart() && x.Date < DateTo.AddDays(1).ToDayStart());
 }
示例#6
0
        private void initDataSource()
        {
            _ds = new LinqInstantFeedbackDataSource();
            var dc = new ORM.FPMDataContext();

            dc.ObjectTrackingEnabled = false;
            _ds.QueryableSource      = dc.ProjectPivotView.Where(x => x.DeadLine >= DateFrom && x.DeadLine <= DateTo.AddDays(1).AddMinutes(-1));
            _ds.KeyExpression        = "ProjectID";
            _ds.DefaultSorting       = "DeadLine DESC";
            OnPropertyChanged("DataSource");
        }