public HttpResponseMessage SelectTable(HttpRequestMessage req, RP_SelectTable rpSelectTable) { if (rpSelectTable != null) { RM_SelectTable rmSelectTable = new RM_SelectTable(); List<RPR_SelectTable> rprSelectTable = rmSelectTable.SelectTable(rpSelectTable); if (rmSelectTable._IsSuccess) return req.CreateResponse<List<RPR_SelectTable>>(HttpStatusCode.Created, rprSelectTable); return req.CreateErrorResponse(HttpStatusCode.InternalServerError, "ServerError"); } return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request"); }
public List<RPR_SelectTable> SelectTable(RP_SelectTable rpSelectTable) { this.SpName = "DigitalMenu_SelectTable"; //Sp Name _IsSuccess = true; try { SqlParameter[] param = new SqlParameter[5]; param[0] = new SqlParameter("@CusId", rpSelectTable.CusId); param[1] = new SqlParameter("@DeviceMac", rpSelectTable.DeviceMac.Trim()); param[2] = new SqlParameter("@key", rpSelectTable.key); param[3] = new SqlParameter("@RestId", int.Parse(rpSelectTable.RestId)); param[4] = new SqlParameter("@TableNo", rpSelectTable.TableNo.Trim()); ds = db.GetDataSet(this.SpName, param); if (ds != null && ds.Tables.Count > 0) { rprSelectTable = SerializeData.SerializeMultiValue<RPR_SelectTable>(ds.Tables[0]); } } catch (Exception ex) { _IsSuccess = false; Logger.WriteLog(LogLevelL4N.ERROR, " Select table | Exception : " + ex.Message); } return rprSelectTable; }