Ejemplo n.º 1
0
        public FitnessDataSet GetListDataSet()
        {
            var myDataSet = new FitnessDataSet();

            var brCode = new BarcodeProcess();
            var memberNumberbarcode = ImageToByteArray(brCode.GetBarcode(SelectedMember.Number.ToString(), 1200, 40, false),
                                                       ImageFormat.Bmp);
            //ImageToByteArray(brCode.GetBarcode(SelectedMember.Id.ToString() + "11850908", 1200, 40, false),
            //    ImageFormat.Bmp);

            var memberPhoto = new AttachmentService(true).Find(SelectedMember.PhotoId.ToString())
                              ?? new AttachmentDTO();

            var memberSub = MemberSubscriptionDetail.FirstOrDefault();

            //if (SelectedMember.LastSubscription != null)
            myDataSet.MemberDetail.Rows.Add(
                SelectedMember.DisplayName,
                memberPhoto.AttachedFile,
                SelectedMember.Number,
                memberNumberbarcode,
                SelectedMember.SexAmharic,
                SelectedMember.Address.AddressDetail,
                "", "", "", "",
                SelectedMember.Address.Mobile,
                "", "", "", "",
                memberSub != null ? memberSub.StartDateStringAndAmharic : null,
                memberSub != null ? memberSub.EndDateStringAndAmharic : null,
                memberSub != null ? memberSub.FacilitySubscription.PackageName : null,
                "");

            //SelectedMember.LastSubscription.SubscribedDateStringAndAmharic,
            //        SelectedMember.LastSubscription.EndDateString,
            //        SelectedMember.LastSubscription.FacilitySubscription.PackageName,

            return(myDataSet);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public DeliveryDataSet GetListDataSet()
        {
            var myDataSet = new DeliveryDataSet();
            var brCode    = new BarcodeProcess();

            try
            {
                var company = new CompanyService(true).GetCompany();

                var lines = new DeliveryService().GetChilds(SelectedDelivery.Id, true)
                            .Where(d => d.DeliveryType == DeliveryLineRouteTypes.Delivering).ToList();

                foreach (var deliveryLineDTO in lines)
                {
                    var orderNum        = "" + SelectedDelivery.Number.Substring(1) + "_" + deliveryLineDTO.Number.Substring(1);
                    var linkno          = deliveryLineDTO.Id;
                    var deliverybarcode = ImageToByteArray(brCode.GetBarcode(orderNum, 320, 40, false), ImageFormat.Bmp);
                    myDataSet.ClientDetail.Rows.Add(
                        company.Header,
                        company.Footer,
                        company.Address.AddressDetail,
                        company.Address.SubCity,
                        company.Address.Kebele,
                        company.Address.HouseNumber,
                        company.Address.Telephone,
                        company.Address.Mobile,
                        company.Address.Fax,
                        company.Address.PrimaryEmail,
                        company.Address.AlternateEmail,
                        "",
                        "",
                        "",
                        "",
                        "",
                        "",
                        "",
                        linkno.ToString(CultureInfo.InvariantCulture));

                    myDataSet.DeliveryLine.Rows.Add(
                        "1",
                        SelectedDelivery.Number + "-" + deliveryLineDTO.Number,
                        SelectedDelivery.OrderDateString,
                        "",
                        SelectedDelivery.OrderByClient.DisplayName,
                        SelectedDelivery.OrderByClient.Address.AddressDetail,
                        SelectedDelivery.OrderByClient.Address.Mobile,
                        SelectedDelivery.OrderByClient.Address.AlternateMobile,
                        SelectedDelivery.OrderByClient.Address.Telephone,
                        deliveryLineDTO.FromClient.DisplayName,
                        deliveryLineDTO.FromAddress.AddressDetail,
                        deliveryLineDTO.FromAddress.Mobile,
                        deliveryLineDTO.FromAddress.AlternateMobile,
                        deliveryLineDTO.FromAddress.Telephone,
                        deliveryLineDTO.ToClient.DisplayName,
                        deliveryLineDTO.ToAddress.AddressDetail,
                        deliveryLineDTO.ToAddress.Mobile,
                        deliveryLineDTO.ToAddress.AlternateMobile,
                        deliveryLineDTO.ToAddress.Telephone,
                        deliverybarcode,
                        "",
                        "",
                        "",
                        "",
                        "",
                        linkno.ToString(CultureInfo.InvariantCulture)
                        );

                    var serNo = 1;
                    foreach (var message in deliveryLineDTO.Messages)
                    {
                        myDataSet.DeliveryMessage.Rows.Add(
                            serNo,
                            message.Number,
                            message.Category.DisplayName,
                            message.UnitOfMeasure.DisplayName,
                            message.Description,
                            message.Unit,
                            "",
                            "",
                            "",
                            "",
                            "",
                            null,
                            linkno.ToString(CultureInfo.InvariantCulture));
                        serNo++;
                    }
                }
            }
            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);
        }
Ejemplo n.º 4
0
        public TransactionDataSet GetListDataSet()
        {
            var myDataSet = new TransactionDataSet();

            try
            {
                #region Fields
                var brCode            = new BarcodeProcess();
                var tranNumberbarcode = ImageToByteArray(brCode.GetBarcode(SelectedTransaction.TransactionNumber, 320, 40, true), ImageFormat.Bmp);

                var tax = Convert.ToDecimal((SelectedTransaction.TotalCost * (Singleton.Setting.TaxPercent * (decimal)0.01)).ToString("N2"));

                #endregion

                #region Header
                myDataSet.TransactionHeader.Rows.Add(
                    SelectedTransaction.FiscalNumber,
                    tranNumberbarcode,
                    SelectedTransaction.Warehouse.DisplayName,
                    SelectedTransaction.BusinessPartner.DisplayName,
                    SelectedTransaction.BusinessPartner.TinNumber,
                    SelectedTransaction.BusinessPartner.VatNumber,
                    SelectedTransaction.TransactionDateString + "(" +
                    ReportUtility.getEthCalendarFormated(SelectedTransaction.TransactionDate, "/") + ")",
                    SelectedTransaction.Status,
                    SelectedTransaction.TotalCost,
                    EnumUtil.GetEnumDesc(Singleton.Setting.TaxType) + " (" + Singleton.Setting.TaxPercent + "%)",
                    tax,
                    SelectedTransaction.TotalCost + tax,
                    "linknumber1"
                    );
                #endregion

                #region Client Address

                myDataSet.ClientDetail.Rows.Add(
                    SelectedTransaction.Warehouse.Header,
                    SelectedTransaction.Warehouse.Footer,
                    SelectedTransaction.Warehouse.Address.StreetAddress,
                    SelectedTransaction.Warehouse.Address.SubCity,
                    SelectedTransaction.Warehouse.Address.Kebele,
                    SelectedTransaction.Warehouse.Address.HouseNumber,
                    SelectedTransaction.Warehouse.Address.Telephone,
                    SelectedTransaction.Warehouse.Address.Mobile,
                    SelectedTransaction.Warehouse.Address.Fax,
                    SelectedTransaction.Warehouse.Address.PrimaryEmail,
                    SelectedTransaction.Warehouse.Address.AlternateEmail,
                    SelectedTransaction.Warehouse != null ? SelectedTransaction.Warehouse.TinNumber : "",
                    SelectedTransaction.Warehouse != null ? SelectedTransaction.Warehouse.VatNumber : "",
                    PaymentMethod, PaymentMethod, "", "linknumber1");
                #endregion

                #region BPAddress
                myDataSet.BPAddress.Rows.Add(
                    SelectedTransaction.BusinessPartner.Addresses.FirstOrDefault().Address.StreetAddress,
                    SelectedTransaction.BusinessPartner.Addresses.FirstOrDefault().Address.SubCity,
                    SelectedTransaction.BusinessPartner.Addresses.FirstOrDefault().Address.Kebele,
                    SelectedTransaction.BusinessPartner.Addresses.FirstOrDefault().Address.HouseNumber,
                    SelectedTransaction.BusinessPartner.Addresses.FirstOrDefault().Address.Telephone,
                    SelectedTransaction.BusinessPartner.Addresses.FirstOrDefault().Address.Mobile,
                    SelectedTransaction.BusinessPartner.Addresses.FirstOrDefault().Address.Fax,
                    SelectedTransaction.BusinessPartner.Addresses.FirstOrDefault().Address.PrimaryEmail,
                    SelectedTransaction.BusinessPartner.Addresses.FirstOrDefault().Address.AlternateEmail,
                    "linknumber1");
                #endregion

                #region Lines
                var serNo = 1;
                foreach (var line in TransactionLines)
                {
                    myDataSet.TransactionLine.Rows.Add(
                        serNo,
                        line.Item.ItemCode,
                        string.IsNullOrEmpty(line.Item.Description) ? line.Item.DisplayName : line.Item.Description,
                        "",
                        line.Item.Category.DisplayName,
                        line.Item.UnitOfMeasure.DisplayName,
                        line.EachPrice,
                        line.Unit,
                        line.LinePrice,
                        0,
                        "linknumber1");

                    serNo++;
                }
                #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);
        }