コード例 #1
0
ファイル: RStatusController.cs プロジェクト: Estay/signSystem
        public hotel_info getData(string Id, string startDate, string EndDate)
        {
            string uId = "test1";

            int hotel_id = 0;
            int.TryParse(Id, out hotel_id);


            if (string.IsNullOrEmpty(startDate))
            {
                start = DateTime.Now.Date; end = start.AddDays(14);
            }
            else
            {
                DateTime.TryParse(startDate, out start); end = start.AddDays(14);
            }

            hotel_info hotel = new hotel_info();
            var hotels = new HotelInfoHelp().getHotlList("");
            hotel.HotelList = hotels;
            if (string.IsNullOrEmpty(Id) && hotels.Count > 0)
                hotel_id = hotels[0].hotel_id;

            hotel.Room.RoomList = HotelInfoHelp.getRooms(hotel_id);

            var f = (from p in db.roomStatuss where p.r_s_time >= start && p.r_s_time <= end && p.hotel_id == hotel_id select p).ToList();
            hotel.Room.RoomStatus.RoomStatusList = f;
            
       
            ViewBag.startDate = start.ToString("yyyy-MM-dd");
            ViewData["dates"] = HotelInfoHelp.getDate(start, end); ViewBag.Id = Convert.ToInt32(hotel_id);
            return hotel;
        }
コード例 #2
0
ファイル: DrrRuleController.cs プロジェクト: Estay/signSystem
 public void oprationed(string id)
 {
     string u_id = "test1";
     var drrs = new HotelInfoHelp().getHotlList(u_id);
     ViewData["hotels"] = drrs;
     ViewData["drrModes"] = help.HotelInfoHelp.getDrrModeList(u_id);
     if (id == null && drrs.Count > 0)
     {
         GetData(drrs[0].hotel_id.ToString());
     }
     else
     {
         GetData(id);
     }
     
 }
コード例 #3
0
        public void GetData(string id)
        {
            string u_id = "test1";
            int hotel_id;
            int.TryParse(id, out hotel_id);
            var hotels = new HotelInfoHelp().getHotlList(u_id);
            if(id==null &&hotels.Count>0)
                hotel_id = hotels[0].hotel_id;
         
            ViewData["hotels"] = hotels;
            //所有酒店列表
            ViewData["rooms"] = help.HotelInfoHelp.getRooms(hotel_id);

            //所有酒店对应的房型列表

            ViewData["Gurarantees"] = new GuaranteeRule().GuraranteeList(hotel_id);
            ViewBag.Id = hotel_id;
        }
コード例 #4
0
ファイル: GiftController.cs プロジェクト: Estay/signSystem
 public void GetData(string id)
 {
     int hotel_id;
     int.TryParse(id, out hotel_id);
     string u_id = "test1";
     var hotels = new HotelInfoHelp().getHotlList(u_id);
     ViewData["hotels"] = hotels;
     if (id == null && hotels.Count > 0)
     {
         hotel_id = hotels[0].hotel_id;
     }
     ViewData["gift"] = new Gift().GiftList(hotel_id);
     ViewData["rooms"] = help.HotelInfoHelp.getRooms(hotel_id);
     ViewBag.Id = hotel_id;
     //所有酒店列表
     
     //所有酒店对应的房型列表
   
 }
コード例 #5
0
ファイル: CommentController.cs プロジェクト: Estay/signSystem
        public Hotel_comment_info getdata(string hotelId, string IsReply, string page, string startTime, string endTime)
        {
            int currentPage = 1; int.TryParse(page, out currentPage);

            //List<hotel_info> list = new HotelInfoHelp().getHotlList("");

            //string hotelIds = string.Empty;
            //if (string.IsNullOrEmpty(hotelId))
            //{
            //    foreach (var item in list)
            //    {
            //        if (string.IsNullOrEmpty(hotelId))
            //            hotelId += item.hotel_id;
            //        else
            //            hotelId += "," + item.hotel_id;
            //    }

            //}
            //MobileContractClient client = new MobileContractClient();
            //client.ClientCredentials.UserName.UserName = help.StringHelper.appSettings("WCFUserName");
            //client.ClientCredentials.UserName.Password = help.StringHelper.appSettings("WCFPassWord");
            DateTime s = new HotelInfoHelp().getStartDate(startTime); DateTime e = new HotelInfoHelp().getEndDate(endTime);
            //var coments = client.GetHotelCommentList(new CommentHParamsDTO() { Hotel_id = hotelId, IsReply = false, currentPage = currentPage, pageSize = HotelInfoHelp.pageSize, StartTime = s, EndTime = e });
            List<hotel_info> list; object allpage;
            Hotel_comment_info ment = new Hotel_comment_info();
            ment.CommnetList = ment.getComments(hotelId, IsReply, s, e, currentPage, out allpage, out list);
            ViewData["hotels"] = list;
            ViewBag.startTime = s.ToString("yyyy-MM-dd");
            ViewBag.endTime = e.ToString("yyyy-MM-dd");
            int t = string.IsNullOrEmpty(hotelId) ? 0 : Convert.ToInt32(hotelId);
            ViewBag.currentHotelId = string.IsNullOrEmpty(hotelId) ?0: Convert.ToInt32(hotelId);
            ViewBag.allPage = allpage;
            ViewBag.IsReply = IsReply;
            ViewBag.curentPage = currentPage == 0 ? currentPage + 1 : currentPage;
           
            
            return ment;
        }
コード例 #6
0
ファイル: DrrRuleController.cs プロジェクト: Estay/signSystem
        public void GetData()
        {
            
            string u_id = "test1";
            ViewData["drrModes"] = help.HotelInfoHelp.getDrrModeList(u_id);
            ViewData["hotels"] = new HotelInfoHelp().getHotlList(u_id);

           // //所有酒店列表
           // ViewData["rooms"] = help.HotelInfoHelp.getRooms(u_id);
           // //所有酒店对应的房型列表
            
           //// ViewData["drrModes"] = help.HotelInfoHelp.getDrrModeList(u_id);
           // ViewData["drrs"] = help.HotelInfoHelp.getDrrList(u_id);

           
        }
コード例 #7
0
 //删除公寓
 public int delApart(string hotelId)
 {
     try
     {
         
         int.TryParse(hotelId, out hotel_id); string u_id = new HotelInfoHelp().getUId();
         using (db = new HotelDBContent())
         {
             ((from h in db.hotel where h.hotel_id == hotel_id && h.source_id == 5 && h.u_id == u_id select h).SingleOrDefault()).h_state=false;
             result = db.SaveChanges() > 0 ? 1 : 0;
        }
     }
     catch (Exception)
     {
         result = 0;
     }
     return result;
 }
コード例 #8
0
ファイル: Order_info.cs プロジェクト: Estay/signSystem
        public List<Order_info> getOrderInfos(string start,string end, Order_info order)
        {
            int orderState = 0; DateTime s, e; DateTime.TryParse(start, out s); DateTime.TryParse(end, out e);
            List<Order_info> list = new List<Order_info>();
           // int.TryParse(state.ToString(), out orderState);
            try
            {
                using (DBC.HotelDBContent db = new DBC.HotelDBContent())
                {
                    string uId = new HotelInfoHelp().getUId();
                    int[] rf = (from h in db.hotel where h.u_id == uId select h.hotel_id).ToArray();

                    list = (from o in db.orders where rf.Contains(o.hotel_id) && o.o_ctime >= s && o.o_ctime<=e select o).ToList();

                }
                // uId = "test1";

                // var f = from h in db.drrs where rf.Contains(h.hotel_id) select h;

            }
            catch (Exception ex)
            {

                throw ex;
            }
            return list;

        }
コード例 #9
0
ファイル: Order_info.cs プロジェクト: Estay/signSystem
        public List<Order_info> getOrderInfos(orderStatus state)
        {
           
            int orderState = (int)state;;
            List<Order_info> list=new List<Order_info>();
            try
            {
                using (DBC.HotelDBContent db = new DBC.HotelDBContent())
                {
                    string uId = new HotelInfoHelp().getUId();
                    int[] rf = (from h in db.hotel where h.u_id == uId select h.hotel_id).ToArray();
                   
                        list = (from o in db.orders where rf.Contains(o.hotel_id) && o.o_state_id == orderState select o).ToList();
                    
                }
                // uId = "test1";

                // var f = from h in db.drrs where rf.Contains(h.hotel_id) select h;
                
            }
            catch (Exception e)
            {

                throw e;
            }
            return list;
           
        }