Ejemplo n.º 1
0
        public List<RPR_AllowToJoinTable> AllowToJoinTable(RP_AllowToJoinTable rpAllowToJoinTable)
        {
            this.SpName = "DigitalMenu_AllowToJoinTable"; //Sp Name
                _IsSuccess = true;
                 string CusRegId="";
                 string msg = "";
                try
                {
                    SqlParameter[] param = new SqlParameter[3];
                    param[0] = new SqlParameter("@key", rpAllowToJoinTable.key);
                    param[1] = new SqlParameter("@WaitorId", rpAllowToJoinTable.WaiterId);
                    param[2] = new SqlParameter("@RestId", int.Parse(rpAllowToJoinTable.RestId));
                    param[3] = new SqlParameter("@TableNumber", int.Parse(rpAllowToJoinTable.TableNumber));

                    ds = db.GetDataSet(this.SpName, param);
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        DataRowCollection drc = ds.Tables[0].Rows;
                        foreach (DataRow item in drc)
                        {
                            CusRegId = "" + item["CusRegId"];
                        }
                        msg = "Order From Table" + rpAllowToJoinTable.TableNumber;
                        AndroidGCMPushNotification apnGCM = new AndroidGCMPushNotification();
                        //apnGCM.SendNotification(CusRegId, msg);
                        //rprAllowToJoinTable = SerializeData.SerializeMultiValue<RPR_AllowToJoinTable>(ds.Tables[0]);
                    }
                }
                catch (Exception ex)
                {
                    _IsSuccess = false;
                    Logger.WriteLog(LogLevelL4N.ERROR, " Allow To Join Table | Exception : " + ex.Message);
                }
                return rprAllowToJoinTable;
        }
Ejemplo n.º 2
0
        public HttpResponseMessage AllowToJoinTable(HttpRequestMessage req, RP_AllowToJoinTable rpAllowToJoinTable)
        {
            if (rpAllowToJoinTable != null)
            {
                RM_AllowToJoinTable rmAllowToJoinTable = new RM_AllowToJoinTable();
                List<RPR_AllowToJoinTable> rprAllowToJoinTable = rmAllowToJoinTable.AllowToJoinTable(rpAllowToJoinTable);

                if (rmAllowToJoinTable._IsSuccess)
                    return req.CreateResponse<List<RPR_AllowToJoinTable>>(HttpStatusCode.Created, rprAllowToJoinTable);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }