Ejemplo n.º 1
0
        public HttpResponseMessage JoinTable(HttpRequestMessage req, Rp_JoinTable rpJoinTable)
        {
            if (rpJoinTable != null)
            {
            RM_JoinTable rmJoinTable = new RM_JoinTable();
            List<RPR_JoinTable> rprJoinTable = rmJoinTable.JoinTable(rpJoinTable);

            if (rmJoinTable._IsSuccess)
            return req.CreateResponse<List<RPR_JoinTable>>(HttpStatusCode.Created, rprJoinTable);

            return req.CreateErrorResponse(HttpStatusCode.InternalServerError, "ServerError");
            }

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
Ejemplo n.º 2
0
        public List<RPR_JoinTable> JoinTable(Rp_JoinTable rpJoinTable)
        {
            this.SpName = "DigitalMenu_JoinTable"; //Sp Name
            _IsSuccess = true;
            string RegId = "";
            string msg = "";
            try
            {
                SqlParameter[] param = new SqlParameter[4];
                param[0] = new SqlParameter("@TableNumber", int.Parse(rpJoinTable.TableNumber));
                param[1] = new SqlParameter("@RestId", int.Parse(rpJoinTable.RestId));
                param[2] = new SqlParameter("@key", rpJoinTable.key);
                param[3] = new SqlParameter("@Mobile", rpJoinTable.Mobile);

                ds = db.GetDataSet(this.SpName, param);
                if (ds != null && ds.Tables.Count > 0)
                {
                    DataRowCollection drc = ds.Tables[0].Rows;
                    foreach (DataRow item in drc)
                    {
                        RegId = "" + item["GCMRegId"];
                    }
                    msg = "Join Request From Table" + rpJoinTable.TableNumber;
                    AndroidGCMPushNotification apnGCM = new AndroidGCMPushNotification();
                    //apnGCM.SendNotification(RegId, msg);

                    //rprJoinTable = SerializeData.SerializeMultiValue<RPR_JoinTable>(ds.Tables[0]);

                }
            }
            catch (Exception ex)
            {
                _IsSuccess = false;
                Logger.WriteLog(LogLevelL4N.ERROR, " Join Table | Exception : " + ex.Message);
            }
            return rprJoinTable;
        }