Exemple #1
0
        public MainViewModel()
        {
            CheckRoles();
            TitleText = "PDMAS V1.0.0.0, PDEX Delivery Management System - " +
                        Singleton.User.UserName + " - " +
                        DateTime.Now.ToString("dd/MM/yyyy") + " - " +
                        ReportUtility.GetEthCalendarFormated(DateTime.Now, "/");

            HeaderText = "Request Managment";
            DeliveryViewModel.LoadData = true;
            CurrentViewModel           = DeliveryViewModel;

            DeliveryViewModelViewCommand = new RelayCommand(ExecuteDeliveryViewModelViewCommand);
            FollowUpViewModelViewCommand = new RelayCommand(ExecuteFollowUpViewModelViewCommand);
        }
        public MainViewModel()
        {
            CheckRoles();
            TitleText = "PinnaFit V1.0.0.1, Gym and Fitness Management System - " +
                        Singleton.User.UserName + " - " +
                        DateTime.Now.ToString("dd/MM/yyyy") + " - " +
                        ReportUtility.GetEthCalendarFormated(DateTime.Now, "/");
            if (UserRoles.DashboardMgmt == "Visible")
            {
                HeaderText       = "Dashboard";
                CurrentViewModel = DashBoardViewModel;
            }
            else
            {
                HeaderText       = "ስራዎች ማስተዳደሪያ";
                CurrentViewModel = AttendanceListViewModel;
            }

            DeliveryViewModelViewCommand = new RelayCommand(ExecuteDeliveryViewModelViewCommand);
            FollowUpViewModelViewCommand = new RelayCommand(ExecuteFollowUpViewModelViewCommand);
        }
Exemple #3
0
        private void ExecutePrintCommand()
        {
            var    myReport4       = new Reports.Summary.DailyActivity();
            var    myDataSet       = new FitnessDataSet();
            var    selectedCompany = new CompanyService(true).GetCompany();
            var    selectedDate    = DateTime.Now;
            int    serNo           = 1;
            string shift           = EnumUtil.GetEnumDesc(ShiftTypes.Morning);

            if (selectedDate.Hour > 14)
            {
                shift = EnumUtil.GetEnumDesc(ShiftTypes.Afternoon);
            }

            foreach (var itemQuantityDto in ItemsQuantity)
            {
                myDataSet.DailySummaryReport.Rows.Add(
                    serNo,
                    ReportUtility.GetEthCalendarFormated(selectedDate, "-") + "(" +
                    selectedDate.ToShortDateString() + ") - (" + shift + ")",
                    itemQuantityDto.Item.DisplayName,
                    itemQuantityDto.QuantityOnHand,
                    null,
                    null,
                    null,
                    itemQuantityDto.Item.UnitOfMeasure.DisplayName,
                    "",
                    null, null,
                    selectedCompany.Header,
                    SelectedWarehouse.DisplayName);

                serNo++;
            }
            myReport4.SetDataSource(myDataSet);

            new ReportUtil().DirectPrinter(myReport4);
            //var report = new ReportViewerCommon(myReport4);

            //report.Show();
        }
        public TransactionDataSet GetListDataSet2()
        {
            var myDataSet           = new TransactionDataSet();
            var selectedCompany     = new CompanyService(true).GetCompany();
            var SelectedTransaction = SelectedMember.LastSubscription;

            try
            {
                #region Fields

                var brCode            = new BarcodeProcess();
                var tranNumberbarcode =
                    ImageToByteArray(brCode.GetBarcode(SelectedTransaction.SubscriptionNumber, 320, 40, true),
                                     ImageFormat.Bmp);

                var subTotal = SelectedTransaction.AmountPaid / (decimal)1.15;
                var tax      = Convert.ToDecimal((subTotal * ((decimal)0.15)).ToString("N2"));

                string reciptNo = SelectedTransaction.ReceiptNumber, prefix = "";
                int    recLen = 10 - reciptNo.Length;
                while (recLen != 0)
                {
                    prefix = prefix + "0";
                    recLen--;
                }
                reciptNo = prefix + reciptNo;

                #endregion

                #region Header

                myDataSet.TransactionHeader.Rows.Add(
                    reciptNo,
                    tranNumberbarcode,
                    SelectedMember.TinNumber,
                    SelectedMember.DisplayName,
                    SelectedMember.Number,
                    SelectedMember.SexAmharic,
                    SelectedTransaction.SubscribedDateString + "(" +
                    ReportUtility.GetEthCalendarFormated(SelectedTransaction.SubscribedDate, "/") + ")",
                    "",
                    subTotal,
                    "VAT (" + 15 + "%)",
                    tax,
                    subTotal + tax,
                    "linknumber1"
                    );

                #endregion

                #region Client Address

                myDataSet.ClientDetail.Rows.Add(
                    selectedCompany.Header,
                    selectedCompany.Footer,
                    selectedCompany.Address.AddressDetail,
                    selectedCompany.Address.SubCity,
                    selectedCompany.Address.Kebele,
                    selectedCompany.Address.HouseNumber,
                    selectedCompany.Address.Mobile,
                    selectedCompany.Address.AlternateMobile,
                    selectedCompany.Address.Fax,
                    selectedCompany.Address.PrimaryEmail,
                    selectedCompany.Address.AlternateEmail,
                    selectedCompany.TinNumber,
                    selectedCompany.VatNumber,
                    "CASH", "CASH", Singleton.User.FullName.ToUpper(), "linknumber1");

                #endregion

                #region BPAddress

                myDataSet.BPAddress.Rows.Add(
                    SelectedMember.Address.AddressDetail,
                    SelectedMember.Address.SubCity,
                    SelectedMember.Address.Kebele,
                    SelectedMember.Address.HouseNumber,
                    SelectedMember.Address.Mobile,
                    SelectedMember.Address.AlternateMobile,
                    SelectedMember.Address.Fax,
                    SelectedMember.Address.PrimaryEmail,
                    SelectedMember.Address.AlternateEmail,
                    "linknumber1");

                #endregion

                #region Lines

                myDataSet.TransactionLine.Rows.Add(
                    "1",
                    "00" + SelectedTransaction.FacilitySubscription.Facility.Id.ToString(),
                    SelectedTransaction.FacilitySubscription.PackageName,
                    "",
                    "Gym",
                    "Pcs",
                    subTotal,
                    1,
                    subTotal,
                    0,
                    "linknumber1");

                #endregion
            }
            catch (Exception exception)
            {
                MessageBox.Show("Can't get data for the report"
                                + Environment.NewLine + exception.Message, "Can't get data", MessageBoxButton.OK,
                                MessageBoxImage.Error);
            }

            return(myDataSet);
        }
Exemple #5
0
        public FitnessDataSet GetAttendanceListDataSet(List <MemberAttendanceDTO> attendances, List <PervisitSubscriptionDTO> pervisitAttendances)
        {
            var myDataSet         = new FitnessDataSet();
            var serNo             = 1;
            var selectedCompany   = new CompanyService(true).GetCompany();
            var totalNumberOfRows = attendances.Count();

            attendances = attendances.OrderBy(a => a.MemberSubscription.FacilitySubscription.PackageName).ToList();

            var shift = ShiftTypes.All;

            if (_shiftType != null)
            {
                shift = (ShiftTypes)_shiftType;
            }
            if (_beginDate == null || _endDate == null)
            {
                return(null);
            }
            foreach (var member in attendances)
            {
                myDataSet.MembersList.Rows.Add(
                    serNo,
                    member.MemberSubscription.Member.DisplayName,
                    member.MemberSubscription.Member.Number,
                    member.MemberSubscription.Member.Sex,
                    "አጠቃላይ: " + totalNumberOfRows,
                    member.MemberSubscription.Member.Address.AddressDetail,
                    member.MemberSubscription.Member.Address.Mobile,
                    member.MemberSubscription.FacilitySubscription.PackageName,
                    member.MemberSubscription.FacilitySubscription.Facility.DisplayName,
                    member.MemberSubscription.AmountPaid,
                    member.MemberSubscription.StartDateString,
                    member.MemberSubscription.EndDateString,
                    member.MemberSubscription.CurrentStatus,
                    ReportUtility.GetEthCalendarFormated(_beginDate.Value, "-") + "(" +
                    _beginDate.Value.ToShortDateString() + ")",
                    EnumUtil.GetEnumDesc(shift),
                    0, 0, selectedCompany.Header, "");

                serNo++;
            }

            pervisitAttendances =
                pervisitAttendances.OrderBy(a => a.DisplayName).ToList();

            foreach (var member in pervisitAttendances)
            {
                myDataSet.MembersList.Rows.Add(
                    serNo,
                    member.DisplayName,
                    member.VisitNumber,
                    member.Sex,
                    "አጠቃላይ: " + totalNumberOfRows,
                    "",
                    "",
                    member.FacilitySubscription.PackageName,
                    "Per Visit",
                    member.AmountPaid,
                    member.CheckedInTime,
                    member.CheckedInTime,
                    "የዕለት",
                    ReportUtility.GetEthCalendarFormated(_beginDate.Value, "-") + "(" +
                    _beginDate.Value.ToShortDateString() + ")",
                    EnumUtil.GetEnumDesc(shift),
                    0, 0, selectedCompany.Header, "");

                serNo++;
            }

            return(myDataSet);
        }
Exemple #6
0
        public FitnessDataSet GetAttendanceListSummarizedDataSet(List <MemberAttendanceDTO> attendances, List <PervisitSubscriptionDTO> pervisitAttendances)
        {
            var myDataSet       = new FitnessDataSet();
            var serNo           = 1;
            var selectedCompany = new CompanyService(true).GetCompany();

            //var totalNumberOfRows = attendances.Count();
            attendances = attendances.OrderBy(a => a.MemberSubscription.FacilitySubscription.PackageName).ToList();

            var memberSubscriptionListDaysLeft = attendances.Select(member => new SubscriptionModel
            {
                FacilityName = member.MemberSubscription.FacilitySubscription.PackageName,
                DaysLeft     = member.MemberSubscription.DaysLeft
            }).ToList();

            var memberSubscriptionList = attendances.Select(member => new SubscriptionModel
            {
                FacilityName = member.MemberSubscription.FacilitySubscription.PackageName,
                Sex          = member.MemberSubscription.Member.Sex
            }).ToList();

            pervisitAttendances = pervisitAttendances.OrderBy(a => a.DisplayName).ToList();
            var pervists = pervisitAttendances.Select(member => new SubscriptionModel
            {
                FacilityName = member.FacilitySubscription.PackageName,
                Sex          = member.Sex
            }).ToList();

            memberSubscriptionList = memberSubscriptionList.Union(pervists.ToList()).ToList();

            #region Calculate Sex

            var maleSex   = memberSubscriptionList.Count(s => s.Sex == Sex.Male);
            var feMaleSex = memberSubscriptionList.Count(s => s.Sex == Sex.Female);

            #endregion

            #region Calculate DaysLeft

            var withDays   = memberSubscriptionListDaysLeft.Count(s => s.DaysLeft >= 0);
            var withNoDays = memberSubscriptionListDaysLeft.Count(s => s.DaysLeft < 0);

            #endregion

            var querFacility = from memberSubscriptionList2 in memberSubscriptionList
                               group memberSubscriptionList2 by memberSubscriptionList2.FacilityName
                               into newGroup
                               orderby newGroup.Key
                               select newGroup;

            var memberCategorySubList = querFacility.Select(nameGroup => new SubscriptionSumModel
            {
                Category           = nameGroup.Key,
                SubscriptionModels = nameGroup
            }).ToList();

            var shift = ShiftTypes.All;
            if (_shiftType != null)
            {
                shift = (ShiftTypes)_shiftType;
            }
            if (_beginDate == null || _endDate == null)
            {
                return(null);
            }

            string datecaption = ReportUtility.GetEthCalendarFormated(_beginDate.Value, "-") + "(" +
                                 _beginDate.Value.ToShortDateString() + ")";

            if (_beginDate.Value.Day != _endDate.Value.Day || _beginDate.Value.Month != _endDate.Value.Month ||
                _beginDate.Value.Year != _endDate.Value.Year)
            {
                datecaption = "ከ " + datecaption + " እስከ " + ReportUtility.GetEthCalendarFormated(_endDate.Value, "-") +
                              "(" + _endDate.Value.ToShortDateString() + ")";
            }

            foreach (var member in memberCategorySubList)
            {
                myDataSet.MembersList.Rows.Add(
                    serNo,
                    member.Category,
                    maleSex,
                    feMaleSex,
                    withDays,
                    withNoDays,
                    "",
                    "",
                    "",
                    0,
                    "",
                    "",
                    "",
                    datecaption,
                    EnumUtil.GetEnumDesc(shift),
                    member.TotalNumber, 0, selectedCompany.Header, "");

                serNo++;
            }


            return(myDataSet);
        }
Exemple #7
0
        public FitnessDataSet GetNumberListDataSet(List <SubscriptionModel> list, MemberStatusTypes status)
        {
            var myDataSet       = new FitnessDataSet();
            var serNo           = 1;
            var selectedCompany = new CompanyService(true).GetCompany();

            var memberSubscriptionListForNumberSummary = list.ToList();

            switch (status)
            {
            case MemberStatusTypes.Active:
                memberSubscriptionListForNumberSummary = list.ToList().Where(m => !m.IsExpired).ToList();
                break;

            case MemberStatusTypes.Expired:
                memberSubscriptionListForNumberSummary = list.ToList().Where(m => m.IsExpired).ToList();
                break;
            }

            #region Group By Facility
            var querFacility = from memberSubscriptionList in memberSubscriptionListForNumberSummary
                               group memberSubscriptionList by memberSubscriptionList.FacilityName
                               into newGroup
                               orderby newGroup.Key
                               select newGroup;

            var memberCategorySubList = querFacility.Select(nameGroup => new SubscriptionSumModel
            {
                Category           = nameGroup.Key,
                SubscriptionModels = nameGroup
            }).ToList();


            foreach (var subscriptionSumModel in memberCategorySubList)
            {
                string cat       = subscriptionSumModel.Category;
                var    subModels = subscriptionSumModel.SubscriptionModels;

                var querSubscription = from memberSubscriptionList in subModels
                                       group memberSubscriptionList by memberSubscriptionList.SubscriptionName
                                       into newGroup
                                       orderby newGroup.Key
                                       select newGroup;

                var memberCategorySubList2 = querSubscription.Select(nameGroup => new SubscriptionSumModel
                {
                    Category           = nameGroup.Key,
                    SubscriptionModels = nameGroup
                }).ToList();

                int permonth = 0, threemonth = 0, sixmonth = 0, oneyear = 0;

                var firstOrDefault = memberCategorySubList2.FirstOrDefault(a => a.Category == "Per Month");
                if (firstOrDefault != null)
                {
                    permonth = firstOrDefault.TotalNumber;
                }

                firstOrDefault = memberCategorySubList2.FirstOrDefault(a => a.Category == "3 Months");
                if (firstOrDefault != null)
                {
                    threemonth = firstOrDefault.TotalNumber;
                }

                firstOrDefault = memberCategorySubList2.FirstOrDefault(a => a.Category == "6 Months");
                if (firstOrDefault != null)
                {
                    sixmonth = firstOrDefault.TotalNumber;
                }

                firstOrDefault = memberCategorySubList2.FirstOrDefault(a => a.Category == "1 Year");
                if (firstOrDefault != null)
                {
                    oneyear = firstOrDefault.TotalNumber;
                }

                var tot = oneyear + permonth + threemonth + sixmonth;

                myDataSet.SummaryReport.Rows.Add(
                    serNo,
                    ReportUtility.GetEthCalendarFormated(DateTime.Now, "-") + "(" +
                    DateTime.Now.ToShortDateString() + ")",
                    cat,
                    0,
                    permonth,
                    threemonth,
                    sixmonth,
                    oneyear,
                    tot,
                    "",
                    "",
                    0, 0, selectedCompany.Header, "");

                serNo++;
            }



            #endregion


            return(myDataSet);
        }
Exemple #8
0
        public FitnessDataSet GetSummaryDataSet2(IEnumerable <SubscriptionModel> list)
        {
            try
            {
                var myDataSet       = new FitnessDataSet();
                var serNo           = 1;
                var selectedCompany = new CompanyService(true).GetCompany();

                var memberSubsList = list.OrderBy(g => g.FacilityName).ThenBy(g => g.SubscriptionName).ToList();

                if (memberSubsList.Count == 0)
                {
                    MessageBox.Show("No Data found on: ");
                    return(null);
                }

                #region Group By Facility

                var shift = ShiftTypes.All;
                if (_shiftType != null)
                {
                    shift = (ShiftTypes)_shiftType;
                }
                if (_beginDate == null || _endDate == null)
                {
                    return(null);
                }

                if (_beginDate.Value.Year < 2000)
                {
                    _beginDate = DateTime.Now;
                    _endDate   = DateTime.Now;
                }

                string datecaption = ReportUtility.GetEthCalendarFormated(_beginDate.Value, "-") + "(" +
                                     _beginDate.Value.ToShortDateString() + ")";

                if (_beginDate.Value.Day != _endDate.Value.Day || _beginDate.Value.Month != _endDate.Value.Month || _beginDate.Value.Year != _endDate.Value.Year)
                {
                    datecaption = "ከ " + datecaption + " እስከ " + ReportUtility.GetEthCalendarFormated(_endDate.Value, "-") + "(" +
                                  _endDate.Value.ToShortDateString() + ")";
                }

                foreach (var member in memberSubsList)
                {
                    var durAmharic = "1 ወር";
                    if (member.SubscriptionName == "3 Months")
                    {
                        durAmharic = "3 ወር";
                    }
                    if (member.SubscriptionName == "6 Months")
                    {
                        durAmharic = "6 ወር";
                    }
                    if (member.SubscriptionName == "1 Year")
                    {
                        durAmharic = "1 አመት";
                    }

                    myDataSet.MembersList.Rows.Add(
                        serNo,
                        member.MemberName,
                        "አዲስ የተመዘገቡና ያደሱ",
                        EnumUtil.GetEnumDesc(member.Sex),
                        member.Age,
                        member.MobileNumber,
                        "",
                        member.FacilityName,
                        durAmharic,
                        member.Amount,
                        ReportUtility.GetEthCalendarFormated(member.StartDate, "-"),
                        ReportUtility.GetEthCalendarFormated(member.EndDate, "-"),
                        "",
                        datecaption,
                        EnumUtil.GetEnumDesc(shift),
                        0, 0, selectedCompany.Header, "");


                    serNo++;
                }


                #endregion


                return(myDataSet);
            }
            catch
            {
                return(null);
            }
        }
Exemple #9
0
        public FitnessDataSet GetSummaryDataSet(IEnumerable <SubscriptionModel> list)
        {
            try
            {
                var myDataSet       = new FitnessDataSet();
                var serNo           = 1;
                var selectedCompany = new CompanyService(true).GetCompany();

                var memberSubsList = list.ToList();

                if (memberSubsList.Count == 0)
                {
                    MessageBox.Show("No Data found on: ");
                    return(null);
                }

                #region Group By Facility
                var querFacility = from memberSubscriptionList in memberSubsList
                                   group memberSubscriptionList by memberSubscriptionList.PackageName
                                   into newGroup
                                   orderby newGroup.Key
                                   select newGroup;

                var memberCategorySubList = querFacility.Select(nameGroup => new SubscriptionSumModel
                {
                    Category           = nameGroup.Key,
                    SubscriptionModels = nameGroup
                }).ToList();

                var shift = ShiftTypes.All;
                if (_shiftType != null)
                {
                    shift = (ShiftTypes)_shiftType;
                }
                if (_beginDate == null || _endDate == null)
                {
                    return(null);
                }
                string datecaption = ReportUtility.GetEthCalendarFormated(_beginDate.Value, "-") + "(" +
                                     _beginDate.Value.ToShortDateString() + ")";

                if (_beginDate.Value.Day != _endDate.Value.Day || _beginDate.Value.Month != _endDate.Value.Month || _beginDate.Value.Year != _endDate.Value.Year)
                {
                    datecaption = "ከ " + datecaption + " እስከ " + ReportUtility.GetEthCalendarFormated(_endDate.Value, "-") + "(" +
                                  _endDate.Value.ToShortDateString() + ")";
                }

                foreach (var subscriptionSumModel in memberCategorySubList)
                {
                    var subtototal = subscriptionSumModel.TotalAmount / (decimal)1.15;
                    var tax        = subtototal * (decimal)0.15;

                    myDataSet.DailySummaryReport.Rows.Add(
                        serNo, datecaption +
                        " - (" + EnumUtil.GetEnumDesc(shift) + ")",
                        subscriptionSumModel.Category,
                        subscriptionSumModel.TotalUnit,
                        subtototal,
                        tax,
                        subscriptionSumModel.TotalAmount,
                        "",
                        "",
                        0, 0, selectedCompany.Header, "");

                    serNo++;
                }



                #endregion


                return(myDataSet);
            }
            catch
            {
                return(null);
            }
        }