public HttpResponseMessage UpdateWaiterProfile(HttpRequestMessage req, RP_UpdateWaiterProfile rpUpdateWaiterProfile) { if (rpUpdateWaiterProfile != null) { RM_UpdateWaiterProfile rmUpdateWaiterProfile = new RM_UpdateWaiterProfile(); List<RPR_UpdateWaiterProfile> rprUpdateWaiterProfile = rmUpdateWaiterProfile.UpdateWaiterProfile(rpUpdateWaiterProfile); if (rmUpdateWaiterProfile._IsSuccess) return req.CreateResponse<List<RPR_UpdateWaiterProfile>>(HttpStatusCode.Created, rprUpdateWaiterProfile); return req.CreateErrorResponse(HttpStatusCode.InternalServerError, "ServerError"); } return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request"); }
public List<RPR_UpdateWaiterProfile> UpdateWaiterProfile(RP_UpdateWaiterProfile rpUpdateWaiterProfile) { this.SpName = "DigitalMenu_UpdateWaiterProfile"; //Sp Name _IsSuccess = true; try { SqlParameter[] param = new SqlParameter[4]; param[0] = new SqlParameter("@key", rpUpdateWaiterProfile.key); param[1] = new SqlParameter("@WaiterId", rpUpdateWaiterProfile.WaiterId); param[2] = new SqlParameter("@RestId", int.Parse(rpUpdateWaiterProfile.RestId)); param[3] = new SqlParameter("@Email", rpUpdateWaiterProfile.Email); ds = db.GetDataSet(this.SpName, param); if (ds != null && ds.Tables.Count > 0) { rprUpdateWaiterProfile = SerializeData.SerializeMultiValue<RPR_UpdateWaiterProfile>(ds.Tables[0]); } } catch (Exception ex) { _IsSuccess = false; Logger.WriteLog(LogLevelL4N.ERROR, " update waiter profile | Exception : " + ex.Message); } return rprUpdateWaiterProfile; }