コード例 #1
0
ファイル: WaitorController.cs プロジェクト: itsjs23/Pabulum
        public HttpResponseMessage ViewAllTableBills(HttpRequestMessage req, RP_ViewAllTableBills rpViewAllTableBills)
        {
            if (rpViewAllTableBills != null)
            {
                RM_ViewAllTableBills rmViewAllTableBills = new RM_ViewAllTableBills();
                List<RPR_ViewAllTableBills> rprViewAllTableBills = rmViewAllTableBills.ViewAllTableBills(rpViewAllTableBills);

                if (rmViewAllTableBills._IsSuccess)
                    return req.CreateResponse<List<RPR_ViewAllTableBills>>(HttpStatusCode.Created, rprViewAllTableBills);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
コード例 #2
0
ファイル: WaitorModal.cs プロジェクト: itsjs23/Pabulum
 public List<RPR_ViewAllTableBills> ViewAllTableBills(RP_ViewAllTableBills rpViewAllTableBills)
 {
     this.SpName = "DigitalMenu_ViewAllTableBills"; //Sp Name
     _IsSuccess = true;
     try
     {
         SqlParameter[] param = new SqlParameter[4];
         param[0] = new SqlParameter("@key", rpViewAllTableBills.key);
         param[1] = new SqlParameter("@PosId", int.Parse(rpViewAllTableBills.PosId));
         param[2] = new SqlParameter("@RestId", int.Parse(rpViewAllTableBills.RestId));
         param[3] = new SqlParameter("@WaitorId", string.IsNullOrEmpty(rpViewAllTableBills.WaitorId) ? Convert.DBNull : rpViewAllTableBills.WaitorId);
         ds = db.GetDataSet(this.SpName, param);
         if (ds != null && ds.Tables.Count > 0)
         {
             rprViewAllTableBills = SerializeData.SerializeMultiValue<RPR_ViewAllTableBills>(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         _IsSuccess = false;
         Logger.WriteLog(LogLevelL4N.ERROR, " Confirm Order | Exception : " + ex.Message);
     }
     return rprViewAllTableBills;
 }