Beispiel #1
0
        public void StateCreationIsNotNull()
        {
            DataLayer.State stateTest = new DataLayer.State(
                users: new List <DataLayer.Model.User>
            {
                new DataLayer.Model.User
                {
                    FirstName = "TestName", LastName = "TestSurname", Email = "*****@*****.**", Phone = "321654978"
                }
            },
                books: new List <DataLayer.Model.Book>
            {
                new DataLayer.Model.Book
                {
                    Author = "Prince", Title = "Life of musician", Price = 23, Publisher = "Uninversal Records"
                }
            },
                discountCodes: new List <DataLayer.Model.DiscountCode>
            {
                new DataLayer.Model.DiscountCode
                {
                    Code = "Testing", Amount = 3
                }
            });

            Assert.IsNotNull(stateTest);
        }
        public static CLayer.InvoiceNumberData GetGDSGSTInvoiceNumber(long BookId, long PropertyID = 0)
        {
            int BillingEntityStateID = BLayer.State.GetBillingEntityStateID(PropertyID);

            BillingEntityStateID = (BillingEntityStateID == 0) ? Convert.ToInt32(BLayer.Settings.GetValue(CLayer.Settings.STAYBAZARDEFAULTBILLINGENTITY)) : BillingEntityStateID;

            string GDSStateID = Convert.ToString(BillingEntityStateID);
            int    stateId    = Convert.ToInt32(GDSStateID);

            if (stateId == 0)
            {
                throw new Exception("SB Entity state id not found.. BLayer::NumberGenerator::GetGSTInvoiceNumber");
            }
            DataLayer.State          state = new DataLayer.State();
            CLayer.InvoiceNumberData data  = BLayer.Invoice.GetOldGDSInvoiceNumber(stateId);
            if (data == null || data.InvoiceNumber == "")
            {
                string statecode = state.GetGSTCode(stateId);
                long   numb      = state.GetInvoiceNumber(stateId);

                data = new CLayer.InvoiceNumberData();
                data.InvoiceNumber = statecode + numb.ToString("00000#");
                data.InvoiceDate   = DateTime.Today;
                return(data); //return new invoice number
            }

            return(data); //return deleted invoice's data and invoice number
        }
        public static CLayer.InvoiceNumberData GetGSTInvoiceNumber(long offlineBookId)
        {
            int stateId = BLayer.OfflineBooking.GetBillingEntityState(offlineBookId);

            if (stateId == 0)
            {
                throw new Exception("SB Entity state id not found.. BLayer::NumberGenerator::GetGSTInvoiceNumber");
            }
            DataLayer.State          state = new DataLayer.State();
            CLayer.InvoiceNumberData data  = BLayer.Invoice.GetOldInvoiceNumber(stateId);
            if (data == null || data.InvoiceNumber == "")
            {
                string statecode = state.GetGSTCode(stateId);
                long   numb      = state.GetInvoiceNumber(stateId);

                data = new CLayer.InvoiceNumberData();
                data.InvoiceNumber = statecode + numb.ToString("00000#");
                data.InvoiceDate   = DateTime.Today;
                return(data); //return new invoice number
            }

            return(data); //return deleted invoice's data and invoice number
        }
Beispiel #4
0
 public static int UpdateGDSState(int CountryID, string State = "")
 {
     DataLayer.State state = new DataLayer.State();
     return(state.UpdateGDSState(CountryID, State));
 }
Beispiel #5
0
 public static int GetCustomerStateID(int CustomerID)
 {
     DataLayer.State state = new DataLayer.State();
     return(state.GetCustomerStateID(CustomerID));
 }
Beispiel #6
0
 public static int GetBillingEntityStateID(long PropertyID)
 {
     DataLayer.State state = new DataLayer.State();
     return(state.GetBillingEntityStateID(PropertyID));
 }
Beispiel #7
0
 public static CLayer.State GetStateID(string statename, long CountryID = 0)
 {
     DataLayer.State state = new DataLayer.State();
     return(state.GetStateID(statename, CountryID));
 }
Beispiel #8
0
 public static CLayer.State GetStateID(string cityname)
 {
     DataLayer.State state = new DataLayer.State();
     return(state.GetStateID(cityname));
 }
Beispiel #9
0
 public static List <CLayer.State> GetCustGstStateList(int Customerid, int Type)
 {
     DataLayer.State state = new DataLayer.State();
     return(state.GetCustGstStateList(Customerid, Type));
 }
Beispiel #10
0
 public static int Save(CLayer.State data)
 {
     DataLayer.State state = new DataLayer.State();
     data.Validate();
     return(state.Save(data));
 }
Beispiel #11
0
 public static CLayer.State Get(int stateId)
 {
     DataLayer.State state = new DataLayer.State();
     return(state.Get(stateId));
 }
Beispiel #12
0
 public static List <CLayer.State> GetAllState()
 {
     DataLayer.State state = new DataLayer.State();
     return(state.GetAllState());
 }
Beispiel #13
0
 public static List <CLayer.State> GetOnCountry(int countryId)
 {
     DataLayer.State state = new DataLayer.State();
     return(state.GetOnCountry(countryId));
 }
Beispiel #14
0
 public static string GetGSTCode(long stateId)
 {
     DataLayer.State state = new DataLayer.State();
     return(state.GetGSTCode(stateId));
 }