Пример #1
0
        public IActionResult Add(AddMouseViewModel mouse)
        {
            MouseBusiness mouseBusiness = new MouseBusiness();
            var           result        = mouseBusiness.AddMouse(mouse);

            return(Ok(result));
        }
Пример #2
0
        public async Task <ActionResult> Add(AddMouseViewModel mouse)
        {
            mouse.CreatedBy = _userSessionHelper.GetUserSession().UserName;
            string apiUrl = _appUrlHelper.GetApiUrl(ApiUrlPath.MOUSE_ADD);
            var    result = await HttpUtilities.PostAsyncApi <ReturnResult <Mouse> >(apiUrl, JsonConvert.SerializeObject(mouse));

            return(Json(result));
        }
Пример #3
0
        public ReturnResult <Mouse> Add(AddMouseViewModel mouse)
        {
            DbProvider dbProvider = new DbProvider();
            string     outCode    = String.Empty;
            string     outMessage = String.Empty;
            StoredProcedureConfigs <Mouse> storedProcedureConfigs = new StoredProcedureConfigs <Mouse>();

            dbProvider.SetQuery("MOUSE_INSERT", CommandType.StoredProcedure)
            .SetParameter("Name", SqlDbType.NVarChar, mouse.Name, ParameterDirection.Input)
            .SetParameter("Status", SqlDbType.Int, mouse.Status, ParameterDirection.Input)
            .SetParameter("CreatedBy", SqlDbType.NVarChar, mouse.CreatedBy, ParameterDirection.Input)
            .SetParameter("ERROR_CODE", SqlDbType.NVarChar, DBNull.Value, 100, ParameterDirection.Output)
            .SetParameter("ERROR_MESSAGE", SqlDbType.NVarChar, DBNull.Value, 400, ParameterDirection.Output)
            .ExcuteNonQuery()
            .Complete();
            dbProvider.GetOutValue("ERROR_CODE", out outCode)
            .GetOutValue("ERROR_MESSAGE", out outMessage);
            return(new ReturnResult <Mouse>()
            {
                ErrorCode = outCode,
                ErrorMessage = outMessage,
            });
        }
Пример #4
0
 public ReturnResult <Mouse> AddMouse(AddMouseViewModel mouse)
 {
     return(MouseDAL.Add(mouse));
 }