Beispiel #1
0
        public IActionResult SaveChange(InvoicePayment model)
        {
            string note   = AppGlobal.InitString;
            int    result = 0;

            if (model.Id > 0)
            {
                model.Initialization(InitType.Update, RequestUserID);
                result = _invoicePaymentResposistory.Update(model.Id, model);
                if (result > 0)
                {
                    note = AppGlobal.Success + " - " + AppGlobal.EditSuccess;
                }
                else
                {
                    note = AppGlobal.Success + " - " + AppGlobal.EditFail;
                }
            }
            else
            {
                model.Initialization(InitType.Insert, RequestUserID);
                result = _invoicePaymentResposistory.Create(model);
                if (result > 0)
                {
                    note = AppGlobal.Success + " - " + AppGlobal.CreateSuccess;
                }
                else
                {
                    note = AppGlobal.Success + " - " + AppGlobal.CreateFail;
                }
            }
            return(Json(note));
        }
        public ActionResult <string> SaveChange(InvoicePayment model)
        {
            Result routeResult;
            int    result = 0;

            if (model.Id > 0)
            {
                model.Initialization(InitType.Update, RequestUserID);
                result = _invoicePaymentResposistory.Update(model.Id, model);

                if (result > 0)
                {
                    routeResult = new Result()
                                  .setResultType(ResultType.Success)
                                  .setMessage(AppGlobal.EditSuccess);
                }
                else
                {
                    routeResult = new Result()
                                  .setResultType(ResultType.Error)
                                  .setErrorType(ErrorType.EditError)
                                  .setMessage(AppGlobal.EditFail);
                }
            }
            else
            {
                model.Initialization(InitType.Insert, RequestUserID);
                result = _invoicePaymentResposistory.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));
        }
Beispiel #3
0
        public IActionResult Create(InvoicePayment model)
        {
            string note = AppGlobal.InitString;

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

            if (result > 0)
            {
                note = AppGlobal.Success + " - " + AppGlobal.CreateSuccess;
            }
            else
            {
                note = AppGlobal.Success + " - " + AppGlobal.CreateFail;
            }
            return(Json(note));
        }