public IHttpActionResult Post([FromBody] GamesMaster approveGame)
        {
            string message = "approved";
            bool   flag    = false;

            try
            {
                object infoObject;
                Request.Properties.TryGetValue(Constants.IdentificationInfo, out infoObject);
                DBServerIdentification identificationInfo = (DBServerIdentification)infoObject;
                DataSQL    objSQL = new DataSQL(identificationInfo);
                GamesLogic gl     = new GamesLogic(objSQL);
                flag    = gl.approveGame(approveGame);
                message = gl.errorMessage;
            }
            catch (Exception ex)
            {
                message = ex.Message;
                FileLogger.AppendLog("GamesController >> ", LogType.Error, "POST", ex.Message);
            }
            if (flag)
            {
                return(Ok(message));
            }
            else
            {
                return(BadRequest(message));
            }
        }
Esempio n. 2
0
        public bool approveGame(GamesMaster game)
        {
            bool flag = false;

            errorMessage = string.Empty;
            try
            {
                flag         = objSQL.approveGame(game);
                errorMessage = objSQL.errorMessage;
            }
            catch (Exception ex)
            {
                flag         = false;
                errorMessage = ex.Message;
                FileLogger.AppendLog("GamesLogic ", LogType.Error, "addNewGame >> ", ex.Message);
            }
            return(flag);
        }