public static string GetSymbolPath(this GuestRoomAccount guestRoomAccount, string scheme, string authourity, string content)
        {
            string url          = string.Format("{0}://{1}{2}", scheme, authourity, content);
            string strPathPlus  = url + "images/" + "plus_16.png";
            string strPathMinus = url + "images/" + "minus_16.png";

            return(guestRoomAccount.RoomPaymentType.PaymentStatusId == (int)RoomPaymentStatusEnum.Credit ? strPathPlus : strPathMinus);
        }
Esempio n. 2
0
 public GuestRoomAccount Create(GuestRoomAccount guestRoomAccount)
 {
     _unitOfWork.GuestRoomAccountRepository.Insert(guestRoomAccount);
     _unitOfWork.Save();
     return(guestRoomAccount);
 }
Esempio n. 3
0
 public void Delete(GuestRoomAccount guestRoomAccount)
 {
     _unitOfWork.GuestRoomAccountRepository.Delete(guestRoomAccount);
     _unitOfWork.Save();
 }
Esempio n. 4
0
 public GuestRoomAccount Update(GuestRoomAccount guestRoomAccount)
 {
     _unitOfWork.GuestRoomAccountRepository.Update(guestRoomAccount);
     _unitOfWork.Save();
     return(guestRoomAccount);
 }
 public static string GetSymbol(this GuestRoomAccount guestRoomAccount)
 {
     return(guestRoomAccount.RoomPaymentType.PaymentStatusId == (int)RoomPaymentStatusEnum.Credit ? "plus_16.png" : "minus_16.png");
 }
        public static string PrintInvoicePayment(string path, GuestRoomAccount gra, string imagePath)
        {
            string[] splitShopDetails = null;

            var guest = gra.GuestRoom.Guest;

            try
            {
                var shopDetails = ConfigurationManager.AppSettings["SHOPDETAILS"].ToString();

                splitShopDetails = shopDetails.Split('@').ToArray();

                if (splitShopDetails.Count() < 7)
                {
                    splitShopDetails = null;
                }
            }
            catch (Exception)
            {
            }

            if (splitShopDetails == null)
            {
                splitShopDetails = new string[] { "AcademyVista Ltd. @ B03 Eleganza, V.G.C, @ Lagos State @ Nigeria @ 08105387515 @ www.academyvista.com @ 6543210" };
            }

            string currency = "NGN ", reference = gra.Id.ToString() + "_" + DateTime.Now.ToShortTimeString().Replace(":", ""), companyReg = splitShopDetails[6];

            string[]         companyDetails = splitShopDetails, clientDetails = GetClientInformation(guest);
            List <ItemRow>   itemsRows      = new List <ItemRow>();
            List <TotalRow>  totalRows      = new List <TotalRow>();
            List <DetailRow> detailRows     = new List <DetailRow>();
            string           footerWebsite  = splitShopDetails[5];

            var initialDeposit = gra;

            var gr          = guest.GuestRooms.FirstOrDefault();
            var noOfNights  = gr.CheckoutDate.Subtract(gr.CheckinDate).Days;
            var roomDetails = "Room " + gr.RoomNumber + "-" + gr.Room.RoomType1.Name + " Room Price - (NGN " + Decimal.Round(gr.RoomRate, 2) + ")";
            var amountPaid  = decimal.Zero;

            if (initialDeposit != null)
            {
                amountPaid = initialDeposit.Amount;
            }

            if (string.IsNullOrEmpty(reference))
            {
                reference = DateTime.Now.ToString();
            }

            string filename = new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, currency)
                              .TextColor("#CC0000")
                              .BackColor("#FFD6CC")
                              .Image(imagePath, 125, 32)
                              .Reference(reference)
                              .Company(Address.Make("FROM", companyDetails, companyReg, ""))
                              .Client(Address.Make("BILLING TO", clientDetails))
                              .Items(new List <ItemRow>
            {
                ItemRow.Make(GetPaymementNote(initialDeposit), GetPaymementNote(initialDeposit), (decimal)1, 0, amountPaid, amountPaid)
            })
                              .Totals(new List <TotalRow> {
                TotalRow.Make("Sub Total", amountPaid),
                TotalRow.Make("TAX @ 0%", decimal.Zero),
                TotalRow.Make("Total", amountPaid, true),
            })
                              .Details(new List <DetailRow>
            {
                DetailRow.Make("PAYMENT INFORMATION", "A copy of this receipt will also be emailed to you.", "", "If you have any questions concerning this receipt, contact our front office or a duty manager.", "", "Thank you for your business.")
            })
                              .Footer(footerWebsite)
                              .Save(path, 0);

            return(reference);
        }
 private static string GetPaymementNote(GuestRoomAccount initialDeposit)
 {
     return(!string.IsNullOrEmpty(initialDeposit.PaymentMethodNote) ? initialDeposit.PaymentMethodNote : initialDeposit.RoomPaymentType.Name);
 }