Exemplo n.º 1
0
        public HttpResponseMessage CustomerTransaction(HttpRequestMessage req, RP_CustomerTransaction rpCustomerTransaction)
        {
            if (rpCustomerTransaction != null)
            {
            RM_CustomerTransaction rmCustomerTransaction = new RM_CustomerTransaction();
            List<RPR_CustomerTransaction> rprCustomerTransaction = rmCustomerTransaction.CustomerTransaction(rpCustomerTransaction);

            if (rmCustomerTransaction._IsSuccess)
            return req.CreateResponse<List<RPR_CustomerTransaction>>(HttpStatusCode.Created, rprCustomerTransaction);

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

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
Exemplo n.º 2
0
        public List<RPR_CustomerTransaction> CustomerTransaction(RP_CustomerTransaction rpCustomerTransaction)
        {
            this.SpName = "DigitalMenu_CustomerTrans"; //Sp Name
            _IsSuccess = true;
            try
            {
                SqlParameter[] param = new SqlParameter[3];
                param[0] = new SqlParameter("@CusId", int.Parse(rpCustomerTransaction.CusId));
                param[1] = new SqlParameter("@RestId", int.Parse(rpCustomerTransaction.RestId));
                param[2] = new SqlParameter("@key", rpCustomerTransaction.key);

                ds = db.GetDataSet(this.SpName, param);
                if (ds != null && ds.Tables.Count > 0)
                {
                    rprCustomerTransaction = SerializeData.SerializeMultiValue<RPR_CustomerTransaction>(ds.Tables[0]);
                }
            }
            catch (Exception ex)
            {
                _IsSuccess = false;
                Logger.WriteLog(LogLevelL4N.ERROR, " Customer Transaction  | Exception : " + ex.Message);
            }
            return rprCustomerTransaction;
        }