public IActionResult Delete(MouseDeleteViewModel mouse) { MouseBusiness mouseBusiness = new MouseBusiness(); var result = mouseBusiness.Delete(mouse); return(Ok(result)); }
public async Task <ActionResult> Delete(MouseDeleteViewModel mouse) { mouse.DeletedBy = _userSessionHelper.GetUserSession().UserName; string apiUrl = _appUrlHelper.GetApiUrl(ApiUrlPath.MOUSE_DELETE); var result = await HttpUtilities.PostAsyncApi <ReturnResult <Mouse> >(apiUrl, JsonConvert.SerializeObject(mouse)); return(Json(result)); }
public ReturnResult <Mouse> Delete(MouseDeleteViewModel mouse) { DbProvider dbProvider = new DbProvider(); string outCode = String.Empty; string outMessage = String.Empty; StoredProcedureConfigs <Mouse> storedProcedureConfigs = new StoredProcedureConfigs <Mouse>(); dbProvider.SetQuery(storedProcedureConfigs._DELETE_SINGLE_STORED_PROCEDURE, CommandType.StoredProcedure) .SetParameter("Id", SqlDbType.Int, mouse.Id, ParameterDirection.Input) .SetParameter("UserName", SqlDbType.NVarChar, mouse.DeletedBy, 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, }); }
public ReturnResult <Mouse> Delete(MouseDeleteViewModel mouse) { return(MouseDAL.Delete(mouse)); }