Exemple #1
0
        public Response Post([FromBody] Ikea ikea)
        {
            // add the user first
            var userId = userDao.AddUser(ikea.user);

            if (null == userId)
            {
                response = Utility.Utils.SetResponse(response, false, Constant.ErrorCode.EGeneralError);
                return(response);
            }

            // add the ikea delivery
            var result = ikeaDao.Add(ikea.unitNumber, ikea.project.id, userId, ikea.itemUrl);

            if (null == result)
            {
                response = Utility.Utils.SetResponse(response, false, Constant.ErrorCode.EGeneralError);
                return(response);
            }

            // temporary send email to notify admin
            var projectObj = ikeaProjectDao.Get(ikea.project.id);

            Utility.UtilEmail.SendIkeaOrderReceived(ikea.user, ikea.unitNumber, projectObj, ikea.itemUrl, result);

            response.payload = result;
            response         = Utility.Utils.SetResponse(response, true, Constant.ErrorCode.ESuccess);
            return(response);
        }
Exemple #2
0
 public MainGame()
 {
     Content.RootDirectory = "Content";
     Renderer = new SpriteRenderer(this);
     mine     = new Mine(this);
     ikea     = new Ikea(this);
 }