예제 #1
0
        public long Save_Amadeus(CLayer.Accommodation data)
        {
            try
            {
                List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();
                param.Add(Connection.GetParameter("pAccommodationId", DataPlug.DataType._BigInt, data.AccommodationId));
                param.Add(Connection.GetParameter("pAccommodationTypeId", DataPlug.DataType._Int, data.AccommodationTypeId));
                param.Add(Connection.GetParameter("pStayCategoryId", DataPlug.DataType._Int, data.StayCategoryId));
                param.Add(Connection.GetParameter("pAccommodationCount", DataPlug.DataType._Int, data.AccommodationCount));
                param.Add(Connection.GetParameter("pPropertyId", DataPlug.DataType._BigInt, data.PropertyId));
                param.Add(Connection.GetParameter("pDescription", DataPlug.DataType._Text, data.Description));
                //param.Add(Connection.GetParameter("pLocation", DataPlug.DataType._Varchar, data.Location));
                param.Add(Connection.GetParameter("pMaxNoOfPeople", DataPlug.DataType._Int, data.MaxNoOfPeople));
                param.Add(Connection.GetParameter("pMaxNoOfChildren", DataPlug.DataType._Int, data.MaxNoOfChildren));
                param.Add(Connection.GetParameter("pMinNoOfPeople", DataPlug.DataType._Int, data.MinNoOfPeople));
                param.Add(Connection.GetParameter("pBedRooms", DataPlug.DataType._Int, data.BedRooms));
                param.Add(Connection.GetParameter("pArea", DataPlug.DataType._Decimal, data.Area));
                param.Add(Connection.GetParameter("pStatus", DataPlug.DataType._Int, data.Status));
                param.Add(Connection.GetParameter("pUpdatedBy", DataPlug.DataType._BigInt, data.UpdatedById));
                param.Add(Connection.GetParameter("pTotalAccommodations", DataPlug.DataType._Int, data.TotalAccommodations));
                param.Add(Connection.GetParameter("pRoomType", DataPlug.DataType._Varchar, data.RoomType));
                param.Add(Connection.GetParameter("pRoomTypeCode", DataPlug.DataType._Varchar, data.RoomTypeCode));
                param.Add(Connection.GetParameter("pSourceofBusiness", DataPlug.DataType._Varchar, data.SourceofBusiness));
                param.Add(Connection.GetParameter("pBookingCode", DataPlug.DataType._Varchar, data.BookingCode));
                param.Add(Connection.GetParameter("pRatePlanCode", DataPlug.DataType._Varchar, data.RatePlanCode));
                param.Add(Connection.GetParameter("pRoomStayRPH", DataPlug.DataType._Varchar, data.RoomStayRPH));

                object result = Connection.ExecuteQueryScalar("accommodation_amadeus_save", param);
                return(Connection.ToInteger(result));
            }
            catch (Exception ex22)
            {
                return(0);
            }
        }
예제 #2
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);
        }
        private Models.AccommodationModel AccommodationGet(long accommodationId)
        {
            Models.AccommodationModel data = new Models.AccommodationModel()
            {
                AccommodationId = 0
            };
            CLayer.Accommodation sub = BLayer.Accommodation.Get(accommodationId);
            if (sub != null)
            {
                data = new Models.AccommodationModel()
                {
                    AccommodationId     = sub.AccommodationId,
                    AccommodationTypeId = sub.AccommodationTypeId,
                    StayCategoryId      = sub.StayCategoryId,
                    AccommodationCount  = sub.AccommodationCount,
                    PropertyId          = sub.PropertyId,
                    Description         = sub.Description,

                    MaxNoOfChildren     = sub.MaxNoOfChildren,
                    MaxNoOfPeople       = sub.MaxNoOfPeople,
                    MinNoOfPeople       = sub.MinNoOfPeople,
                    BedRooms            = sub.BedRooms,
                    Area                = sub.Area,
                    Status              = sub.Status,
                    TotalAccommodations = sub.TotalAccommodations,
                    ActiveTab           = "acc"
                };

                data.AccommodationPictures = new Models.AccommodationPicturesModel()
                {
                    FileId                = 0,
                    AccommodationId       = data.AccommodationId,
                    PropertyId            = data.PropertyId,
                    FileName              = "",
                    AccommodationPhoto    = null,
                    AccommodationPictures = BLayer.AccommodationFiles.GetOnAccommodation(data.AccommodationId)
                };

                data.AccommodationFeatures = new Models.AccommodationFeaturesModel()
                {
                    AccommodationId = data.AccommodationId,
                    FeatureSet      = "",
                    Features        = BLayer.AccommodationFeature.GetAllWithSelectedForAccommodation(data.AccommodationId)
                };
            }
            return(data);
        }
        public ActionResult AccommodationSave(Models.AccommodationModel data)
        {
            try
            {
                string userid = User.Identity.GetUserId();
                long   id     = 0;
                long.TryParse(userid, out id);
                if (ModelState.IsValid)
                {
                    CLayer.Accommodation accmdtn = new CLayer.Accommodation()
                    {
                        AccommodationId     = data.AccommodationId,
                        PropertyId          = data.PropertyId,
                        AccommodationTypeId = data.AccommodationTypeId,
                        StayCategoryId      = data.StayCategoryId,
                        AccommodationCount  = data.AccommodationCount,
                        Description         = data.Description,

                        MaxNoOfPeople       = data.MaxNoOfPeople,
                        MaxNoOfChildren     = data.MaxNoOfChildren,
                        MinNoOfPeople       = data.MinNoOfPeople,
                        BedRooms            = data.BedRooms,
                        Area                = data.Area,
                        Status              = data.Status,
                        TotalAccommodations = data.TotalAccommodations,
                        UpdatedById         = id
                    };
                    long accId = BLayer.Accommodation.Save(accmdtn);
                    Models.PropertyModel property = GetDetails(data.PropertyId);
                    property.ActiveTab = "accommodation";
                    property.Accommodations.Accommodation = AccommodationGet(accId);
                    //property.Accommodations.Accommodation.ActiveTab = "acc";
                    return(View("Index", property));
                    //return RedirectToAction("Index", new { id = data.PropertyId });
                }
                return(Redirect("~/ErrorPage"));
            }
            catch (Exception ex)
            {
                Common.LogHandler.HandleError(ex);
                return(Redirect("~/ErrorPage"));
            }
        }
예제 #5
0
        public long Save_API(CLayer.Accommodation data)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pAccommodationTypeId", DataPlug.DataType._Int, data.AccommodationTypeId));
            param.Add(Connection.GetParameter("pStayCategoryId", DataPlug.DataType._Int, data.StayCategoryId));
            param.Add(Connection.GetParameter("pAccommodationCount", DataPlug.DataType._Int, data.AccommodationCount));
            param.Add(Connection.GetParameter("pPropertyId", DataPlug.DataType._BigInt, data.PropertyId));
            param.Add(Connection.GetParameter("pDescription", DataPlug.DataType._Text, data.Description));
            //param.Add(Connection.GetParameter("pLocation", DataPlug.DataType._Varchar, data.Location));
            param.Add(Connection.GetParameter("pMaxNoOfPeople", DataPlug.DataType._Int, data.MaxNoOfPeople));
            param.Add(Connection.GetParameter("pMaxNoOfChildren", DataPlug.DataType._Int, data.MaxNoOfChildren));
            param.Add(Connection.GetParameter("pMinNoOfPeople", DataPlug.DataType._Int, data.MinNoOfPeople));
            param.Add(Connection.GetParameter("pBedRooms", DataPlug.DataType._Int, data.BedRooms));
            param.Add(Connection.GetParameter("pArea", DataPlug.DataType._Decimal, data.Area));
            param.Add(Connection.GetParameter("pStatus", DataPlug.DataType._Int, data.Status));
            param.Add(Connection.GetParameter("pUpdatedBy", DataPlug.DataType._BigInt, data.UpdatedById));
            param.Add(Connection.GetParameter("pTotalAccommodations", DataPlug.DataType._Int, data.TotalAccommodations));
            object result = Connection.ExecuteQueryScalar("sp_accommodation_save_byapi", param);

            return(Connection.ToInteger(result));
        }
 public ActionResult AccommodationPictureDelete(long id)
 {
     try
     {
         CLayer.AccommodationFiles pf = BLayer.AccommodationFiles.Get(id);
         BLayer.AccommodationFiles.Delete(id);
         if (System.IO.File.Exists(Server.MapPath("~/Files/Property/Accommodation/" + pf.AccommodationId.ToString() + "/" + pf.FileName)))
         {
             System.IO.File.Delete(Server.MapPath("~/Files/Property/Accommodation/" + pf.AccommodationId.ToString() + "/" + pf.FileName));
         }
         CLayer.Accommodation ac       = BLayer.Accommodation.Get(pf.AccommodationId);
         Models.PropertyModel property = GetDetails(ac.PropertyId);
         property.ActiveTab = "accommodation";
         property.Accommodations.Accommodation           = AccommodationGet(pf.AccommodationId);
         property.Accommodations.Accommodation.ActiveTab = "pictures";
         return(View("Index", property));
         //return RedirectToAction("Index", new { id = ac.PropertyId });
     }
     catch (Exception ex)
     {
         Common.LogHandler.HandleError(ex);
         return(Redirect("~/ErrorPage"));
     }
 }
예제 #7
0
 public static long Save_Amadeus(CLayer.Accommodation data)
 {
     DataLayer.Accommodation acc = new DataLayer.Accommodation();
     data.Validate();
     return(acc.Save_Amadeus(data));
 }