예제 #1
0
        public JsonResult SaveUser([FromBody] dynamic data)
        {
            JsonResult            jsonResult            = new JsonResult();
            StoredProcedureOutput storedProcedureOutput = new StoredProcedureOutput();

            storedProcedureOutput = _myHellServices.InsertUser(data.Id == null?0:(int)data.Id, data.Name.ToString(), data.Email.ToString(), data.Password.ToString(), (bool)data.Active);

            jsonResult.Message = storedProcedureOutput.Message;
            jsonResult.Error   = storedProcedureOutput.Error;
            return(jsonResult);
        }
예제 #2
0
        public JsonResult GetAllUsers()
        {
            JsonResult            jsonResult            = new JsonResult();
            StoredProcedureOutput storedProcedureOutput = new StoredProcedureOutput();

            storedProcedureOutput = _myHellServices.GetAllUser(0, 0);
            jsonResult.Object     = storedProcedureOutput.DataSet;
            jsonResult.Message    = storedProcedureOutput.Message;
            jsonResult.Error      = storedProcedureOutput.Error;
            return(jsonResult);
        }
예제 #3
0
        public JsonResult GetCategoryById(int id)
        {
            JsonResult            jsonResult            = new JsonResult();
            StoredProcedureOutput storedProcedureOutput = new StoredProcedureOutput();

            storedProcedureOutput = _myHellServices.GetCategoryById(id);
            jsonResult.Object     = storedProcedureOutput.DataSet;
            jsonResult.Message    = storedProcedureOutput.Message;
            jsonResult.Error      = storedProcedureOutput.Error;
            return(jsonResult);
        }
예제 #4
0
        public JsonResult SaveCategory([FromBody] dynamic data)
        {
            JsonResult            jsonResult            = new JsonResult();
            StoredProcedureOutput storedProcedureOutput = new StoredProcedureOutput();

            storedProcedureOutput = _myHellServices.InsertCategory(data.Id == null ? 0 : (int)data.Id, data.Category_Name.ToString(), data.Category_Type.ToString(), (bool)data.Active);

            jsonResult.Message = storedProcedureOutput.Message;
            jsonResult.Error   = storedProcedureOutput.Error;
            return(jsonResult);
        }
예제 #5
0
        public JsonResult SaveTransaction([FromBody] dynamic data)
        {
            JsonResult            jsonResult            = new JsonResult();
            StoredProcedureOutput storedProcedureOutput = new StoredProcedureOutput();

            storedProcedureOutput = _myHellServices.InsertTransaction(data.Id == null ? 0 : (int)data.Id, (decimal)data.Amount, (int)data.CategoryId, (int)data.UserId, (bool)data.Active);

            jsonResult.Message = storedProcedureOutput.Message;
            jsonResult.Error   = storedProcedureOutput.Error;
            return(jsonResult);
        }
 public StoredProcedureOutputModel()  // required for json serialization
 {
     _item = new StoredProcedureOutput();
 }
 public StoredProcedureOutputModel(StoredProcedureOutput item)
 {
     _item = item;
 }