Exemplo n.º 1
0
        public CLayer.Suggest Get(int InfoId)
        {
            CLayer.Suggest            suggest = null;
            List <DataPlug.Parameter> param   = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pInfoId", DataPlug.DataType._BigInt, InfoId));
            DataTable dt = Connection.GetTable("propertysuggestion_Get", param);

            if (dt.Rows.Count > 0)
            {
                suggest                = new CLayer.Suggest();
                suggest.InfoId         = Connection.ToLong(dt.Rows[0]["InfoId"]);
                suggest.Name           = Connection.ToString(dt.Rows[0]["Name"]);
                suggest.Location       = Connection.ToString(dt.Rows[0]["Location"]);
                suggest.City           = Connection.ToString(dt.Rows[0]["City"]);
                suggest.CountryId      = Connection.ToInteger(dt.Rows[0]["CountryId"]);
                suggest.Country        = Connection.ToString(dt.Rows[0]["Country"]);
                suggest.Address        = Connection.ToString(dt.Rows[0]["Address"]);
                suggest.Phone          = Connection.ToString(dt.Rows[0]["Phone"]);
                suggest.Email          = Connection.ToString(dt.Rows[0]["Email"]);
                suggest.SuggestionDate = Connection.ToDate(dt.Rows[0]["SuggestionDate"]);
                suggest.Status         = Connection.ToInteger(dt.Rows[0]["Status"]);
            }
            return(suggest);
        }
Exemplo n.º 2
0
        public CLayer.B2BApprovers CheckBookingApproversExist(long userId, long BookingID)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pUserID", DataPlug.DataType._BigInt, userId));
            param.Add(Connection.GetParameter("pBookingID", DataPlug.DataType._BigInt, BookingID));
            DataTable dt = Connection.GetTable("CheckBookingApproversExists", param);

            CLayer.B2BApprovers objResult = new CLayer.B2BApprovers();
            if (dt != null && dt.Rows.Count > 0)
            {
                objResult.b2b_approver_id = Connection.ToLong(dt.Rows[0]["b2b_approver_id"]);
                objResult.user_id         = Connection.ToLong(dt.Rows[0]["userid"]);
                objResult.approver_id     = Connection.ToLong(dt.Rows[0]["b2b_approver_id"]);
                objResult.approver_order  = Connection.ToInteger(dt.Rows[0]["Approver_Order"]);
                objResult.created_by      = Connection.ToLong(dt.Rows[0]["b2b_approver_id"]);
                //   objResult.created_date = Connection.ToDate(dt.Rows[0]["created_date"]);
                objResult.approver_email    = Connection.ToString(dt.Rows[0]["approveremail"]);
                objResult.approver_password = Connection.ToString(dt.Rows[0]["passwordhash"]);
                objResult.username          = Connection.ToString(dt.Rows[0]["UserName"]);
                objResult.status            = Connection.ToInteger(dt.Rows[0]["ApprovalStatus"]);
            }
            //  return ids;
            return(objResult);
        }
Exemplo n.º 3
0
        public List <CLayer.Rates> GetCalcDailyRates(long accommodationId)
        {
            List <DataPlug.Parameter> param  = new List <DataPlug.Parameter>();
            List <CLayer.Rates>       result = new List <CLayer.Rates>();

            param.Add(Connection.GetParameter("pAccommodationId", DataPlug.DataType._BigInt, accommodationId));
            DataTable dt = Connection.GetTable("ratesaccomodation_GetCalcDailyRates", param);

            CLayer.Rates rt1;
            foreach (DataRow dr in dt.Rows)
            {
                rt1                 = new CLayer.Rates();
                rt1.RateFor         = Connection.ToInteger(dr["RateFor"]);
                rt1.RateId          = Connection.ToLong(dr["RateId"]);
                rt1.AccommodationId = accommodationId;
                rt1.DailyRate       = Connection.ToDecimal(dr["DailyRate"]);
                rt1.CalcDailyRate   = Connection.ToDecimal(dr["CalcDailyRate"]);
                rt1.GuestRate       = Connection.ToDecimal(dr["GuestRate"]);
                rt1.LongTermRate    = Connection.ToDecimal(dr["LongTermRate"]);
                rt1.MonthlyRate     = Connection.ToDecimal(dr["MonthlyRate"]);
                rt1.WeeklyRate      = Connection.ToDecimal(dr["WeeklyRate"]);
                result.Add(rt1);
            }
            return(result);
        }
Exemplo n.º 4
0
        public List <CLayer.Tax> GetAll()
        {
            List <CLayer.Tax> result = new List <CLayer.Tax>();
            DataTable         dt     = Connection.GetTable("tax_GetAll", null);

            foreach (DataRow dr in dt.Rows)
            {
                result.Add(new CLayer.Tax()
                {
                    TaxId         = Connection.ToInteger(dr["TaxId"]),
                    Title         = Connection.ToString(dr["Title"]),
                    TaxTitleId    = Connection.ToInteger(dr["TaxTitleId"]),
                    Rate          = Connection.ToDecimal(dr["Rate"]),
                    CountryId     = Connection.ToInteger(dr["CountryId"]),
                    Country       = Connection.ToString(dr["CountryName"]),
                    StateId       = Connection.ToInteger(dr["StateId"]),
                    State         = Connection.ToString(dr["StateName"]),
                    CityId        = Connection.ToInteger(dr["CityId"]),
                    City          = Connection.ToString(dr["CityName"]),
                    Notes         = Connection.ToString(dr["Notes"]),
                    Status        = Connection.ToInteger(dr["Status"]),
                    StartDate     = Connection.ToDate(dr["StartDate"]),
                    EndDate       = Connection.ToDate(dr["EndDate"]),
                    OnDate        = Connection.ToInteger(dr["OnDate"]),
                    OnTotalAmount = Connection.ToBoolean(dr["OnTotalAmount"]),
                    PriceUpto     = Connection.ToDecimal(dr["PriceUpto"]),
                    UpdatedBy     = Connection.ToLong(dr["UpdatedBy"]),
                    UpdatedDate   = Connection.ToDate(dr["UpdatedDate"]),
                    Unlimited     = Connection.ToBoolean(dr["UnlimitedPrice"])
                });
            }
            return(result);
        }
Exemplo n.º 5
0
        public List <CLayer.Tax> GetAllForProperty(long propertyId, DateTime checkIn, DateTime bookingDate)
        {
            List <CLayer.Tax>         result = new List <CLayer.Tax>();
            List <DataPlug.Parameter> param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pPropertyId", DataPlug.DataType._BigInt, propertyId));
            param.Add(Connection.GetParameter("pCheckIn", DataPlug.DataType._Date, checkIn));
            param.Add(Connection.GetParameter("pBooking", DataPlug.DataType._Date, bookingDate));
            DataTable dt = Connection.GetTable("tax_GetAllByProperty", param);

            foreach (DataRow dr in dt.Rows)
            {
                result.Add(new CLayer.Tax()
                {
                    TaxId      = Connection.ToInteger(dr["TaxId"]),
                    TaxTitleId = Connection.ToInteger(dr["TaxTitleId"]),
                    Rate       = Connection.ToDecimal(dr["Rate"]),
                    CountryId  = Connection.ToInteger(dr["CountryId"]),
                    //  Country = Connection.ToString(dr["CountryName"]),
                    StateId = Connection.ToInteger(dr["StateId"]),
                    //  State = Connection.ToString(dr["StateName"]),
                    CityId = Connection.ToInteger(dr["CityId"]),
                    //  City = Connection.ToString(dr["CityName"]),
                    Notes         = Connection.ToString(dr["Notes"]),
                    Status        = Connection.ToInteger(dr["Status"]),
                    StartDate     = Connection.ToDate(dr["StartDate"]),
                    EndDate       = Connection.ToDate(dr["EndDate"]),
                    OnDate        = Connection.ToInteger(dr["OnDate"]),
                    OnTotalAmount = Connection.ToBoolean(dr["OnTotalAmount"]),
                    PriceUpto     = Connection.ToDecimal(dr["PriceUpto"]),
                    Unlimited     = Connection.ToBoolean(dr["UnlimitedPrice"])
                });
            }
            return(result);
        }
Exemplo n.º 6
0
        public List <CLayer.Address> GetOnUser(long UserId)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pUserId", DataPlug.DataType._BigInt, UserId));
            DataTable             dt     = Connection.GetTable("address_GetOnUser", param);
            List <CLayer.Address> result = new List <CLayer.Address>();

            foreach (DataRow dr in dt.Rows)
            {
                result.Add(new CLayer.Address()
                {
                    AddressId   = Connection.ToLong(dr["AddressId"]),
                    UserId      = Connection.ToLong(dr["UserId"]),
                    CityId      = Connection.ToInteger(dr["CityId"]),
                    AddressText = Connection.ToString(dr["Address"]),
                    City        = Connection.ToString(dr["City"]),
                    State       = Connection.ToInteger(dr["State"]),
                    CountryId   = Connection.ToInteger(dr["Country"]),
                    ZipCode     = Connection.ToString(dr["ZipCode"]),
                    Phone       = Connection.ToString(dr["Phone"]),
                    Mobile      = Connection.ToString(dr["Mobile"]),
                    AddressType = Connection.ToInteger(dr["Type"])
                });
            }
            return(result);
        }
Exemplo n.º 7
0
        public CLayer.Address GetPrimaryOnUser(long UserId)
        {
            CLayer.Address            address = null;
            List <DataPlug.Parameter> param   = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pUserId", DataPlug.DataType._BigInt, UserId));
            DataTable dt = Connection.GetTable("address_GetPrimaryOnUser", param);

            if (dt.Rows.Count > 0)
            {
                address             = new CLayer.Address();
                address.AddressId   = Connection.ToLong(dt.Rows[0]["AddressId"]);
                address.UserId      = Connection.ToLong(dt.Rows[0]["UserId"]);
                address.AddressText = Connection.ToString(dt.Rows[0]["Address"]);
                address.CityId      = Connection.ToInteger(dt.Rows[0]["CityId"]);
                address.City        = Connection.ToString(dt.Rows[0]["City"]);
                address.State       = Connection.ToInteger(dt.Rows[0]["State"]);
                address.CountryId   = Connection.ToInteger(dt.Rows[0]["Country"]);
                address.ZipCode     = Connection.ToString(dt.Rows[0]["ZipCode"]);
                address.Phone       = Connection.ToString(dt.Rows[0]["Phone"]);
                address.Mobile      = Connection.ToString(dt.Rows[0]["Mobile"]);
                address.AddressType = Connection.ToInteger(dt.Rows[0]["Type"]);
            }
            return(address);
        }
Exemplo n.º 8
0
        public List <object> GetAutoList(string term)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            if (term.Length > 50)
            {
                term = term.Substring(0, 50);
            }
            param.Add(Connection.GetParameter("pTerm", DataPlug.DataType._Varchar, term));
            param.Add(Connection.GetParameter("pPropertyStatus", DataPlug.DataType._Int, (int)CLayer.ObjectStatus.StatusType.Active));
            DataTable     dt = Connection.GetTable("xtra_autocompelete", param);
            List <object> result = new List <object>();
            string        a, b;
            int           i;

            foreach (DataRow dr in dt.Rows)
            {
                a = Connection.ToString(dr["a"]);
                //b = Connection.ToString(dr["b"]);
                //i = Connection.ToInteger(dr["num"]);
                // result.Add(new { value = a, label = a, desc = stringCnt(a, b, i) });
                result.Add(new { value = a, label = a, desc = stringCnt(a) });
            }
            return(result);
        }
Exemplo n.º 9
0
        public List <CLayer.SearchResult> GetLocationmultiFilterGDS(string term, int type)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            if (term.Length > 100)
            {
                term = term.Substring(0, 100);
            }
            param.Add(Connection.GetParameter("pTerm", DataPlug.DataType._Varchar, term));
            param.Add(Connection.GetParameter("pType", DataPlug.DataType._Int, type));
            param.Add(Connection.GetParameter("pPropertyStatus", DataPlug.DataType._Int, (int)CLayer.ObjectStatus.StatusType.Active));
            DataTable dt = Connection.GetTable("GetAll_multilocations_gds", param);
            List <CLayer.SearchResult> result = new List <CLayer.SearchResult>();

            foreach (DataRow dr in dt.Rows)
            {
                result.Add(new CLayer.SearchResult()
                {
                    Location      = GetLocationName(Connection.ToString(dr["Location"])),
                    PropertyCount = Connection.ToInteger(dr["pno"])
                                    //City = Connection.ToString(dr["City"])
                });
            }


            return(result);
        }
Exemplo n.º 10
0
        public CLayer.BookingExternalInventory GetAllDetailsByRoomIdandHotelId(string RoomId, string HotelId)
        {
            CLayer.BookingExternalInventory result = null;
            List <DataPlug.Parameter>       param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pRoomId", DataPlug.DataType._Varchar, RoomId));
            param.Add(Connection.GetParameter("pHotelId", DataPlug.DataType._Varchar, HotelId));
            DataTable dt = Connection.GetTable("BookExternalInventory_ByRoomIdandHotelId", param);

            if (dt.Rows.Count > 0)
            {
                result = new CLayer.BookingExternalInventory()
                {
                    hotel_id    = Connection.ToString(dt.Rows[0]["HotelId"]),
                    hotel_name  = Connection.ToString(dt.Rows[0]["HotelName"]),
                    roomtype_id = Connection.ToString(dt.Rows[0]["RoomId"]),
                    room_name   = Connection.ToString(dt.Rows[0]["RoomName"]),
                    room_desc   = Connection.ToString(dt.Rows[0]["RoomDesc"]),
                    final_price_at_bookingamt      = Connection.ToDecimal(dt.Rows[0]["FinalPriceAtBookingAmt"]),
                    final_price_at_bookingamtcurr  = Connection.ToString(dt.Rows[0]["FinalPriceAtBookingAmtCurr"]),
                    final_price_at_checkoutamt     = Connection.ToDecimal(dt.Rows[0]["FinalPriceAtCheckoutAmt"]),
                    final_price_at_checkoutamtcurr = Connection.ToString(dt.Rows[0]["FinalPriceAtCheckoutAmtCurr"]),
                    DomainId    = Connection.ToString(dt.Rows[0]["DomainId"]),
                    RatePlanId  = Connection.ToString(dt.Rows[0]["RatePlanId"]),
                    PromotionId = Connection.ToString(dt.Rows[0]["PromotionId"])
                };
            }
            return(result);
        }
Exemplo n.º 11
0
        public CLayer.SupplierInvoice getGetSupplierInvoicedetails(long ID)
        {
            CLayer.SupplierInvoice    result = new CLayer.SupplierInvoice();
            List <DataPlug.Parameter> param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pSupplierInvID", DataPlug.DataType._BigInt, ID));
            DataTable dt = Connection.GetTable("getGetSupplierInvoicedetails", param);

            if (dt.Rows.Count > 0)
            {
                result = new CLayer.SupplierInvoice();
                result.SupplierInvoiceID        = Connection.ToLong(dt.Rows[0]["SupplierInvoiceID"]);
                result.PropertyId               = Connection.ToLong(dt.Rows[0]["PropertyID"]);
                result.Property_Name            = Connection.ToString(dt.Rows[0]["Title"]);
                result.SupplierId               = Connection.ToLong(dt.Rows[0]["SupplierID"]);
                result.InvoiceNumber            = Connection.ToString(dt.Rows[0]["InvoiceNumber"]);
                result.InvoiceDate              = Connection.ToDate(dt.Rows[0]["InvoiceDate"]);
                result.ServiceTaxRegNumber      = Connection.ToString(dt.Rows[0]["ServiceTaxRegNumber"]);
                result.PAN_Number               = Connection.ToString(dt.Rows[0]["PAN"]);
                result.BaseAmount               = Connection.ToDecimal(dt.Rows[0]["BaseAmount"]);
                result.LuxuryTax                = Connection.ToDecimal(dt.Rows[0]["LuxuryTax"]);
                result.ServiceTax               = Connection.ToDecimal(dt.Rows[0]["ServiceTax"]);
                result.TotalInvoiceValue        = Connection.ToDecimal(dt.Rows[0]["TotalInvoiceValue"]);
                result.EntryDate                = Connection.ToDate(dt.Rows[0]["EntryDate"]);
                result.txtTotalAdjustmentResult = Connection.ToDecimal(dt.Rows[0]["TotalAdjustment"]);
                result.PropertyEmailAddresss    = Connection.ToString(dt.Rows[0]["PropertyEmailAddress"]);
                result.PropertyType             = Connection.ToString(dt.Rows[0]["PropertyType"]);
                result.TaxType                 = Connection.ToInteger(dt.Rows[0]["TaxType"]);
                result.IsSupInvoicedone        = Connection.ToBoolean(dt.Rows[0]["IsSupInvoicedone"]);
                result.BookingRefNumber        = Connection.ToString(dt.Rows[0]["BookingReferenceIDNo"]);
                result.CheckedBookingRefNumber = Connection.ToString(dt.Rows[0]["CheckedBookingReferenceIDNo"]);
            }
            return(result);
        }
Exemplo n.º 12
0
        public CLayer.City GetCityID(string CityName)
        {
            CLayer.City city = null;
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pCity", DataPlug.DataType._Varchar, CityName));
            DataTable dt = Connection.GetTable("cityID_Get", param);

            if (dt.Rows.Count > 0)
            {
                city = new CLayer.City()
                {
                    CityId     = Connection.ToInteger(dt.Rows[0]["CityId"]),
                    Name       = Connection.ToString(dt.Rows[0]["Name"]),
                    StateId    = Connection.ToInteger(dt.Rows[0]["StateId"]),
                    ForListing = Connection.ToBoolean(dt.Rows[0]["ForListing"]),
                    Keywords   = Connection.ToString(dt.Rows[0]["Keywords"])
                };
            }
            else
            {
                city = new CLayer.City()
                {
                    CityId  = 0,
                    Name    = "",
                    StateId = 0,
                    //ForListing = Connection.ToBoolean(dt.Rows[0]["ForListing"]),
                    //Keywords = Connection.ToString(dt.Rows[0]["Keywords"])
                };
            }
            return(city);
        }
Exemplo n.º 13
0
        public List <CLayer.Recommended> GetAllByManage(long ManageFor)
        {
            List <CLayer.Recommended> result = new List <CLayer.Recommended>();
            List <DataPlug.Parameter> param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pManageFor", DataPlug.DataType._BigInt, ManageFor));
            DataTable dt = Connection.GetTable("recommendedbymanage_GetAll", param);

            CLayer.Recommended temp;
            foreach (DataRow dr in dt.Rows)
            {
                temp               = new CLayer.Recommended();
                temp.PropertyId    = Connection.ToLong(dr["PropertyId"]);
                temp.EndDate       = Connection.ToDate(dr["EndDate"]);
                temp.StartDate     = Connection.ToDate(dr["StartDate"]);
                temp.Order         = Connection.ToInteger(dr["Order"]);
                temp.Status        = Connection.ToInteger(dr["Status"]);
                temp.UpdatedByUser = Connection.ToString(dr["UpdatedBy"]);
                temp.UpdatedDate   = Connection.ToDate(dr["UpdatedDate"]);
                temp.Title         = Connection.ToString(dr["Title"]);
                temp.Supplier      = Connection.ToString(dr["Name"]);
                temp.ManageFor     = Connection.ToInteger(dr["ManageFor"]);
                //   temp.AccommodationType = Connection.ToString(dr["AccType"]);
                result.Add(temp);
            }
            return(result);
        }
Exemplo n.º 14
0
        public CLayer.Recommended GetData(long propertyId, long ManageFor)
        {
            CLayer.Recommended        result = null;
            List <DataPlug.Parameter> param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pPropertyId", DataPlug.DataType._BigInt, propertyId));
            param.Add(Connection.GetParameter("pManageFor", DataPlug.DataType._BigInt, ManageFor));
            DataTable dt = Connection.GetTable("recommended_Get", param);

            if (dt.Rows.Count > 0)
            {
                result = new CLayer.Recommended()
                {
                    StartDate   = Connection.ToDate(dt.Rows[0]["StartDate"]),
                    EndDate     = Connection.ToDate(dt.Rows[0]["EndDate"]),
                    Status      = Connection.ToInteger(dt.Rows[0]["Status"]),
                    Order       = Connection.ToInteger(dt.Rows[0]["Order"]),
                    UpdatedBy   = Connection.ToLong(dt.Rows[0]["UpdatedBy"]),
                    UpdatedDate = Connection.ToDate(dt.Rows[0]["UpdatedDate"]),
                    Title       = Connection.ToString(dt.Rows[0]["Title"]),
                    ManageFor   = Connection.ToInteger(dt.Rows[0]["ManageFor"])
                };
            }

            return(result);
        }
Exemplo n.º 15
0
        public List <CLayer.User> GetAllCorporateUsers(long corporateId)
        {
            List <CLayer.User>        result = new List <CLayer.User>();
            List <DataPlug.Parameter> param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pCorporateId", DataPlug.DataType._BigInt, corporateId));
            param.Add(Connection.GetParameter("pDeleteStatus", DataPlug.DataType._Int, CLayer.ObjectStatus.StatusType.Deleted));
            //corporate_GetUsers
            DataTable dt = Connection.GetTable("corporate_GetUsers", param);

            CLayer.User temp;
            foreach (DataRow dr in dt.Rows)
            {
                temp = new CLayer.User()
                {
                    Salutation          = Connection.ToString(dr["Salutation"]),
                    Email               = Connection.ToString(dr["Email"]),
                    FirstName           = Connection.ToString(dr["Firstname"]),
                    LastName            = Connection.ToString(dr["Lastname"]),
                    Status              = Connection.ToInteger(dr["Status"]),
                    UserId              = Connection.ToLong(dr["UserId"]),
                    UserTypeId          = Connection.ToInteger(dr["CorpUserType"]),
                    AssistedBookingFlag = Connection.ToInteger(dr["AssistedBooking_Flag"])//corporate user type :admin, staff
                };
                temp.Name = temp.Salutation + " " + temp.FirstName + " " + temp.LastName;
                result.Add(temp);
            }
            return(result);
        }
Exemplo n.º 16
0
        public CLayer.State Get(int stateId)
        {
            CLayer.State state = null;
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pStateId", DataPlug.DataType._Int, stateId));
            DataTable dt = Connection.GetTable("state_Get", param);

            if (dt.Rows.Count > 0)
            {
                state              = new CLayer.State();
                state.StateId      = Connection.ToInteger(dt.Rows[0]["StateId"]);
                state.Name         = Connection.ToString(dt.Rows[0]["Name"]);
                state.CountryId    = Connection.ToInteger(dt.Rows[0]["CountryId"]);
                state.GSTStateCode = Connection.ToString(dt.Rows[0]["GSTStateCode"]);
            }
            else
            {
                state              = new CLayer.State();
                state.StateId      = 0;
                state.Name         = "";
                state.CountryId    = 0;
                state.GSTStateCode = "";
            }
            return(state);
        }
Exemplo n.º 17
0
        public CLayer.Review Get(long PropertyId, long UserId, long BookingId)
        {
            CLayer.Review             rev   = null;
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pPropertyId", DataPlug.DataType._BigInt, PropertyId));
            param.Add(Connection.GetParameter("pUserId", DataPlug.DataType._BigInt, UserId));
            param.Add(Connection.GetParameter("pBookingId", DataPlug.DataType._BigInt, BookingId));
            DataTable dt = Connection.GetTable("review_Details", param);

            if (dt.Rows.Count > 0)
            {
                rev             = new CLayer.Review();
                rev.PropertyId  = Connection.ToLong(dt.Rows[0]["PropertyId"]);
                rev.UserId      = Connection.ToLong(dt.Rows[0]["UserId"]);
                rev.BookingId   = Connection.ToLong(dt.Rows[0]["BookingId"]);
                rev.Rating      = Connection.ToInteger(dt.Rows[0]["Rating"]);
                rev.Status      = Connection.ToInteger(dt.Rows[0]["Status"]);
                rev.ReviewDate  = Connection.ToDate(dt.Rows[0]["ReviewDate"]);
                rev.FirstName   = Connection.ToString(dt.Rows[0]["FirstName"]);
                rev.LastName    = Connection.ToString(dt.Rows[0]["LastName"]);
                rev.Title       = Connection.ToString(dt.Rows[0]["Title"]);
                rev.Location    = Connection.ToString(dt.Rows[0]["Location"]);
                rev.Address     = Connection.ToString(dt.Rows[0]["Address"]);
                rev.Description = Connection.ToString(dt.Rows[0]["Description"]);
                rev.UpdatedBy   = Connection.ToLong(dt.Rows[0]["UpdatedBy"]);
                rev.UpdatedDate = Connection.ToDate(dt.Rows[0]["UpdatedDate"]);
                rev.Recommended = Connection.ToBoolean(dt.Rows[0]["IsRecommended"]);
            }
            return(rev);
        }
Exemplo n.º 18
0
        public CLayer.Accommodation Get(long AccommodationId)
        {
            CLayer.Accommodation      result = null;
            List <DataPlug.Parameter> param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pAccommodationId", DataPlug.DataType._BigInt, AccommodationId));
            DataTable dt = Connection.GetTable("accommodation_Get", param);

            if (dt.Rows.Count > 0)
            {
                result = new CLayer.Accommodation()
                {
                    AccommodationId     = Connection.ToLong(dt.Rows[0]["AccommodationId"]),
                    AccommodationTypeId = Connection.ToInteger(dt.Rows[0]["AccommodationTypeId"]),
                    StayCategoryId      = Connection.ToInteger(dt.Rows[0]["StayCategoryId"]),
                    AccommodationCount  = Connection.ToInteger(dt.Rows[0]["AccommodationCount"]),
                    PropertyId          = Connection.ToLong(dt.Rows[0]["PropertyId"]),
                    Description         = Connection.ToString(dt.Rows[0]["Description"]),
                    Location            = Connection.ToString(dt.Rows[0]["Location"]),
                    MaxNoOfPeople       = Connection.ToInteger(dt.Rows[0]["MaxNoOfPeople"]),
                    MaxNoOfChildren     = Connection.ToInteger(dt.Rows[0]["MaxNoOfChildren"]),
                    MinNoOfPeople       = Connection.ToInteger(dt.Rows[0]["MinNoOfPeople"]),
                    BedRooms            = Connection.ToInteger(dt.Rows[0]["BedRooms"]),
                    Area = Connection.ToDecimal(dt.Rows[0]["Area"]),
                    TotalAccommodations = Connection.ToInteger(dt.Rows[0]["TotalAccommodations"]),
                    Status = Connection.ToInteger(dt.Rows[0]["Status"])
                };
            }
            return(result);
        }
Exemplo n.º 19
0
        public CLayer.Address GetOnUserId(long UserId, int Addresstype)
        {
            CLayer.Address            result = null;
            List <DataPlug.Parameter> param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pUserId", DataPlug.DataType._BigInt, UserId));
            param.Add(Connection.GetParameter("pType", DataPlug.DataType._Int, Addresstype));
            DataTable dt = Connection.GetTable("address_GetOnUserType", param);

            if (dt.Rows.Count > 0)
            {
                result             = new CLayer.Address();
                result.AddressId   = Connection.ToLong(dt.Rows[0]["AddressId"]);
                result.UserId      = Connection.ToLong(dt.Rows[0]["UserId"]);
                result.CityId      = Connection.ToInteger(dt.Rows[0]["CityId"]);
                result.AddressText = Connection.ToString(dt.Rows[0]["Address"]);
                result.City        = Connection.ToString(dt.Rows[0]["City"]);
                result.State       = Connection.ToInteger(dt.Rows[0]["State"]);
                result.CountryId   = Connection.ToInteger(dt.Rows[0]["Country"]);
                result.ZipCode     = Connection.ToString(dt.Rows[0]["ZipCode"]);
                result.Phone       = Connection.ToString(dt.Rows[0]["Phone"]);
                result.Mobile      = Connection.ToString(dt.Rows[0]["Mobile"]);
                result.AddressType = Connection.ToInteger(dt.Rows[0]["Type"]);
            }
            return(result);
        }
Exemplo n.º 20
0
        public List <CLayer.Accommodation> GetAllForOwnerProperty(long propertyId, int rateType)
        {
            List <CLayer.Accommodation> result = new List <CLayer.Accommodation>();
            List <DataPlug.Parameter>   param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pPropertyId", DataPlug.DataType._BigInt, propertyId));
            param.Add(Connection.GetParameter("pType", DataPlug.DataType._Int, rateType));
            DataTable dt = Connection.GetTable("accommodation_GetAllForProperty", param);

            foreach (DataRow dr in dt.Rows)
            {
                result.Add(new CLayer.Accommodation()
                {
                    AccommodationId     = Connection.ToLong(dr["AccommodationId"]),
                    Status              = Connection.ToInteger(dr["Status"]),
                    StayCategory        = Connection.ToString(dr["Category"]),
                    AccommodationType   = Connection.ToString(dr["AType"]),
                    AccommodationCount  = Connection.ToInteger(dr["AccommodationCount"]),
                    MaxNoOfPeople       = Connection.ToInteger(dr["MaxNoOfPeople"]),
                    MaxNoOfChildren     = Connection.ToInteger(dr["MaxNoOfChildren"]),
                    MinNoOfPeople       = Connection.ToInteger(dr["MinNoOfPeople"]),
                    AccommodationTypeId = Connection.ToInteger(dr["AccommodationTypeId"]),
                    StayCategoryId      = Connection.ToInteger(dr["StayCategoryId"]),
                    PropertyId          = Connection.ToLong(dr["PropertyId"]),
                    Description         = Connection.ToString(dr["Description"]),
                    //    Location = Connection.ToString(dr["Location"]),
                    BedRooms = Connection.ToInteger(dr["BedRooms"]),
                    Area     = Connection.ToDecimal(dr["Area"]),
                    Rate     = Connection.ToDecimal(dr["Rate"])
                });
            }
            return(result);
        }
Exemplo n.º 21
0
        public List <CLayer.Rooms> GetAll(long propertyid)
        {
            List <CLayer.Rooms>       result = new List <CLayer.Rooms>();
            List <DataPlug.Parameter> param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pPropertyId", DataPlug.DataType._BigInt, propertyid));
            DataTable dt = Connection.GetTable("room_GetOnProperty", param);

            foreach (DataRow dr in dt.Rows)
            {
                result.Add(new CLayer.Rooms()
                {
                    RoomId      = Connection.ToLong(dr["RoomId"]),
                    RoomTypeId  = Connection.ToInteger(dr["RoomTypeId"]),
                    RoomType    = Connection.ToString(dr["Title"]),
                    RoomCount   = Connection.ToInteger(dr["RoomCount"]),
                    PropertyId  = Connection.ToLong(dr["PropertyId"]),
                    Description = Connection.ToString(dr["Description"])
                });
            }
            RoomType rt = new RoomType();
            List <CLayer.RoomType> types = rt.GetAll();

            if (result.Count() < types.Count())
            {
                result.Add(new CLayer.Rooms());
            }
            return(result);
        }
Exemplo n.º 22
0
        public List <CLayer.OfflineBooking> SearchcustomerListlist(string name)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pName", DataPlug.DataType._Varchar, name));
            DataTable dt = Connection.GetTable("b2b_SearchcustomerListforofflinebook", param);

            List <CLayer.OfflineBooking> result = new List <CLayer.OfflineBooking>();

            CLayer.OfflineBooking temp;
            foreach (DataRow dr in dt.Rows)
            {
                temp                  = new CLayer.OfflineBooking();
                temp.CustomerId       = Connection.ToLong(dr["b2bid"]);
                temp.CustomerName     = Connection.ToString(dr["customername"]);
                temp.CustomerEmail    = Connection.ToString(dr["Email"]);
                temp.CustomerAddress  = Connection.ToString(dr["Address"]);
                temp.CustomerMobile   = Connection.ToString(dr["Mobile"]);
                temp.CustomerCountry  = Connection.ToInteger(dr["countryname"]);
                temp.CustomerState    = Connection.ToInteger(dr["statename"]);
                temp.CustomerCity     = Connection.ToInteger(dr["city"]);
                temp.CustomerCityname = Connection.ToString(dr["cityname"]);
                temp.UserType         = Connection.ToLong(dr["UserType"]);
                //temp.CustomerType = Connection.ToInteger(dr["UserType"]);
                temp.CategoryType  = Connection.ToString(dr["UserTableCat"]);
                temp.ZipCode       = Connection.ToString(dr["ZipCode"]);
                temp.NoInvoiceMail = Connection.ToBoolean(dr["NoInvoiceMail"]);
                result.Add(temp);
            }

            return(result);
        }
Exemplo n.º 23
0
        public List <CLayer.Tax> GetOnStatus(CLayer.ObjectStatus.StatusType status)
        {
            List <CLayer.Tax>         result = new List <CLayer.Tax>();
            List <DataPlug.Parameter> param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pStatus", DataPlug.DataType._Int, (int)status));
            DataTable dt = Connection.GetTable("tax_GetOnStatus", null);

            foreach (DataRow dr in dt.Rows)
            {
                result.Add(new CLayer.Tax()
                {
                    TaxId       = Connection.ToInteger(dt.Rows[0]["TaxId"]),
                    Title       = Connection.ToString(dt.Rows[0]["Title"]),
                    Rate        = Connection.ToDecimal(dt.Rows[0]["Title"]),
                    CountryId   = Connection.ToInteger(dt.Rows[0]["CountryId"]),
                    StateId     = Connection.ToInteger(dt.Rows[0]["StateId"]),
                    Description = Connection.ToString(dt.Rows[0]["Description"]),
                    Notes       = Connection.ToString(dt.Rows[0]["Notes"]),
                    IsStandard  = Connection.ToBoolean(dt.Rows[0]["IsStandard"]),
                    Status      = Connection.ToInteger(dt.Rows[0]["Status"])
                });
            }
            return(result);
        }
Exemplo n.º 24
0
        public List <CLayer.Property> Searchpropertylistaftersup(string name)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pName", DataPlug.DataType._Varchar, name));
            DataTable dt = Connection.GetTable("b2b_Searchpropertylistaftersup", param);

            List <CLayer.Property> result = new List <CLayer.Property>();

            CLayer.Property temp;
            foreach (DataRow dr in dt.Rows)
            {
                temp              = new CLayer.Property();
                temp.Title        = Connection.ToString(dr["Title"]);
                temp.PropertyId   = Connection.ToLong(dr["PropertyId"]);
                temp.BusinessName = Connection.ToString(dr["name"]);
                temp.Email        = Connection.ToString(dr["Email"]);
                temp.Address      = Connection.ToString(dr["address"]);
                temp.SupplierName = Connection.ToString(dr["FirstName"]);
                temp.Mobile       = Connection.ToString(dr["Mobile"]);
                temp.Country      = Connection.ToInteger(dr["Country"]);
                temp.State        = Connection.ToInteger(dr["State"]);
                temp.CityId       = Connection.ToInteger(dr["CityId"]);
                temp.OwnerId      = Connection.ToInteger(dr["OwnerId"]);
                result.Add(temp);
            }
            return(result);
        }
Exemplo n.º 25
0
        public List <CLayer.Offers> GetForAccommodation(long accommodationId, int activeStatus)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pActiveStatus", DataPlug.DataType._Int, activeStatus));
            param.Add(Connection.GetParameter("pAccommodationId", DataPlug.DataType._BigInt, accommodationId));
            DataTable            dt     = Connection.GetTable("offer_ForAccommodation", param);
            List <CLayer.Offers> result = new List <CLayer.Offers>();

            CLayer.Offers temp;
            foreach (DataRow dr in dt.Rows)
            {
                temp            = new CLayer.Offers();
                temp.OfferId    = Connection.ToLong(dr["OfferId"]);
                temp.OfferTitle = Connection.ToString(dr["OfferTitle"]);
                temp.OfferType  = Connection.ToInteger(dr["OfferType"]);
                temp.RateType   = Connection.ToInteger(dr["RateType"]);
                temp.StartDate  = Connection.ToDate(dr["StartDate"]);
                temp.EndDate    = Connection.ToDate(dr["EndDate"]);
                temp.FreeDays   = Connection.ToInteger(dr["FreeDays"]);
                temp.NoOfDays   = Connection.ToInteger(dr["NoOfDays"]);
                temp.Amount     = Connection.ToDecimal(dr["Amount"]);
                result.Add(temp);
            }
            return(result);
        }
Exemplo n.º 26
0
        public List <CLayer.B2B> GetAllSupplier(long userId, int userType)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pB2bId", DataPlug.DataType._BigInt, userId));
            param.Add(Connection.GetParameter("pType", DataPlug.DataType._BigInt, userType));
            DataTable         dt     = Connection.GetTable("supplier_GetAll", param);
            List <CLayer.B2B> result = new List <CLayer.B2B>();

            foreach (DataRow dr in dt.Rows)
            {
                result.Add(new CLayer.B2B()
                {
                    B2BId               = Connection.ToLong(dr["B2BId"]),
                    Name                = Connection.ToString(dr["Name"]),
                    MarkupPercent       = Connection.ToDecimal(dr["MarkupPercent"]),
                    CommissionPercent   = Connection.ToDecimal(dr["CommissionPercent"]),
                    UserCode            = Connection.ToString(dr["UserCode"]),
                    ServiceTaxRegNo     = Connection.ToString(dr["ServiceTaxRegNo"]),
                    VATRegNo            = Connection.ToString(dr["VATRegNo"]),
                    UserId              = Connection.ToLong(dr["UserId"]),
                    Email               = Connection.ToString(dr["Email"]),
                    UserType            = Connection.ToInteger(dr["UserType"]),
                    RequestStatus       = Connection.ToInteger(dr["RequestStatus"]),
                    PropertyDescription = Connection.ToString(dr["PropertyDescription"]),
                    AvailableProperties = Connection.ToInteger(dr["AvailableProperties"])
                });
            }
            return(result);
        }
Exemplo n.º 27
0
        public CLayer.OfflinePayment GetOfflinePaymentDetails(long OfflinePaymentId)
        {
            CLayer.OfflinePayment     result = null;
            List <DataPlug.Parameter> param  = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pOfflinePayId", DataPlug.DataType._BigInt, OfflinePaymentId));
            DataTable dt = Connection.GetTable("OfflinePayment_GetDetails", param);

            if (dt.Rows.Count > 0)
            {
                result                 = new CLayer.OfflinePayment();
                result.UserId          = Connection.ToLong(dt.Rows[0]["UserId"]);
                result.Amount          = Connection.ToDecimal(dt.Rows[0]["Amount"]);
                result.Name            = Connection.ToString(dt.Rows[0]["Name"]);
                result.Message         = Connection.ToString(dt.Rows[0]["Message"]);
                result.ReferenceNumber = Connection.ToString(dt.Rows[0]["ReferenceNo"]);
                result.PaymentRefNo    = Connection.ToString(dt.Rows[0]["PaymentReferenceNo"]);
                result.CreatedDate     = Connection.ToDate(dt.Rows[0]["CreatedDate"]);
                result.Email           = Connection.ToString(dt.Rows[0]["Email"]);
                result.Mobile          = Connection.ToString(dt.Rows[0]["Mobile"]);
                result.Address         = Connection.ToString(dt.Rows[0]["Address"]);
                result.Country         = Connection.ToString(dt.Rows[0]["CountryName"]);
                result.State           = Connection.ToString(dt.Rows[0]["StateName"]);
                result.City            = Connection.ToString(dt.Rows[0]["CityName"]);
                result.CountryCode     = Connection.ToString(dt.Rows[0]["CountryCode"]);
                result.ZipCode         = Connection.ToString(dt.Rows[0]["ZipCode"]);
                //result.PaymentLinkID = (Guid)(dt.Rows[0]["PaymentLinkGuidId"]);
                result.PaymentLinkID = Connection.ToString(dt.Rows[0]["PaymentLinkGuidId"]);
            }
            return(result);
        }
Exemplo n.º 28
0
        public CLayer.B2B GetbookingcreditforCorte(long b2bId)
        {
            CLayer.B2B b2b = null;
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pB2BId", DataPlug.DataType._BigInt, b2bId));
            DataTable dt = Connection.GetTable("b2bcorporate_Getbookingcredits", param);

            if (dt.Rows.Count > 0)
            {
                b2b                     = new CLayer.B2B();
                b2b.B2BId               = Connection.ToLong(dt.Rows[0]["B2BId"]);
                b2b.Name                = Connection.ToString(dt.Rows[0]["Name"]);
                b2b.UserCode            = Connection.ToString(dt.Rows[0]["UserCode"]);
                b2b.MarkupPercent       = Connection.ToDecimal(dt.Rows[0]["MarkupPercent"]);
                b2b.CommissionPercent   = Connection.ToDecimal(dt.Rows[0]["CommissionPercent"]);
                b2b.ServiceTaxRegNo     = Connection.ToString(dt.Rows[0]["ServiceTaxRegNo"]);
                b2b.VATRegNo            = Connection.ToString(dt.Rows[0]["VATRegNo"]);
                b2b.MaximumStaff        = Connection.ToInteger(dt.Rows[0]["MaximumStaff"]);
                b2b.RequestStatus       = Connection.ToInteger(dt.Rows[0]["RequestStatus"]);
                b2b.Email               = Connection.ToString(dt.Rows[0]["Email"]);
                b2b.UserId              = Connection.ToLong(dt.Rows[0]["UserId"]);
                b2b.CompanyRegNo        = Connection.ToString(dt.Rows[0]["CompanyRegNo"]);
                b2b.UserType            = Connection.ToInteger(dt.Rows[0]["UserType"]);
                b2b.PropertyDescription = Connection.ToString(dt.Rows[0]["PropertyDescription"]);
                b2b.AvailableProperties = Connection.ToInteger(dt.Rows[0]["AvailableProperties"]);
                b2b.PANNo               = Connection.ToString(dt.Rows[0]["PANNo"]);
                b2b.ContactDesignation  = Connection.ToString(dt.Rows[0]["ContactDesignation"]);
                b2b.IsCreditBooking     = Connection.ToInteger(dt.Rows[0]["IsCreditBooking"]);
                b2b.CreditDays          = Connection.ToInteger(dt.Rows[0]["CreditDays"]);
                b2b.CreditAmount        = Connection.ToDecimal(dt.Rows[0]["CreditAmount"]);
                b2b.TotalCreditAmount   = Connection.ToDecimal(dt.Rows[0]["TotalCreditAmount"]);
            }
            return(b2b);
        }
Exemplo n.º 29
0
        //**Added by rahul on 04/03/2020
        //*This is for getting rates for property Accommodation for API
        public List <CLayer.Rates> GetAccommodationRatesForAPI(string AccIds, DateTime checkIn, DateTime checkOut, int noOfDays, CLayer.Role.Roles rateType, CLayer.Role.Roles defaultType)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pAccs", DataPlug.DataType._Varchar, AccIds));
            param.Add(Connection.GetParameter("pCheckIn", DataPlug.DataType._Date, checkIn));
            param.Add(Connection.GetParameter("pCheckOut", DataPlug.DataType._Date, checkOut));
            param.Add(Connection.GetParameter("pRateType", DataPlug.DataType._Int, rateType));
            param.Add(Connection.GetParameter("pDefaultRateType", DataPlug.DataType._Int, (int)defaultType));
            param.Add(Connection.GetParameter("pBookingDayCount", DataPlug.DataType._Int, (int)noOfDays));
            DataTable dt = Connection.GetTable("accommodation_GetAvailabilityAndRateForAPI", param);

            List <CLayer.Rates> result = new List <CLayer.Rates>();

            CLayer.Rates rt;
            foreach (DataRow dr in dt.Rows)
            {
                rt = new CLayer.Rates();
                rt.AccommodationId      = Connection.ToLong(dr["AccommodationId"]);
                rt.Amount               = Connection.ToDecimal(dr["Amount"]);
                rt.GuestRate            = Connection.ToDecimal(dr["GuestRate"]);
                rt.StartDate            = Connection.ToDate(dr["startdate"]);
                rt.EndDate              = Connection.ToDate(dr["enddate"]);
                rt.RateType             = Connection.ToInteger(dr["AType"]);
                rt.NoofAcc              = Connection.ToInteger(dr["noofacc"]);
                rt.PurchaseRateAfterTax = Connection.ToDecimal(dr["DailyRate"]);
                result.Add(rt);
            }
            return(result);
        }
Exemplo n.º 30
0
        public List <CLayer.StaticPage> GetAllWidget()
        {
            DataTable dt = Connection.GetTable("staticpage_GetAllForWidget");
            List <CLayer.StaticPage> result = new List <CLayer.StaticPage>();

            CLayer.StaticPage t;

            foreach (DataRow dr in dt.Rows)
            {
                t          = new CLayer.StaticPage();
                t.PageId   = Connection.ToLong(dr["PageId"]);
                t.City     = Connection.ToString(dr["City"]);
                t.Location = Connection.ToString(dr["Location"]);
                //      t.PageTitle = Connection.ToString(dr["PageTitle"]);
                t.Image       = Connection.ToString(dr["Image"]);
                t.RootFolder  = Connection.ToString(dr["RootFolder"]);
                t.Description = Connection.ToString(dr["Description"]);
                t.Description = CLayer.HtmlRemoval.StripTagsRegex(t.Description);
                if (t.Description.Length > 100)
                {
                    t.Description = t.Description.Substring(0, 100) + "..";
                }
                //         tm = Connection.ToDate(dr["LastUpdate"]);
                //        if (tm == DateTime.Now)
                //              t.LastUpdate = "";
                //        else
                //           t.LastUpdate = tm.ToShortDateString();
                result.Add(t);
            }
            return(result);
        }