Example #1
0
        public HttpResponseMessage SelectItem(HttpRequestMessage req, RP_SelectItem rpSelectItem)
        {
            if (rpSelectItem != null)
            {
                RM_SelectItem rmSelectItem = new RM_SelectItem();
                List<RPR_SelectItem> rprSelectItem = rmSelectItem.SelectItem(rpSelectItem);

                if (rmSelectItem._IsSuccess)
                    return req.CreateResponse<List<RPR_SelectItem>>(HttpStatusCode.Created, rprSelectItem);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
Example #2
0
 public List<RPR_SelectItem> SelectItem(RP_SelectItem rpSelectItem)
 {
     this.SpName = "DigitalMenu_SelectItem"; //Sp Name
     _IsSuccess = true;
     try
     {
         SqlParameter[] param = new SqlParameter[5];
         param[0] = new SqlParameter("@CategoryId", rpSelectItem.CategoryId.Trim());
         param[1] = new SqlParameter("@key", rpSelectItem.key);
         param[2] = new SqlParameter("@RestId", int.Parse(rpSelectItem.RestId));
         param[3] = new SqlParameter("@CusId", int.Parse(rpSelectItem.CusId));
         param[4] = new SqlParameter("@ItemId", rpSelectItem.ItemId);
         ds = db.GetDataSet(this.SpName, param);
         if (ds != null && ds.Tables.Count > 0)
         {
             rprSelectItem = SerializeData.SerializeMultiValue<RPR_SelectItem>(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         _IsSuccess = false;
         Logger.WriteLog(LogLevelL4N.ERROR, " Select Category | Exception : " + ex.Message);
     }
     return rprSelectItem;
 }