Beispiel #1
0
        public ActionResult FillRatePlan(int RoomType)
        {
            int PropId   = Convert.ToInt32(Session["PropId"].ToString());
            var rateplan = BL_tblChangeHistory.GetRatePlanByRoomID(RoomType, PropId);

            return(Json(rateplan, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetHistoryChangeDataExcel(int?PropId, string chkradio, string dtfrom, string dtto, string dteffectivefrom, string dteffectiveto, int?id, int?roomType, int?ratePlan)
        {
            DataTable dt     = new DataTable();
            DateTime  dtFrom = dtfrom == "" ? DateTime.Now : DateTime.ParseExact(dtfrom, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
            DateTime  dtTo   = dtto == "" ? DateTime.Now : DateTime.ParseExact(dtto, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);

            if (chkradio == "R")
            {
                DateTime dtEffectiveFrom = dteffectivefrom == "" ? DateTime.Now : DateTime.ParseExact(dteffectivefrom, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                DateTime dtEffectiveTo   = dteffectiveto == "" ? DateTime.Now : DateTime.ParseExact(dteffectiveto, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                if (PropId != 0)
                {
                    dt = BL_tblChangeHistory.getRecordForSearchExcel(PropId.Value, dtFrom, dtTo, roomType.Value, ratePlan.Value, dtEffectiveFrom, dtEffectiveTo);
                }
                else
                {
                    dt = BL_tblChangeHistory.getRecordForSearchExcel(PropId.Value, dtFrom, dtTo, 0, 0, dtEffectiveFrom, dtEffectiveTo);
                }
            }
            if (chkradio == "I" || chkradio == "B")
            {
                string Id = id.ToString();
                dt = BL_tblChangeHistory.getRecordForSearchExcel(PropId.Value, dtFrom, dtTo, Id);
            }
            if (chkradio == "Promotion")
            {
                string Id = id.ToString();
                dt = BL_tblChangeHistory.getRecordForSearchPromotionsExcel(dtFrom, dtTo, Id, PropId.Value);
            }

            if (chkradio == "RatePlan")
            {
                dt = BL_tblChangeHistory.getRecordForSearchRatePlanExcel(dtFrom, dtTo, PropId.Value);
            }
            DownloadExcel(dt);
            int iUserID           = ((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId;
            etblChangeHistory obj = new etblChangeHistory
            {
                PropertyList = new List <SelectListItem> {
                    new SelectListItem {
                        Text = "All Hotels", Value = "0"
                    }
                }
            };

            obj.PropertyList.AddRange(BL_tblPropertyM.GetUserPropertyList(iUserID));
            return(View("Index", obj));
        }
        public ActionResult GetPageName(int PropId)
        {
            var data = BL_tblChangeHistory.GetPageNameForDD(PropId);

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
        public ActionResult FillRatePlan(int RoomType, int PropId)
        {
            var rateplan = BL_tblChangeHistory.GetRatePlanByRoomID(RoomType, PropId);

            return(Json(rateplan, JsonRequestBehavior.AllowGet));
        }