コード例 #1
0
        private void fuelReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string        id     = "LoadMain";
            DateSelection report = new DateSelection(id);

            report.Show();
        }
コード例 #2
0
        public DateSelectionItem(DateSelection selection)
        {
            DateSelection = selection;
            switch (DateSelection)
            {
            case DateSelection.LastYear:
                Start = DateTime.Now.AddYears(-1);
                End   = DateTime.Now;
                break;

            case DateSelection.LastMonth:
                Start = DateTime.Now.AddMonths(-1);
                End   = DateTime.Now;
                break;

            case DateSelection.LastWeek:
                Start = DateTime.Now.AddDays(-7);
                End   = DateTime.Now;
                break;

            case DateSelection.Last24Hours:
                Start = DateTime.Now.AddDays(-1);
                End   = DateTime.Now;
                break;
            }
        }
コード例 #3
0
        private void fuelWeeklyPhysicalStockToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string        id     = "PhycisalLoad";
            DateSelection report = new DateSelection(id);

            report.Show();
        }
コード例 #4
0
        private void fuelStockMovementReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string        id       = "stockMovement";
            DateSelection reptView = new DateSelection(id);

            reptView.ShowDialog();
        }
コード例 #5
0
 public ReportItemsViewModelBase(ReportArchive model)
 {
     this.model         = model;
     this.dateSelection = new DateSelection()
     {
         StartDate = model.History.StartDate,
         EndDate   = model.History.EndDate
     };
 }
コード例 #6
0
        private void BtnPrintReport_Click(object sender, EventArgs e)
        {
            string id = "stockMovement";
            //StockMovementReportView report = new StockMovementReportView(id);
            //report.ShowDialog();
            DateSelection reptView = new DateSelection(id);

            reptView.ShowDialog();
        }//Views\StockMovement\FuelStkReport.rpt
コード例 #7
0
        private void BtnPrintReport_Click(object sender, EventArgs e)
        {
            //StockMovementReportView report = new StockMovementReportView();
            //report.ShowDialog();

            string        id     = "PhycisalLoad";
            DateSelection report = new DateSelection(id);//purchasebook is a formname

            report.ShowDialog();
        }//Views\StockMovement\PhysicalStockReport.rpt
コード例 #8
0
        public async Task <IActionResult> AddDateSelection([FromBody] DateSelection dateSelection)
        {
            if (dateSelection?.SelectedDates == null || !dateSelection.SelectedDates.Any())
            {
                return(BadRequest());
            }

            await _repository.Add(dateSelection);

            return(Ok());
        }
コード例 #9
0
        GetBikesAvailability(
            bool makeReservation,
            InventoryGroup[] inventoryGroups,
            string selectedDate,
            string selectedDayPart,
            string name,
            string email,
            string phone,
            string startDate,
            string endDate
            )
        {
            DateTime startD = GetDateFromJavaScriptDate(startDate);

            DateTime endD = GetDateFromJavaScriptDate(endDate);

            DateSelection dateSelection = null;

            if (selectedDate != null && selectedDayPart != null)
            {
                dateSelection = new DateSelection()
                {
                    DayPart = selectedDayPart,
                    Date    = selectedDate
                };
            }
            string message = null;

            if (makeReservation)
            {
                message = DatabaseOperations.MakeReservation(inventoryGroups, name, email, phone, dateSelection);

                foreach (InventoryGroup group in inventoryGroups)
                {
                    group.Wanted = 0;
                }
            }



            BikesAvailability bikesAvailability =
                DatabaseOperations.GetBikesAvailability(inventoryGroups,
                                                        name, email, phone, startD, endD, dateSelection);

            bikesAvailability.Message = message;

            return(bikesAvailability);
        }
コード例 #10
0
        public override string ToString()
        {
            string ret = string.Empty;

            if (!IsEmpty)
            {
                if (!IsConcept)
                {
                    ret = DateSelection.ToString();
                }
                else
                {
                    ret = SMAH1.EnumInfoBase <DateConcept> .GetFieldDescription(Concept, 0);
                }
            }
            return(ret);
        }
コード例 #11
0
        private DateTime SelectWorkingDate(DateTime dateTime, DateSelection selectionType)
        {
            DateTime selectedDateTime = dateTime;

            switch (selectionType)
            {
            case DateSelection.AfterWeekends:
                if (_weekends.Contains(DateTime.Now.DayOfWeek))
                {
                    selectedDateTime = SelectWorkingDate(dateTime, DateSelection.BeforeWeekends);
                }
                else
                {
                    while (_weekends.Contains(selectedDateTime.DayOfWeek))
                    {
                        if (selectedDateTime >= DateTime.Now)
                        {
                            selectedDateTime = dateTime;
                        }
                        else
                        {
                            selectedDateTime = selectedDateTime.AddDays(1);
                        }
                    }
                }
                break;

            case DateSelection.BeforeWeekends:
                while (_weekends.Contains(selectedDateTime.DayOfWeek))
                {
                    selectedDateTime = selectedDateTime.AddDays(-1);
                }
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(selectionType), selectionType, null);
            }

            return(selectedDateTime);
        }
コード例 #12
0
        void ReleaseDesignerOutlets()
        {
            if (AddImage != null)
            {
                AddImage.Dispose();
                AddImage = null;
            }

            if (btnCancel != null)
            {
                btnCancel.Dispose();
                btnCancel = null;
            }

            if (btnDone != null)
            {
                btnDone.Dispose();
                btnDone = null;
            }

            if (CameraIcon != null)
            {
                CameraIcon.Dispose();
                CameraIcon = null;
            }

            if (DateSelection != null)
            {
                DateSelection.Dispose();
                DateSelection = null;
            }

            if (GoalSelection != null)
            {
                GoalSelection.Dispose();
                GoalSelection = null;
            }

            if (Highlight != null)
            {
                Highlight.Dispose();
                Highlight = null;
            }

            if (Hour != null)
            {
                Hour.Dispose();
                Hour = null;
            }

            if (LogHoursContainer != null)
            {
                LogHoursContainer.Dispose();
                LogHoursContainer = null;
            }

            if (OrganisationSelection != null)
            {
                OrganisationSelection.Dispose();
                OrganisationSelection = null;
            }

            if (ScrollView != null)
            {
                ScrollView.Dispose();
                ScrollView = null;
            }

            if (UploadedImage != null)
            {
                UploadedImage.Dispose();
                UploadedImage = null;
            }

            if (waiting != null)
            {
                waiting.Dispose();
                waiting = null;
            }
        }