Example #1
0
        public HttpResponseMessage Cancel([FromBody] scheduleCabModel objshareCabModel)
        {
            var re      = Request;
            var headers = re.Headers;

            if (headers.Contains("token"))
            {
                token = headers.GetValues("token").First();
            }

            var result = Authtoken.checkToken(token);

            if (result == true)
            {
                objschedulecabDL.cancelride(objshareCabModel);
                dt = objschedulecabDL.getresponses(objshareCabModel);
                var resp = Request.CreateResponse <ResponseModel>(HttpStatusCode.OK,
                                                                  new ResponseModel()
                {
                    message = "your ride Cancelled", output = dt, statuscode = Convert.ToInt16(HttpStatusCode.OK)
                });
                return(resp);
            }
            else
            {
                var resp = Request.CreateResponse <ResponseModel>(HttpStatusCode.OK, new ResponseModel()
                {
                    message = "UnAuthorized", statuscode = Convert.ToInt16(HttpStatusCode.OK), error = true
                });
                return(resp);
            }
        }
Example #2
0
        public DataTable getresponses(scheduleCabModel objshareCabModel)
        {
            try
            {
                return(Execution.ExecuteParamerizedSelectCommand("sp_schedulecab", new SqlParameter[]
                {
                    new SqlParameter("@schedulecabid", objshareCabModel.schedulecabid),
                    new SqlParameter("@empid", objshareCabModel.empid),

                    new SqlParameter("@Command", "GETRESPONSE"),
                }));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        public int cancelride(scheduleCabModel objscheduleCabModel)
        {
            try
            {
                return(Execution.ExecuteNonQuery_with_result("sp_schedulecab", new SqlParameter[]
                {
                    new SqlParameter("@Command", "CANCELBYUSER"),



                    new SqlParameter("@empid", objscheduleCabModel.empid),

                    new SqlParameter("@schedulecabid", objscheduleCabModel.schedulecabid),
                }));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #4
0
        public int insert_request(scheduleCabModel objshareCabModel)
        {
            try
            {
                return(Execution.ExecuteNonQuery_with_result("sp_schedulecab", new SqlParameter[]
                {
                    new SqlParameter("@Command", "INSERT"),

                    new SqlParameter("@empid", objshareCabModel.empid),
                    new SqlParameter("@requestdate", objshareCabModel.requestdate),
                    new SqlParameter("@requesttime", objshareCabModel.requesttime),
                    new SqlParameter("@userid", objshareCabModel.userid),
                    new SqlParameter("@picklocationid", objshareCabModel.locationid),
                    new SqlParameter("@ridestatus", 1),
                    new SqlParameter("@status", 1),
                }));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #5
0
        public HttpResponseMessage CabRequest([FromBody] scheduleCabModel objshareCabModel)
        {
            var re      = Request;
            var headers = re.Headers;

            if (headers.Contains("token"))
            {
                token = headers.GetValues("token").First();
            }

            var result = Authtoken.checkToken(token);

            if (result == true)
            {
                string date = Convert.ToString(objshareCabModel.requestdate);

                int schedulecabid = objschedulecabDL.insert_request(objshareCabModel);


                objshareCabModel.schedulecabid = schedulecabid;

                dt = objschedulecabDL.getresponses(objshareCabModel);
                var resp = Request.CreateResponse <ResponseModel>(HttpStatusCode.OK,
                                                                  new ResponseModel()
                {
                    message = "ok successfull", output = dt, statuscode = Convert.ToInt16(HttpStatusCode.OK)
                });
                return(resp);
            }
            else
            {
                var resp = Request.CreateResponse <ResponseModel>(HttpStatusCode.OK, new ResponseModel()
                {
                    message = "UnAuthorized", statuscode = Convert.ToInt16(HttpStatusCode.OK), error = true
                });
                return(resp);
            }
        }