private void FrmCheckIn_Load(object sender, EventArgs e) { txtRoomNo.Text = ucRoomList.rm_RoomNo; Room r = new RoomService().SelectRoomByRoomNo(txtRoomNo.Text); RoomType t = new RoomTypeService().SelectRoomTypeByRoomNo(txtRoomNo.Text); txtType.Text = t.RoomName; txtMoney.Text = r.RoomMoney.ToString(); txtRoomPosition.Text = r.RoomPosition; txtState.Text = r.RoomState; List <Custo> ctos = new CustoService().SelectCustoAll(); List <Room> roms = new RoomService().SelectCanUseRoomAll(); for (int i = 0; i < roms.Count; i++) { txtRoomNo.AutoCompleteCustomSource.Add(roms[i].RoomNo); } for (int j = 0; j < ctos.Count; j++) { txtCustoNo.AutoCompleteCustomSource.Add(ctos[j].CustoNo); } try { txtCustoNo.Text = ""; } catch { txtCustoNo.Text = ucRoomList.rm_CustoNo; } }
public HttpResponseMessage UpdateImage(ImageItem image) { var svc = new RoomTypeService(); svc.UpdateImage(image); return(Request.CreateResponse(HttpStatusCode.OK)); }
public HttpResponseMessage Delete(string id) { var svc = new RoomTypeService(); svc.Delete(id); return(Request.CreateResponse(HttpStatusCode.NoContent)); }
/// <summary> /// 修改房间信息 /// </summary> /// <param name="RoomID">修改的房间ID</param> /// <param name="RoomName">房间名</param> /// <param name="RoomType">房间类型</param> /// <param name="NumBed">床数</param> /// <param name="NumCust">最大人数</param> /// <param name="Status">状态</param> /// <param name="type">类型,从0-5</param> /// <returns></returns> public static int ChangeRoomValue(int RoomID, string RoomName, string RoomType, int NumBed, int NumCust, string Status, string desc, int type) { switch (type) { case 0: return(RoomService.ChangeRoom(RoomID, RoomName, -1, -1, "", -1, -1, 1)); case 1: int TypeID = RoomTypeService.GetRoomTypeList(RoomType, false)[0].TypeID; return(RoomService.ChangeRoom(RoomID, "", TypeID, -1, "", -1, -1, 2)); case 2: return(RoomService.ChangeRoom(RoomID, "", -1, -1, "", NumBed, -1, 5)); case 3: return(RoomService.ChangeRoom(RoomID, "", -1, -1, "", -1, NumCust, 6)); case 4: int StatusID = RoomStatusService.FindStatusByKeyword(Status, false)[0].RoomStatusID; return(RoomService.ChangeRoom(RoomID, "", -1, StatusID, "", -1, NumCust, 3)); case 5: return(RoomService.ChangeRoom(RoomID, "", -1, -1, desc, -1, -1, 4)); default: return(-1); } }
/// <summary> /// 添加新房间 /// </summary> /// <param name="RoomName"></param> /// <param name="RoomType"></param> /// <param name="NumBed"></param> /// <param name="NumCust"></param> /// <param name="Status"></param> /// <param name="desc"></param> /// <returns>返回1为插入成功,-1为拒绝插入</returns> public static int AddNewRoom(string RoomName, string RoomType, int NumBed, int NumCust, string Status, string desc) { int typeid = RoomTypeService.GetRoomTypeList(RoomType, false)[0].TypeID; int statusid = RoomStatusService.FindStatusByKeyword(Status, false)[0].RoomStatusID; return(RoomService.AddNewRoom(RoomName, typeid, statusid, desc, NumBed, NumCust)); }
private async Task RoomTypeClick(IDialogContext context, IAwaitable <Activity> result) { var temp = await result; if (temp.Text != null && temp.Text.Length != 0) { await this.MessageReceived(context, result); return; } RoomType receivedRoom; using (RoomTypeService roomService = new RoomTypeService()) { receivedRoom = roomService.JsonToRoomType((Newtonsoft.Json.Linq.JObject)temp.Value); } IMessageActivity messageRooms; using (RoomService roomService = new RoomService()) { Activity activity = context.Activity as Activity; messageRooms = roomService.GetRoomsByRoomType(activity.CreateReply()); await context.PostAsync(messageRooms); context.Wait <Activity>(this.BookRoomClick); } }
public override async Task ProcessMessageReceived(IDialogContext context, string roomCategoryName) { List <string> roomTypeCatIds; using (RoomTypeService roomTypeService = new RoomTypeService()) { roomTypeCatIds = roomTypeService.GetRoomTypeID(); //CurentRoomType =roomTypeService.GetRoomTypeById() } if (roomTypeCatIds.IndexOf(roomCategoryName) != -1) { CurrentRoomTypeId = int.Parse(roomCategoryName); //await this.GetAvailableRoooms(context); int numRooms = 0; using (RoomService roomService = new RoomService()) { numRooms = (roomService.GetRoomsAvailable(Reservation.CheckInDateTime.ToString("MM/dd/yyyy"), Reservation.CheckOutDateTime.ToString("MM/dd/yyyy"), CurrentRoomTypeId)).Count; } context.Call(new RoomDialog(this.Reservation, CurrentRoomTypeId, numRooms), this.ResumeAfterRoomDialog); //context.Done(roomCategoryName); } else { //await context.PostAsync(string.Format(CultureInfo.CurrentCulture, Resources.FlowerCategoriesDialog_InvalidOption, flowerCategoryName)); await this.ShowProducts(context); context.Wait(this.MessageReceivedAsync); } }
public HttpResponseMessage DeleteImage(string roomTypeId, string imageId) { var svc = new RoomTypeService(); svc.DeleteImage(roomTypeId, imageId); return(Request.CreateResponse(HttpStatusCode.OK)); }
public HttpResponseMessage UploadImages(string roomTypeId) { var svc = new RoomTypeService(); svc.UploadImages(roomTypeId, HttpContext.Current.Request.Files); return(Request.CreateResponse(HttpStatusCode.OK)); }
public HotelController() { _attributeService = new AttributeService(); _definitionService = new DefinitionService(); _hotelTypeService = new HotelTypeService(); _hotelService = new HotelService(); _roomTypeService = new RoomTypeService(); }
public HttpResponseMessage Delete(string id) { return(Execute(session => { RoomTypeService.Delete(id); return new HttpResponseMessage(HttpStatusCode.NoContent); })); }
private void UpdateCapacity(int roomTypeId, int numRooms) { using (RoomTypeService roomTypeService = new RoomTypeService()) { RoomType roomType = roomTypeService.GetRoomTypeById(roomTypeId); Capacity = roomType.MaxPeople * numRooms; } }
public static List <Room> GetRoomList(string TypeName) { RoomType typenode = RoomTypeService.GetRoomTypeList(TypeName, false)[0];//获取类型节点 List <Room> list = RoomService.GetRoomListByType(typenode.TypeID); return(list); }
public HttpResponseMessage Update(RoomType roomType) { return(Execute(session => { RoomTypeService.Update(roomType); return new HttpResponseMessage(HttpStatusCode.NoContent); })); }
/// <summary> /// 根据类型ID删除类型信息 /// </summary> /// <param name="typeId"></param> public static void DeleteRoomTypeByTypeId(int typeId) { try { RoomTypeService.DeleteRoomTypeByTypeId(typeId); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
/// <summary> /// 修改客房类型信息 /// </summary> /// <param name="roomType">类型实体对象</param> public static void ModifyRoomType(RoomType roomType) { try { RoomTypeService.ModifyRoomType(roomType); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
/// <summary> /// 根据类型ID得到类型实体对象 /// </summary> /// <param name="typeId">类型ID</param> /// <returns></returns> public static RoomType GetRoomTypeByTypeID(int typeId) { try { return(RoomTypeService.GetRoomTypeByTypeID(typeId)); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
/// <summary> /// 得到客房类型信息集合 /// </summary> /// <returns></returns> public static IList <RoomType> GetAllRoomTypes() { try { return(RoomTypeService.GetAllRoomTypes()); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
/// <summary> /// 根据类型名称得到类型ID /// </summary> /// <param name="typeName">类型名称</param> /// <returns></returns> public static int GetTypeIdTypeName(string typeName) { try { return(RoomTypeService.GetTypeIdByTypeName(typeName)); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
/// <summary> /// 模糊查询房间类型 /// </summary> /// <param name="typeName"></param> /// <returns></returns> public static List <RoomType> GetRoomType(string typeName = null) { try { return(RoomTypeService.GetRoomType(typeName)); } catch (Exception) { throw; } }
/// <summary> /// 删除房间类型 /// </summary> /// <param name="roomTypeId"></param> /// <returns></returns> public static bool DelRoomType(int roomTypeId) { try { return(RoomTypeService.DelRoomType(roomTypeId)); } catch (Exception) { throw; } }
/// <summary> /// 修改房间类型 /// </summary> /// <param name="roomType"></param> public static void UpdateRoomType(RoomType roomType) { try { RoomTypeService.UpdateRoomType(roomType); } catch (Exception) { throw; } }
/// <summary> /// 新增类型信息 /// </summary> /// <param name="roomType">类型实体对象集合</param> /// <returns></returns> public static int AddRoomType(RoomType roomType) { try { return(RoomTypeService.AddRoomType(roomType)); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
public static List <string> GetRoomTypeList() { List <string> list = new List <string>(); List <RoomType> roomtype = RoomTypeService.GetAllRoomType(); foreach (RoomType i in roomtype) { list.Add(i.TypeName); } return(list); }
public async Task RoomTypeInfo(IDialogContext context, LuisResult result) { //var reservationDialog = new FormDialog<Reservation>(this.reservation, Reservation.BuildOrderForm, FormOptions.PromptInStart); //context.Call(reservationDialog, this.ResumeAfterReservationDialog); using (RoomTypeService roomTypeService = new RoomTypeService()) { var message = roomTypeService.GetRoomTypes(context.MakeMessage()); await context.PostAsync(message); context.Wait(this.MessageReceived); //context.Wait<Activity>(this.RoomTypeClick); } }
public List <RoomType> GetByRoomTypeEx(string RoomTypeName) { RoomTypeService rts = new RoomTypeService(); try { return(rts.GetByRoomType(RoomTypeName)); } catch (Exception) { MessageBox.Show("业务逻辑层根据房间类型查询异常!"); return(null); } }
//Hàm này gọi service để truy vấn dữ liệu public override PagedCarouselCards GetCarouselCards(int pageNumber, int pageSize) { List <HeroCard> heroCards; using (RoomTypeService roomTypeService = new RoomTypeService()) { heroCards = roomTypeService.GetHeroCardsRoomType(Reservation.CheckInDateTime, Reservation.CheckOutDateTime); } return(new PagedCarouselCards { Cards = heroCards, TotalCount = heroCards.Capacity }); }
public List <RoomType> GetRoomFormRoomTypeEx() { RoomTypeService rts = new RoomTypeService(); try { return(rts.GetRoomTypeALL()); } catch (Exception) { MessageBox.Show("业务逻辑层查询全部异常!"); return(null); } }
private async Task ResumeAfterRoomDialog(IDialogContext context, IAwaitable <object> result) { var message = await result; //this.reservation.RoomID = Convert.ToInt32(message); int numRooms = Convert.ToInt32(message); RoomService roomService = new RoomService(); List <Room> roomsAvailable = roomService.GetRoomsAvailable(Reservation.CheckInDateTime.ToString("MM/dd/yyyy"), Reservation.CheckOutDateTime.ToString("MM/dd/yyyy"), CurrentRoomTypeId); using (RoomTypeService roomTypeService = new RoomTypeService()) { RoomType roomType = roomTypeService.GetRoomTypeById(CurrentRoomTypeId); //Capacity += roomType.MaxPeople * numRooms; for (int i = 0; i < numRooms; i++) { //this.Rooms.Add(roomsAvailable[i]); if (!ls.Contains(roomsAvailable[i].ID)) { ls.Add(roomsAvailable[i].ID); Capacity += roomType.MaxPeople; } } } if (Capacity < Reservation.Adult) { await context.PostAsync("Số phòng hiện tại không đáp ứng đủ lượng khách. Vui lòng chọn thêm phòng."); await this.ShowProducts(context); //ShowChooseMoreRoom(context); } else { //ls = new List<int>(); //foreach (Room r in Rooms) //{ // ls.Add(r.ID); //} context.Done(ls.ToList()); } //context.Call(this.dialogFactory.Create<BouquetsDialog, string>(this.order.FlowerCategoryName), this.AfterBouquetSelected); }
private void RoomTypeList_AfterSelect(object sender, TreeViewEventArgs e) { RoomsList.Items.Clear(); list = RoomManger.GetRoomList(RoomTypeList.SelectedNode.Text); foreach (Room i in list) { ListViewItem lvi = new ListViewItem(); lvi.ImageIndex = 0; lvi.Text = i.RoomNumber.Trim(); lvi.Tag = i; string output = "类型:" + RoomTypeService.GetRoomType(i.RoomTypeID).TypeName + "\r\n状态:" + RoomStatusService.FindStatusByID(i.RoomStatus).RoomStatusName + "\r\n描述:" + i.Description + "\r\n床数:" + i.NumOfBeds.ToString() + "\r\n最大居住人数:" + i.NumOfCust.ToString(); lvi.ToolTipText = output; RoomsList.Items.Add(lvi); } }