Exemplo n.º 1
0
        public HttpResponseMessage CustomerTransactionDetails(HttpRequestMessage req, RP_CustomerTransactionDetails rpCustomerTransactionDetails)
        {
            if (rpCustomerTransactionDetails != null)
            {
            RM_CustomerTransactionDetails rmCustomerTransactionDetails = new RM_CustomerTransactionDetails();
            List<RPR_CustomerTransactionDetails> rprCustomerTransactionDetails = rmCustomerTransactionDetails.CustomerTransactionDetails(rpCustomerTransactionDetails);

            if (rmCustomerTransactionDetails._IsSuccess)
            return req.CreateResponse<List<RPR_CustomerTransactionDetails>>(HttpStatusCode.Created, rprCustomerTransactionDetails);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
Exemplo n.º 2
0
 public List<RPR_CustomerTransactionDetails> CustomerTransactionDetails(RP_CustomerTransactionDetails rpCustomerTransactionDetails)
 {
     this.SpName = "DigitalMenu_CustomerTransDetails"; //Sp Name
     _IsSuccess = true;
     try
     {
         SqlParameter[] param = new SqlParameter[5];
         param[0] = new SqlParameter("@CusId", int.Parse(rpCustomerTransactionDetails.CusId));
         param[1] = new SqlParameter("@RestId", int.Parse(rpCustomerTransactionDetails.RestId));
         param[2] = new SqlParameter("@key", rpCustomerTransactionDetails.key);
         param[3] = new SqlParameter("@date", string.IsNullOrEmpty(rpCustomerTransactionDetails.date) ? Convert.DBNull : Convert.ToDateTime(rpCustomerTransactionDetails.date).Date);
         param[4] = new SqlParameter("@BillNo", rpCustomerTransactionDetails.BillNo);
         ds = db.GetDataSet(this.SpName, param);
         if (ds != null && ds.Tables.Count > 0)
         {
             rprCustomerTransactionDetails = SerializeData.SerializeMultiValue<RPR_CustomerTransactionDetails>(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         _IsSuccess = false;
         Logger.WriteLog(LogLevelL4N.ERROR, " Customer date wise  Transaction  | Exception : " + ex.Message);
     }
     return rprCustomerTransactionDetails;
 }