Exemple #1
0
        public IHttpActionResult POSToSale([FromBody] cmlCouponCode poPara)
        {
            try
            {
                oC_CouponRes  = new cmlCouponRes();
                oC_CouponReq  = new cmlCouponReq();
                oC_CouponSale = new cCouponSale();
                oC_CouponLog  = new cCouponLog();
                if (ModelState.IsValid)
                {
                    oC_CouponRes = oC_CouponSale.c_CHKoCouponSale(poPara);
                    return(Json(oC_CouponRes));
                }
                else
                {
                    return(Json(oC_CouponRes));
                }
            }
            catch (Exception oEx)
            {
                log.Error(cExtensionMessageError.C_GEToErrorException(oEx));
                return(Json(new { ModelState = ModelState.C_GETtErrorModaleSta(), Exception = cExtensionMessageError.C_GEToErrorException(oEx) }));
            }

            finally
            {
                oC_CouponLog.CL_SETxCouponLog(oC_CouponReq, poPara, oC_CouponRes, null);
            }
        }
Exemple #2
0
        public IHttpActionResult POSToCreate([FromBody] cmlCouponReq poPara)
        {
            try
            {
                oC_CouponLog    = new cCouponLog();
                oC_CouponRes    = new cmlCouponRes();
                oC_CouponCreate = new cCouponCreate();
                if (ModelState.IsValid)
                {
                    tC_Message = oC_CouponCreate.c_SETtCouponCreate(poPara);

                    return(Json(new { tcml_CpnMSg = tC_Message }));
                    //  return Json(new { Message = tMessage, AccessToken = this.oAccessToKen.C_GETtGennerateAccessToken(poPara.tcml_WhoIns,5) });
                }
                else
                {
                    log.Warn(ModelState.C_GETtErrorModaleSta());

                    return(Json(ModelState.C_GETtErrorModaleSta()));
                }
            }
            catch (Exception oEx)
            {
                log.Error(cExtensionMessageError.C_GEToErrorException(oEx) + ModelState.C_GETtErrorModaleSta());

                return(Json(new { ModelState = ModelState.C_GETtErrorModaleSta(), Exception = cExtensionMessageError.C_GEToErrorException(oEx) }));
            }
            finally
            {
                oC_CouponLog.CL_SETxCouponLog(poPara, null, oC_CouponRes, tC_Message);
            }
        }