Example #1
0
        public IActionResult EditStatus(ClassEditStatusViewModel classModel)
        {
            ClassBusiness classModelBusiness = new ClassBusiness();
            var           result             = classModelBusiness.EditStatus(classModel);

            return(Ok(result));
        }
        public async Task <ActionResult> EditStatus(ClassEditStatusViewModel model)
        {
            if (_userSessionHelper.GetUserSession().IsUserLoggedIn)
            {
                model.EditBy = _userSessionHelper.GetUserSession().UserName;
                string apiUrl = _appUrlHelper.GetApiUrl(ApiUrlPath.CLASS_EDIT_STATUS);
                var    result = await HttpUtilities.PostAsyncApi <ReturnResult <Class> >(apiUrl, JsonConvert.SerializeObject(model));

                return(Json(result));
            }
            else
            {
                return(RedirectToAction("Index", "Account"));
            }
        }
Example #3
0
        public ReturnResult <Class> EditStatus(ClassEditStatusViewModel model)
        {
            DbProvider dbProvider = new DbProvider();
            string     outCode    = String.Empty;
            string     outMessage = String.Empty;
            StoredProcedureConfigs <Class> storedProcedureConfigs = new StoredProcedureConfigs <Class>();

            dbProvider.SetQuery(storedProcedureConfigs._UPDATE_STATUS_STORED_PROCEDURE, CommandType.StoredProcedure)
            .SetParameter("Id", SqlDbType.NVarChar, model.Id, 100, ParameterDirection.Input)
            .SetParameter("Status", SqlDbType.Int, model.Status, ParameterDirection.Input)
            .SetParameter("EditBy", SqlDbType.NVarChar, model.EditBy, 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 <Class>()
            {
                ErrorCode = outCode,
                ErrorMessage = outMessage,
            });
        }
Example #4
0
 public ReturnResult <Class> EditStatus(ClassEditStatusViewModel mouse)
 {
     return(ClassDAL.EditStatus(mouse));
 }