public override Task <object> FulfillAsync()
        {
            Dictionary <string, string> MyEntities = new Dictionary <string, string>();

            MyEntities.Add("hostname", this.hostname);

            CreateJSON createJSON = new CreateJSON();


            string aeRequestId;

            aeRequestId = createJSON.AECall(MyEntities, "ProxyUsecase");
            GetStatus getStatus = new GetStatus();

            Thread.Sleep(15000);
            string response        = getStatus.GetStatusAECall(aeRequestId);
            var    rss             = JObject.Parse(response);
            string AeRequestStatus = (string)rss["workflowResponse"];

            rss = JObject.Parse(AeRequestStatus);
            string message = (string)rss["message"];



            //return Task.FromResult((object)$"Internet is not working for  {this.hostname} as soon as possible... Visit me again whenever you need my help. Have a great day :) {response}");
            return(Task.FromResult((object)$"{message}Please wait while we work on your request. It typically takes 2 minutes to complete the operation, click after 2 minutes.< input type = 'button' class='button' id='check_status' value='Click here to check status' onclick=\"button_send('Check Status');\"/>"));
        }
        public override Task <object> FulfillAsync()
        {
            Dictionary <string, string> MyEntities = new Dictionary <string, string>();

            MyEntities.Add("username", this.adusername);                 //Workflow parameter
            MyEntities.Add("mobile", this.phonenumber);                  //Workflow parameter

            CreateJSON createJSON = new CreateJSON();                    //instance created for createjson

            string aeRequestId;                                          //variable creation for ae call

            aeRequestId = createJSON.AECall(MyEntities, "Generate OTP"); // ae call


            GetStatus getStatus = new GetStatus();                    //instance created of GetStatus

            Thread.Sleep(15000);                                      // Wait for workflow execution
            string response = getStatus.GetStatusAECall(aeRequestId); //Get Status Response - response from ae.

            var rss = JObject.Parse(response);                        // JObject.Parse string is converting in json format.

            username = (string)rss["attribute1"];                     // username is stored in attribute1 field of response.
            phoneno  = (string)rss["attribute2"];                     // phoneno is stored in attribute2 field of response.
            otp      = (string)rss["attribute3"];                     // otp is stored in attribute3 field of response.



            //return Task.FromResult((object)$"I will reset password for  {this.adusername} as soon as possible... Visit me again whenever you need my help. Have a great day :)");

            return(Task.FromResult((object)$"{username} OTP is sent on your registered mobile number, please enter otp. Your reference key is - {aeRequestId} (RK). You need to enter reference key<space>OTP eg. (RK) AZ6754"));
            //Get Status Response from ae
        }
示例#3
0
        public override Task <object> FulfillAsync()
        {
            string result;

            if (OTP.ToUpper().Equals(ResetUserPassword.otp))
            {
                Dictionary <string, string> MyEntities = new Dictionary <string, string>();
                MyEntities.Add("User_Logon_Name", ResetUserPassword.username);
                //MyEntities.Add("User_Logon_Name", "Geetanjali Khyale");
                MyEntities.Add("aewfid", "198");
                MyEntities.Add("MobileNumber", ResetUserPassword.phoneno);
                //MyEntities.Add("MobileNumber", "919730975520");

                CreateJSON createJSON = new CreateJSON();

                string aeRequestId;
                aeRequestId = createJSON.AECall(MyEntities, "Reset Password");//Call Automation Edge.

                //return Task.FromResult((object)$"{ResetUserPassword.username} \n {ResetUserPassword.phoneno} \n {ResetUserPassword.otp}Your request for reset password has been initiated and password is sent on your registered mobile number.\n Was I helpful?");
                result = $"Username: {ResetUserPassword.username} \n Phoneno: {ResetUserPassword.phoneno} \n OTP: {ResetUserPassword.otp} \n Your request for reset password has been initiated and password is sent on your registered mobile number.\n Was I helpful?";
            }
            else
            {
                result = $"OTP didn't match";
            }



            //return Task.FromResult((object)$"Password is reset... Visit me again whenever you need my help. Have a great day :)");
            return(Task.FromResult((object)result));
        }
        public override Task <object> FulfillAsync()
        {
            if (foldername.Equals("hr") && permission.Equals("read"))  //validation of foldername & permission
            {
                GroupName = "HR_Read";
            }
            else if (foldername.Equals("hr") && permission.Equals("modified"))
            {
                GroupName = "HR_Modified";
            }
            else if (foldername.Equals("corporate") && permission.Equals("Read"))
            {
                GroupName = "Corporate_Read";
            }
            else if (foldername.Equals("corporate") && permission.Equals("modified"))
            {
                GroupName = "Corporate_Modified";
            }
            else if (foldername.Equals("policy") && permission.Equals("read"))
            {
                GroupName = "Policy_Read";
            }
            else if (foldername.Equals("policy") && permission.Equals("modified"))
            {
                GroupName = "Policy_Modified";
            }
            else
            {
                GroupName = "Default";
            }


            Dictionary <string, string> MyEntities = new Dictionary <string, string>();

            MyEntities.Add("SamAccountName", this.SamAccountName); //Workflow parameter

            MyEntities.Add("GroupName", this.GroupName);           //Workflow parameter



            CreateJSON createJSON = new CreateJSON(); //instance created for createjson

            string aeRequestId;

            aeRequestId = createJSON.AECall(MyEntities, "SharedFolder"); // ae call

            GetStatus getStatus = new GetStatus();                       //instance created of GetStatus

            Thread.Sleep(15000);                                         // Wait for workflow execution
            string response = getStatus.GetStatusAECall(aeRequestId);    //Get Status Response(response from ae)

            var    rss             = JObject.Parse(response);            //Get Status Response(response from ae)
            string AeRequestStatus = (string)rss["workflowResponse"];    //Get Status Response(response from ae)

            rss = JObject.Parse(AeRequestStatus);                        //Get Status Response(response from ae)
            string message = (string)rss["message"];                     //Get Status Response(response from ae)

            return(Task.FromResult((object)message));                    //Get Status Response.(response from ae)
        }
        public override Task <object> FulfillAsync()
        {
            Dictionary <string, string> MyEntities = new Dictionary <string, string>();

            MyEntities.Add("softwarename", this.softwarename);

            CreateJSON createJSON = new CreateJSON();

            createJSON.AECall(MyEntities, "Software Install");

            return(Task.FromResult((object)$"I will install  {this.softwarename} as soon as possible... Visit me again whenever you need my help. Have a great day :)"));
        }
        public override Task <object> FulfillAsync()
        {
            Dictionary <string, string> MyEntities = new Dictionary <string, string>();

            MyEntities.Add("description", this.description);

            CreateJSON createJSON = new CreateJSON();

            createJSON.AECall(MyEntities, "Create Incident");

            return(Task.FromResult((object)$"I will create incident for  {this.description} as soon as possible... Visit me again whenever you need my help. Have a great day :)"));
        }
        public override Task <object> FulfillAsync()
        {
            Dictionary <string, string> MyEntities = new Dictionary <string, string>();

            MyEntities.Add("Check Incident Status", this.incidentnumber);

            CreateJSON createJSON = new CreateJSON();

            createJSON.AECall(MyEntities, "Unlock AD Account");

            return(Task.FromResult((object)$"I will let you know status of ticked ID {this.incidentnumber} as soon as possible... Visit me again whenever you need my help. Have a great day :)"));
        }
示例#8
0
        public override Task <object> FulfillAsync()
        {
            Dictionary <string, string> MyEntities = new Dictionary <string, string>();

            MyEntities.Add("OrganizationUnit_Name", this.OrganizationUnit_Name);
            MyEntities.Add("samaccountname", this.samaccountname);
            MyEntities.Add("User_Name", this.User_Name);
            MyEntities.Add("Display_Name", this.Display_Name);
            MyEntities.Add("Password", this.Password);

            CreateJSON createJSON = new CreateJSON();

            createJSON.AECall(MyEntities, "Creating Active Directory User");

            return(Task.FromResult((object)$"I will create AD account for {this.samaccountname} soon... Visit me again whenever you need my help... Have a great day :)"));
        }
示例#9
0
        public override Task <object> FulfillAsync()
        {
            Dictionary <string, string> MyEntities = new Dictionary <string, string>();

            MyEntities.Add("vcenter_IP", this.vcenter_IP);
            MyEntities.Add("Port", this.Port);
            MyEntities.Add("Admin_Username", this.Admin_Username);
            MyEntities.Add("Admin_Password", this.Admin_Password);
            MyEntities.Add("VMHost_IP", this.VMHost_IP);
            MyEntities.Add("Datastore", this.Datastore);
            MyEntities.Add("Template_Name", this.Template_Name);
            MyEntities.Add("VM_Name", this.VM_Name);

            CreateJSON createJSON = new CreateJSON();

            createJSON.AECall(MyEntities, "Create Virtual Machine");

            return(Task.FromResult((object)$"I will add VM named {this.VM_Name} soon... Visit me again whenever you need my help... Have a great day :)"));
        }
示例#10
0
        //[Required(ErrorMessage = "Give template a name of your choice")]
        //[LuisActionBindingParam(CustomType = "Template_Name", Order = 7)]
        //public string Template_Name { get; set; }

        //[Required(ErrorMessage = "And give this VM a name of your choice")]
        //[LuisActionBindingParam(CustomType = "VM_Name", Order = 8)]
        //public string VM_Name { get; set; }


        public override Task <object> FulfillAsync()
        {
            Dictionary <string, string> MyEntities = new Dictionary <string, string>();

            MyEntities.Add("fname", this.firstname);
            MyEntities.Add("lname", this.lastname);
            MyEntities.Add("phno", this.phonenumber);
            MyEntities.Add("email", this.emailaddress);
            MyEntities.Add("uname", this.adusername);
            MyEntities.Add("pwd", this.adpassword);
            MyEntities.Add("q", "test");
            MyEntities.Add("category", "/api/ticket_category/68");


            CreateJSON createJSON = new CreateJSON();

            //createJSON.AECall(MyEntities, "Create AD User");

            return(Task.FromResult((object)$"I will add AD user named {this.adusername} soon... Visit me again whenever you need my help... Have a great day :)"));
        }
示例#11
0
        public override Task <object> FulfillAsync()
        {
            Dictionary <string, string> MyEntities = new Dictionary <string, string>();

            MyEntities.Add("hostIP", this.hostIP);
            MyEntities.Add("SoftwareName", this.software);

            CreateJSON createJSON = new CreateJSON();


            string aeRequestId;

            aeRequestId = createJSON.AECall(MyEntities, "Software Installation");
            //GetStatus getStatus = new GetStatus();
            //Thread.Sleep(15000);
            //string response = getStatus.GetStatusAECall(aeRequestId);



            return(Task.FromResult((object)$"Please wait while we work on your request."));
            //return Task.FromResult((object)$"Please wait while we work on your request. It typically takes 2 minutes to complete the operation, click after 2 minutes.< input type = 'button' class='button' id='check_status' value='Click here to check status' onclick=\"button_send('Check Status');\"/>");
        }