Ejemplo n.º 1
0
        public JsonResult KeyBCABukaBlokir()
        {
            string currentuser     = Session["CurrentUserID"].ToString();
            string currentusername = Session["DomainUserName"].ToString();

            string entityType = string.IsNullOrEmpty(Request["EntityType"]) ? "" : Request["EntityType"];

            string keyid         = string.IsNullOrEmpty(Request["KeyId"]) ? "" : Request["KeyId"];
            string tokenType     = string.IsNullOrEmpty(Request["TokenType"]) ? "" : Request["TokenType"];
            string random        = string.IsNullOrEmpty(Request["Random"]) ? "" : Request["Random"];
            string updateOfficer = currentusername;
            string message       = string.Empty;

            if (tokenType == "A")
            {
                message = "TokenUnlockActiveCard";
            }
            else
            {
                message = "TokenUnlockVasco";
            }
            Params param = new Params()
            {
                Parameter = new Dictionary <string, string>()
            };

            param.RequestTransType = message;
            param.Parameter.Add("userId", keyid);
            param.Parameter.Add("random", random);
            if (entityType == "9")
            {
                param.Parameter.Add("type", "IBN");
            }
            else if (entityType == "11")
            {
                param.Parameter.Add("type", "SME");
                param.Parameter.Add("updateOfficer", updateOfficer);
            }

            string start = DateTime.Now.ToString();

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