Пример #1
0
 public Workplace(IChair chair, DeskType deskType, int deskWidth, int deskLength, int deskHeight)
 {
     Chair      = chair;
     DeskType   = deskType;
     DeskWidth  = deskWidth;
     DeskLength = deskLength;
     DeskHeight = deskHeight;
 }
Пример #2
0
 public INeedsAnOptional SetADesk(DeskType deskType, int width, int length, int height)
 {
     this.deskType = deskType;
     this.width    = width;
     this.height   = height;
     this.length   = length;
     return(new WorkplaceBuilder(this));
 }
Пример #3
0
    static int IntToEnum(IntPtr L)
    {
        int      arg0 = (int)LuaDLL.lua_tonumber(L, 1);
        DeskType o    = (DeskType)arg0;

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Пример #4
0
        /// <summary>
        /// 新增餐桌类别
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public async Task <IActionResult> AddDeskType([FromBody] DeskType type)
        {
            type.BusinessId = Business.ID;
            type.Status     = EntityStatus.Normal;
            await Service.AddAsync(type);

            return(Json(new JsonData {
                Success = true, Msg = "新增成功", Data = type
            }));
        }
Пример #5
0
 private WorkplaceBuilder(WorkplaceBuilder other)
 {
     this.optionals    = other.optionals.Clone();
     this.deskType     = other.deskType;
     this.width        = other.width;
     this.height       = other.height;
     this.length       = other.length;
     this.chair        = other.chair;
     this.employeeName = other.employeeName;
 }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        mGameType       = PlatformGameDefine.game.GameIconType;
        mDeskType       = PlatformGameDefine.game.GameDeskType;
        kRoomTitle.text = SocketConnectInfo.Instance.roomTitle;
        if (mDeskType == DeskType.DeskType_All)
        {
            kQuickPlayButton.SetActive(false);
        }

        StartCoroutine(DoSocketConnect());
    }
Пример #7
0
        public void Describe()
        {
            Console.WriteLine($"Chair: {Chair.Name} ( {Chair.Height} cm)");
            Console.WriteLine($"{DeskType.ToString()} Desk ( {DeskWidth}x{DeskLength}x{DeskHeight} cm)");
            if (Optionals.Any())
            {
                Console.WriteLine("Optionals: ");

                foreach (var optional in Optionals)
                {
                    Console.WriteLine(optional.Name);
                }
            }

            if (string.IsNullOrWhiteSpace(EmployeeName) == false)
            {
                Console.WriteLine($"Workplace was prepared for {EmployeeName}");
            }
            Console.WriteLine();
        }
Пример #8
0
        public async Task <JsonData> DeleteDeskTypeAsync(int id)
        {
            var result    = new JsonData();
            var deskCount = await Context.Desks.CountAsync(a => a.DeskTypeId == id && a.Status == EntityStatus.Normal);

            if (deskCount > 0)
            {
                result.Msg = "类别下存在餐桌,不允许删除";
                return(result);
            }
            var entity = new DeskType {
                ID = id
            };

            Context.Attach(entity);
            entity.Status = EntityStatus.Deleted;
            await Context.SaveChangesAsync();

            result.Msg     = "删除成功";
            result.Success = true;
            return(result);
        }
Пример #9
0
        public async Task <bool> IsExistDeskTypeAsync(DeskType type)
        {
            var name = type.Name.ToLower();

            return(await Context.DeskTypes.CountAsync(a => a.BusinessId == type.BusinessId && type.Name.ToLower() == name) > 0);
        }
Пример #10
0
 public Desk(DeskType type)
 {
     Type = type;
 }