public IActionResult Add(AddStorageDeviceViewModel storageDevice) { StorageDeviceBusiness storageDeviceBusiness = new StorageDeviceBusiness(); var result = storageDeviceBusiness.AddStorageDevice(storageDevice); return(Ok(result)); }
public async Task <ActionResult> Add(AddStorageDeviceViewModel mouse) { mouse.CreatedBy = _userSessionHelper.GetUserSession().UserName; string apiUrl = _appUrlHelper.GetApiUrl(ApiUrlPath.STORAGE_DEVICE_ADD); var result = await HttpUtilities.PostAsyncApi <ReturnResult <StorageDevice> >(apiUrl, JsonConvert.SerializeObject(mouse)); return(Json(result)); }
public ReturnResult <StorageDevice> Add(AddStorageDeviceViewModel storageDevice) { DbProvider dbProvider = new DbProvider(); string outCode = String.Empty; string outMessage = String.Empty; StoredProcedureConfigs <StorageDevice> storedProcedureConfigs = new StoredProcedureConfigs <StorageDevice>(); dbProvider.SetQuery(storedProcedureConfigs._INSERT_SINGLE_STORED_PROCEDURE, CommandType.StoredProcedure) .SetParameter("Name", SqlDbType.NVarChar, storageDevice.Name, ParameterDirection.Input) .SetParameter("Status", SqlDbType.Int, storageDevice.Status, ParameterDirection.Input) .SetParameter("CreatedBy", SqlDbType.NVarChar, storageDevice.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 <StorageDevice>() { ErrorCode = outCode, ErrorMessage = outMessage, }); }
public ReturnResult <StorageDevice> AddStorageDevice(AddStorageDeviceViewModel storageDevice) { return(StorageDeviceDAL.Add(storageDevice)); }