Пример #1
0
        public JsonResult ChangeMalwareStatus()
        {
            string currentuser     = Session["CurrentUserID"].ToString();
            string currentusername = Session["DomainUserName"].ToString();

            string userid    = Request["UserId"];
            string newstatus = Request["NewStatus"];

            Params param = new Params()
            {
                Parameter = new Dictionary <string, string>()
            };
            ChangeStatusResult result = new ChangeStatusResult();

            param.Parameter.Add("cust_id", userid);
            param.Parameter.Add("update_officer", currentusername);

            if (newstatus.Equals("N"))
            {
                param.RequestTransType = "ReleaseMalwareStatusByUserId";
                result = StatusUpdate.BlockMalwareIB(param);
            }
            else
            {
                param.RequestTransType = "BlockMalwareStatusByUserId";
                result = StatusUpdate.ReleaseMalwareIB(param);
            }

            string start = DateTime.Now.ToString();
            ChangeStatusUpdatedBy updatedby = new ChangeStatusUpdatedBy
            {
                ID   = currentuser,
                Name = currentusername
            };

            result.UpdatedBy = updatedby;

            string stop = DateTime.Now.ToString();

            ChangeStatusLog.Write(param, result, start, stop);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }