示例#1
0
        public ActionResult <ChangeStatusResponseModel> ChangeStatusSite([FromBody] ChangeStatusInputModel data)
        {
            ChangeStatusResponseModel res = new ChangeStatusResponseModel();

            try
            {
                SiteRepository repo = new SiteRepository(DbContext);
                var            tes  = repo.ChangeStatus(data.SiteID, data.UserID, data.Value);

                ChangeStatusOutputModel output = new ChangeStatusOutputModel();
                output.message = tes.Message;

                res.data     = output;
                res.Message  = "Success";
                res.Response = true;

                return(Ok(res));
            }
            catch (Exception ex)
            {
                res.Message  = ex.Message;
                res.Response = false;

                return(BadRequest(res));
            }
        }