コード例 #1
0
        public JsonResult DailyPropertyStatistics(string HitCountPeriodID, string StartDate, string EndDate)
        {
            //DateTime dt = DateTime.ParseExact(StartDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            //DateTime dt1 = DateTime.ParseExact(EndDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            //string Datefromm = Convert.ToString(dt);
            //string Datetoo = Convert.ToString(dt1);
            //string Datefromm = dt.ToString("yyyy-MM-dd");
            //string Datetoo = dt1.ToString("yyyy-MM-dd");
            string startdate = dateconvert(StartDate);
            string Enddate = dateconvert(EndDate);
            var PartID = "1";
            //string HotelID = Convert.ToString(Session["GBAdminBizContext"]);
            BizContext = (BizContext)Session["GBAdminBizContext"];
            int HotelID = BizContext.HotelID;
            Session["GBAdminBizContext"] = BizContext;

            DataTable dts = new DataTable();
            PropertyStatisticsRepository objupdate = new PropertyStatisticsRepository();
            List<PropertyStatisticsExt> list = new List<PropertyStatisticsExt>();
            try{
            dts = objupdate.DisplaydatewisePropertyStatistics(PartID, HitCountPeriodID, startdate, Enddate, HotelID);
            if (dts != null)
            {
                if (dts.Rows.Count > 0)
                {
                    foreach (DataRow dr in dts.Rows)
                    {
                        PropertyStatisticsExt FirmObj = new PropertyStatisticsExt();
                        FirmObj.PartID = dr["PartID"].ToString();
                        FirmObj.RecordID = dr["RecordID"].ToString();
                        FirmObj.ReservationCount = dr["ReservationCount"].ToString();
                        FirmObj.Date = dr["Date"].ToString();
                        FirmObj.HitCount = dr["HitCount"].ToString();
                        FirmObj.Month = dr["Month"].ToString();
                        FirmObj.MonthName = dr["MonthName"].ToString();
                        FirmObj.Day = dr["Day"].ToString();
                        FirmObj.DayName = dr["DayName"].ToString();
                        list.Add(FirmObj);
                    }
                }
            }
            }
            catch (Exception ex)
               {
               string hostName1 = Dns.GetHostName();
               string GetUserIPAddress = Dns.GetHostByName(hostName1).AddressList[0].ToString();
               string PageName = Convert.ToString(Session["PageName"]);
               //string GetUserIPAddress = GetUserIPAddress1();
               using (BaseRepository baseRepo = new BaseRepository())
               {
                   //BizContext BizContext1 = new BizContext();
                   BizApplication.AddError(baseRepo.BizDB, PageName, ex.Message, ex.StackTrace, DateTime.Now, GetUserIPAddress);
               }
               Session["PageName"] = "";
               string error = ErrorHandling.HandleException(ex);
               return this.Json(new DataSourceResult { Errors = error });
               }
            return Json(list, JsonRequestBehavior.AllowGet);
        }
コード例 #2
0
        public JsonResult MonthlyPropertyStatistics(string Year)
        {
            //  string HotelID = Convert.ToString(Session["GBAdminBizContext"]);
            BizContext = (BizContext)Session["GBAdminBizContext"];
            int HotelID = BizContext.HotelID;
            Session["GBAdminBizContext"] = BizContext;

            var PartID = "1";
            if (Year == "")
            {
                Year = "2015";
            }
            DataTable dt = new DataTable();
            PropertyStatisticsRepository objupdate = new PropertyStatisticsRepository();
            List<PropertyStatisticsExt> list = new List<PropertyStatisticsExt>();
            try
            {
                dt = objupdate.MonthlyPropertyStatistics(PartID, HotelID, Year);
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        PropertyStatisticsExt FirmObj = new PropertyStatisticsExt();
                        FirmObj.PartID = dr["PartID"].ToString();
                        FirmObj.RecordID = dr["RecordID"].ToString();
                        FirmObj.ReservationCount = dr["ReservationCount"].ToString();
                        FirmObj.HitCount = dr["HitCount"].ToString();
                        FirmObj.MonthName = dr["MonthName"].ToString();
                        list.Add(FirmObj);
                    }
                }
            }
            catch (Exception ex)
            {
                string hostName1 = Dns.GetHostName();
                string GetUserIPAddress = Dns.GetHostByName(hostName1).AddressList[0].ToString();
                string PageName = Convert.ToString(Session["PageName"]);
                //string GetUserIPAddress = GetUserIPAddress1();
                using (BaseRepository baseRepo = new BaseRepository())
                {
                    //BizContext BizContext1 = new BizContext();
                    BizApplication.AddError(baseRepo.BizDB, PageName, ex.Message, ex.StackTrace, DateTime.Now, GetUserIPAddress);
                }
                Session["PageName"] = "";
                string error = ErrorHandling.HandleException(ex);
                return this.Json(new DataSourceResult { Errors = error });
            }
            return Json(list, JsonRequestBehavior.AllowGet);
        }
コード例 #3
0
        public JsonResult YearlyPropertyStatistics()
        {
            // string HotelID = Convert.ToString(Session["GBAdminBizContext"]);
            BizContext = (BizContext)Session["GBAdminBizContext"];
            int HotelID = BizContext.HotelID;
            Session["GBAdminBizContext"] = BizContext;

            var PartID = "1";

            PropertyStatisticsRepository objupdate = new PropertyStatisticsRepository();
            var yearlyPropertyStatistics = objupdate.YearlyPropertyStatistics(PartID, HotelID);
            ViewBag.yearlyPropertyStatistics = yearlyPropertyStatistics;
            return Json(yearlyPropertyStatistics, JsonRequestBehavior.AllowGet);
        }
コード例 #4
0
        public JsonResult DisplaypageloadPropertyStatistics()
        {
            string HitCountPeriodID ="3";
            //DateTime startdate = DateTime.Now;
            ////DateTime dt1 = DateTime.ParseExact(startdate, "dd/MM/yyyy", CultureInfo.InvariantCulture);

            //string Datefromm = "2015-11-16";
            //string Datetoo = startdate.ToString("yyyy-MM-dd");
            string Datefromm = DateTime.Now.ToString("yyyy-MM-dd");
            string Datetoo = DateTime.Now.AddDays(10).ToString("yyyy-MM-dd");
            string startdate = dateconvert(Datefromm);
            string Enddate = dateconvert(Datetoo);
            string PartID = "1";
            //string HotelID =Convert.ToString( Session["GBAdminBizContext"]);
            BizContext = (BizContext)Session["GBAdminBizContext"];
            int HotelID = BizContext.HotelID;
            Session["GBAdminBizContext"] = BizContext;

            PropertyStatisticsRepository objupdate = new PropertyStatisticsRepository();
            var DailyStatistics = objupdate.DisplayPropertyStatistics(PartID, HitCountPeriodID, startdate, Enddate, HotelID);
            ViewBag.DailyStatistics = DailyStatistics;
            return Json(DailyStatistics, JsonRequestBehavior.AllowGet);
        }