Exemplo n.º 1
0
        public HttpResponseMessage CustomerCheckout(HttpRequestMessage req, RP_CustomerCheckout rpCustomerCheckout)
        {
            if (rpCustomerCheckout != null)
            {
                RM_CustomerCheckout rmCustomerCheckout = new RM_CustomerCheckout();
                List<RPR_CustomerCheckout> rprCustomerCheckout = rmCustomerCheckout.OrderItem(rpCustomerCheckout);

                if (rmCustomerCheckout._IsSuccess)
                    return req.CreateResponse<List<RPR_CustomerCheckout>>(HttpStatusCode.Created, rprCustomerCheckout);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
0
        public List<RPR_CustomerCheckout> OrderItem(RP_CustomerCheckout rpCustomerCheckout)
        {
            this.SpName = "DigitalMenu_CustomerCheckOut"; //Sp Name
            _IsSuccess = true;
            try
            {
                SqlParameter[] param = new SqlParameter[5];
                param[0] = new SqlParameter("@key", rpCustomerCheckout.key);
                param[1] = new SqlParameter("@RestId", int.Parse(rpCustomerCheckout.RestId));
                param[2] = new SqlParameter("@CusId", int.Parse(rpCustomerCheckout.CusId));
                param[3] = new SqlParameter("@cusFeedback", rpCustomerCheckout.CusFeeBack);
                param[4] = new SqlParameter("@WaiterId", rpCustomerCheckout.WaiterId);
                ds = db.GetDataSet(this.SpName, param);
                if (ds != null && ds.Tables.Count > 0)
                {
                    rprCustomerCheckout = SerializeData.SerializeMultiValue<RPR_CustomerCheckout>(ds.Tables[0]);

                }
            }
            catch (Exception ex)
            {
                _IsSuccess = false;
                Logger.WriteLog(LogLevelL4N.ERROR, " Customer CheckOut | Exception : " + ex.Message);
            }
            return rprCustomerCheckout;
        }