Exemplo n.º 1
0
        public JsonResult ChangeBlockStatus()
        {
            string     currentuser     = Session["CurrentUserID"].ToString();
            string     currentusername = Session["DomainUserName"].ToString();
            Guid       userguid        = new Guid(currentuser);
            SystemUser user            = db.systemUser.Single(p => p.SystemUserId == userguid);
            string     usernum         = String.IsNullOrEmpty(user.TandemUserNum) ? String.Empty : user.TandemUserNum;
            string     usergroup       = String.IsNullOrEmpty(user.TandemUserGroup) ? String.Empty : user.TandemUserGroup;

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

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

            param.RequestTransType = "ChangeIBIStatusByUserId";
            param.Parameter.Add("userId", userid);
            param.Parameter.Add("newStatus", newstatus);
            param.Parameter.Add("agentId", currentusername);
            param.Parameter.Add("sUserNum", usernum);
            param.Parameter.Add("sUserGroup", usergroup);

            string start = DateTime.Now.ToString();

            ChangeStatusResult    result    = StatusUpdate.UserIBI(param);
            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));
        }