コード例 #1
0
        public void All_company_total_summary_ds(DataSet companylist, string taskno)
        {
            bspm.Bsp_Company_list();

            for (int i = 0; i < companylist.Tables[0].Rows.Count; i++)
            {
                DataRow dr           = companylist.Tables[0].Rows[i];
                string  company_name = dr["company_name"].ToString();
                bspm.Bsp_Select_Company(company_name, "RESOURCE");
                Thread.Sleep(6000);
                logman.AppendLogFile(taskno, string.Format("{0}.{1} Testing Start", i, company_name));
                deletecompanydata(company_name);
                Asset_Resource(company_name);

                logman.AppendLogFile(taskno, string.Format("===> {0}.{1} : PASS", i, company_name));
                //logmanager.AppendLogFile(string.Format("{0}.{1} : PASS", i, company_name));

                string upqyrce = string.Format("exec prc_TB_Auto_Process_Task_U '{0}','{1}','{2}'", taskno, company_name, "pass");
                dbmanager.ExecuteDataQuery(upqyrce, "Asset_Management");

                dbmanager.ExecuteDataQuery(string.Format("exec prc_Task_Status_Update '{0}'", taskno), "Asset_Management");
            }
        }
コード例 #2
0
        public void Click_Type(string servicetype, string company_name, string taskno)
        {
            IJavaScriptExecutor js = bspm.driver as IJavaScriptExecutor;
            string path            = string.Format(".//bg-perf-{0}-curr//div[@class='common-tabs']", servicetype);
            string upqy            = string.Format("{0}|", servicetype);

            Thread.Sleep(4000);
            IWebElement Tab = bspm.findelementitem(path);

            Thread.Sleep(1000);
            ReadOnlyCollection <IWebElement> type_tab = Tab.FindElements(By.XPath(".//button"));

            foreach (IWebElement item in type_tab)
            {
                IWebElement Tabvdv = bspm.findelementitem(string.Format(".//button[@id='{0}Toggle']", servicetype));
                js.ExecuteScript("arguments[0].scrollIntoView(true);", Tabvdv);
                Thread.Sleep(1000);
                string  selectsource = string.Format("exec prc_TB_Auto_Process_Task_Q '{0}','{1}'", taskno, company_name);
                DataSet ds           = dbmanager.ExecuteDataQuery(selectsource, "Asset_Management");
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        DataRow dr = ds.Tables[0].Rows[0];
                        if (dr["process_status"].ToString() == "NON")
                        {
                            //log
                            logman.AppendLogFile(taskno, string.Format("Company Name :{0}, Service Type : {1}, Resouce Name : {2}, Status : START", company_name, servicetype, item.Text.Replace(" ", "")));
                            deleteTable(string.Format("TB_Performance_Data_{0}_{1}", servicetype, item.Text.Replace(" ", "")), company_name);
                            Thread.Sleep(1000);
                            item.Click();
                            Thread.Sleep(7000);
                            Insert_instance_status(company_name, servicetype, item.Text.Replace(" ", ""));
                            Thread.Sleep(1000);
                            Insert_Aws_Usage_Chart_json(company_name, servicetype, item.Text.Replace(" ", ""));
                            Thread.Sleep(1000);
                            InsertAws_Performance_Grid_Data(company_name, servicetype, item.Text.Replace(" ", ""));

                            upqy = upqy + item.Text.Replace(" ", "");
                            string upqyrce = string.Format("exec prc_TB_Auto_Process_Task_U '{0}','{1}','{2}'", taskno, company_name, upqy);
                            dbmanager.ExecuteDataQuery(upqyrce, "Asset_Management");

                            //log
                            logman.AppendLogFile(taskno, string.Format("Company Name :{0}, Service Type : {1}, Resouce Name : {2}, Status : END", company_name, servicetype, item.Text.Replace(" ", "")));
                        }
                        else
                        {
                            string options = dr["process_status"].ToString();
                            if (!options.Contains(item.Text.Replace(" ", "")))
                            {
                                //log
                                logman.AppendLogFile(taskno, string.Format("Company Name :{0}, Service Type : {1}, Resouce Name : {2}, Status : START", company_name, servicetype, item.Text.Replace(" ", "")));
                                //dropTable(string.Format("TB_Usage_Data_{0}_{1}", servicetype, item.Text.Replace(" ","")));
                                deleteTable(string.Format("TB_Performance_Data_{0}_{1}", servicetype, item.Text.Replace(" ", "")), company_name);
                                Thread.Sleep(1000);
                                item.Click();
                                Thread.Sleep(7000);
                                Insert_instance_status(company_name, servicetype, item.Text.Replace(" ", ""));
                                Thread.Sleep(1000);
                                Insert_Aws_Usage_Chart_json(company_name, servicetype, item.Text.Replace(" ", ""));
                                Thread.Sleep(1000);
                                InsertAws_Performance_Grid_Data(company_name, servicetype, item.Text.Replace(" ", ""));
                                string upqyrce = string.Format("exec prc_TB_Auto_Process_Task_U '{0}','{1}','{2}'", taskno, company_name, options + "," + item.Text.Replace(" ", ""));
                                dbmanager.ExecuteDataQuery(upqyrce, "Asset_Management");

                                //log
                                logman.AppendLogFile(taskno, string.Format("Company Name :{0}, Service Type : {1}, Resouce Name : {2}, Status : END", company_name, servicetype, item.Text.Replace(" ", "")));
                            }
                        }
                    }
                }
            }
        }