Ejemplo n.º 1
0
        public IActionResult Create(InvoiceDetail model)
        {
            string note = AppGlobal.InitString;

            model.Initialization(InitType.Insert, RequestUserID);
            int result = _invoiceDetailResposistory.Create(model);

            if (result > 0)
            {
                note = AppGlobal.Success + " - " + AppGlobal.CreateSuccess;
            }
            else
            {
                note = AppGlobal.Success + " - " + AppGlobal.CreateFail;
            }
            return(Json(note));
        }
        public ActionResult <string> Create(InvoiceDetail model)
        {
            Result routeResult;

            model.Initialization(InitType.Insert, RequestUserID);
            int result = _invoiceDetailResposistory.Create(model);

            if (result > 0)
            {
                routeResult = new Result()
                              .setResultType(ResultType.Success)
                              .setMessage(AppGlobal.CreateSuccess);
            }
            else
            {
                routeResult = new Result()
                              .setResultType(ResultType.Error)
                              .setErrorType(ErrorType.InsertError)
                              .setMessage(AppGlobal.CreateFail);
            }

            return(ObjectToJson(routeResult));
        }