Esempio 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;
        }
Esempio n. 2
0
        protected void NotifyCheckout(RP_ConfirmOrder rpConfirmOrder)
        {
            this.SpName = "DigitalMenu_GetManager_GCM_RegID"; //Sp Name
                try
                {
                    SqlParameter[] param = new SqlParameter[1];
                   // param[0] = new SqlParameter("@WaitorId", rpConfirmOrder.WaitorId.Trim());
                    param[0] = new SqlParameter("@RestId", int.Parse(rpConfirmOrder.RestId));
                   // param[2] = new SqlParameter("@TableId", rpConfirmOrder.TableNo);

                    ds = db.GetDataSet(this.SpName, param);
                    string RegId = "";
                    string msg = "";
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        DataRowCollection drc = ds.Tables[0].Rows;
                        foreach (DataRow item in drc)
                        {
                            RegId = "" + item["RegID"];

                        }
                        msg = "Customer Checkout  From Table" + rpConfirmOrder.TableNo;
                        AndroidGCMPushNotification apnGCM = new AndroidGCMPushNotification();
                        //apnGCM.SendNotification(RegId, msg);

                    }
                }
                catch (Exception ex)
                {
                    Logger.WriteLog(LogLevelL4N.ERROR, " Unable To Send Notification: | Exception : " + ex.Message);
                }
        }
Esempio n. 3
0
        protected string GcmPushNotificationfn(string waiterId, string msg, string restId, string tableNum)
        {
            //this.SpName = "DigitalMenu_GetGCMRegId"; //Sp Name

            this.SpName = "[DigitalMenu_GetGCM_RegID]";
            try
            {
                SqlParameter[] param = new SqlParameter[2];
                param[0] = new SqlParameter("@WaitorId", waiterId);
                param[1] = new SqlParameter("@RestId", int.Parse(restId));
                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["RegID"].ToString();

                    }

                    AndroidGCMPushNotification apnGCM = new AndroidGCMPushNotification();
                    string deviceId = RegId;
                    //   string deviceId = "APA91bFKgxQBZve4dlbt-x20GE45PI9FyH3O3r80CwGpsZu3K3wem860wg4rHtf35hc3v-v4zyoyUSKCzNgce-fKTKE-is3nixMyMTxWW5TRwvnxc5ukvX51sySYeZ5kiEKR84uqq-Z_";
                    string message = msg;
                    string tickerText = tableNum; //"example test GCM";
                    string contentTitle = "content title GCM";
                    string ApiKey = "AIzaSyCclEA_Gbb70InvtsV9CXPQLGRjVesl1NA";// -- jaydev
                    // string ApiKey = "AIzaSyDFky610kEk8Q8crJqSvJgs9GhI60jvdFs";
                    string postData =
                    "{ \"registration_ids\": [ \"" + deviceId + "\" ], " +
                      "\"data\": {\"tickerText\":\"" + tickerText + "\", " +
                                 "\"contentTitle\":\"" + contentTitle + "\", " +
                                 "\"message\": \"" + message + "\"}}";

                    string response = apnGCM.SendGCMNotification(ApiKey, postData);

                    if (response == "error")
                    {
                        return "2";

                    }
                    else
                    {

                        string[] x = response.Split(',');
                        string success = x[1].Split(':')[1];
                        if (success == "1")
                        {
                            return "1";

                        }

                    }

                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog(LogLevelL4N.ERROR, " Unable To Send Notification: | Exception : " + ex.Message);
            }

            return "2";
        }
Esempio n. 4
0
        //GCM Notify Waitor
        protected void NotifyWaitor(RP_OrderItem rpOrderItem, string status)
        {
            if (Status.Equals('1'))
            {
                this.SpName = "DigitalMenu_GetGCMRegId"; //Sp Name
                try
                {
                    SqlParameter[] param = new SqlParameter[2];
                    param[0] = new SqlParameter("@WaitorId", rpOrderItem.WaiterId);
                    param[1] = new SqlParameter("@RestId", int.Parse(rpOrderItem.RestId));
                    // param[2] = new SqlParameter("@TableId", rpOrderItem.TableId);

                    ds = db.GetDataSet(this.SpName, param);
                    string RegId = "";
                    string msg = "";
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        DataRowCollection drc = ds.Tables[0].Rows;
                        foreach (DataRow item in drc)
                        {
                            RegId = "" + item["RegID"];

                        }
                        msg = "Order From Table" + rpOrderItem.TableId;
                        AndroidGCMPushNotification apnGCM = new AndroidGCMPushNotification();
                        //apnGCM.SendNotification(RegId, msg);

                    }
                }
                catch (Exception ex)
                {
                    Logger.WriteLog(LogLevelL4N.ERROR, " Unable To Send Notification: | Exception : " + ex.Message);
                }

            }
        }
Esempio n. 5
0
        protected void NotifyCheckout(RP_CustomerCheckout rpCustomerCheckout)
        {
            this.SpName = "DigitalMenu_GetGCMRegId"; //Sp Name
            try
            {
                SqlParameter[] param = new SqlParameter[2];
                param[0] = new SqlParameter("@WaitorId", rpCustomerCheckout.WaiterId);
                param[1] = new SqlParameter("@RestId", int.Parse(rpCustomerCheckout.RestId));
                // param[2] = new SqlParameter("@TableId", rpCustomerCheckout.TableId);

                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["RegID"];

                    }
                    //msg = "Customer Checkout  From Table" + rpCustomerCheckout.TableId;

                    // GCM STart
                    string RegId = "APA91bHuM_dbxRqmWdV_mnlEg5KmjyVSki7LgnxVkIzF8FC7h6RHcD-0ujawEpzT-Ywugm5h7S-VZHxqVogmWpmJdkM5N6ifTfmPjVILmzEBaMbcqii0QOErl55T-8joDHIubpxxc8b-L_PF8uew2D9oMHydpZJl0Q";
                    string msg = "hello";

                    AndroidGCMPushNotification apnGCM = new AndroidGCMPushNotification();
                    //apnGCM.SendNotification(RegId, msg);
                    string deviceId = RegId;// "DEVICE_REGISTRATION_ID";
                    string message = "some test message";
                    string tickerText = "example test GCM";
                    string contentTitle = "content title GCM";
                    string ApiKey = "AIzaSyBjNFw_1Y6W59gTvVaGIrb50NAKwN-LKwQ";
                    string postData =
                    "{ \"registration_ids\": [ \"" + deviceId + "\" ], " +
                      "\"data\": {\"tickerText\":\"" + tickerText + "\", " +
                                 "\"contentTitle\":\"" + contentTitle + "\", " +
                                 "\"message\": \"" + message + "\"}}";

                    string response = apnGCM.SendGCMNotification(ApiKey, postData);
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog(LogLevelL4N.ERROR, " Unable To Send Notification: | Exception : " + ex.Message);
            }
        }