예제 #1
0
 private Case CreateCase(string number, CasePriority priority, string title, string description, CaseStatus status, CaseChannel channel)
 {
     return(new Case
     {
         Number = number,
         Priority = (int)priority,
         Title = title,
         Description = description,
         Status = status.ToString(),
         Channel = channel.ToString()
     });
 }
예제 #2
0
 public void DeleteCasePriority(CasePriority subject)
 {
     try
     {
         var db           = new ApplicationDbContext();
         var CasePriority = db.CasePriorities.Where(s => s.CasePriorityID == subject.CasePriorityID).SingleOrDefault();
         db.CasePriorities.Remove(CasePriority);
         db.SaveChanges();
         ErrorLabel.Text = "Eliminado";
     }
     catch (Exception exp)
     {
         ErrorLabel.Text = exp.Message;
     }
 }
예제 #3
0
 public void UpdateCasePriority(CasePriority subject)
 {
     try
     {
         var db           = new ApplicationDbContext();
         var CasePriority = db.CasePriorities.Where(s => s.CasePriorityID == subject.CasePriorityID).SingleOrDefault();
         CasePriority.PriorityName = subject.PriorityName;
         db.SaveChanges();
         ErrorLabel.Text = String.Empty;
     }
     catch (Exception exp)
     {
         ErrorLabel.Text = exp.Message;
     }
 }
예제 #4
0
 public void SelectCasePriority(string priority)
 {
     if (CasePriority.Displayed)
     {
         CasePriority.Click();
         var x2 = priority;
         var x1 = "//*[contains(text(),'";
         var x3 = "')]";
         Thread.Sleep(3000);
         driver.FindElement(By.XPath(x1 + x2 + x3)).Click();
     }
     else
     {
         throw new Exception("Case Priority could not be selected");
     }
 }
예제 #5
0
        public void InsertCasePriority()
        {
            var db           = new ApplicationDbContext();
            var CasePriority = new CasePriority();

            TryUpdateModel(CasePriority);
            if (ModelState.IsValid)
            {
                try
                {
                    db.CasePriorities.Add(CasePriority);
                    db.SaveChanges();
                    ErrorLabel.Text = String.Empty;
                }
                catch (Exception exp)
                {
                    ErrorLabel.Text = exp.Message;
                }
            }
            else
            {
                ErrorLabel.Text = "Complete todos los campos.";
            }
        }
예제 #6
0
 public CaseContainer(Case state, float value, float valueTreshold, float criticalTreshold, CasePriority priority)
 {
     this.state            = state;
     this.priority         = priority;
     this.value            = value;
     this.valueTreshold    = valueTreshold;
     this.criticalTreshold = criticalTreshold;
 }
예제 #7
0
        /*
         * public void CreateEnquiryCase(string orgName, string contactName, string team, string status, string priority, string triageLevel, string caseOrigin, string subject, string description)
         * {
         *  WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(50));
         *  wait.Until(ExpectedConditions.ElementToBeClickable(_txtOrganisationName));
         *  OrganisationName.Clear();
         *  OrganisationName.SendKeys(orgName);
         *  Thread.Sleep(2000);
         *  wait.Until(ExpectedConditions.ElementToBeClickable(_txtContactName));
         *  ContactName.Clear();
         *  ContactName.SendKeys(contactName);
         *  Thread.Sleep(2000);
         *
         *  if (Team.Displayed)
         *  {
         *      Team.Click();
         *      var x2 = team;
         *      var x1 = "//*[contains(text(),'";
         *      var x3 = "')]";
         *      Thread.Sleep(3000);
         *      driver.FindElement(By.XPath(x1 + x2 + x3)).Click();
         *
         *  }
         *  else
         *  {
         *      throw new Exception("Team could not be selected");
         *  }
         *  if (CaseStatus.Displayed == true)
         *  {
         *      CaseStatus.Click();
         *      var x2 = status;
         *      var x1 = "//*[contains(text(),'";
         *      var x3 = "')]";
         *      Thread.Sleep(3000);
         *      driver.FindElement(By.XPath(x1 + x2 + x3)).Click();
         *
         *  }
         *  else
         *  {
         *      throw new Exception("Status List could not be selected");
         *  }
         *  if (CasePriority.Displayed)
         *  {
         *      CasePriority.Click();
         *      var x2 = priority;
         *      var x1 = "//*[contains(text(),'";
         *      var x3 = "')]";
         *      Thread.Sleep(3000);
         *      driver.FindElement(By.XPath(x1 + x2 + x3)).Click();
         *
         *  }
         *  else
         *  {
         *      throw new Exception("Case Priority could not be selected");
         *  }
         *
         *  wait.Until(ExpectedConditions.ElementToBeClickable(_txtTriageLevel));
         *  TriageLevel.Clear();
         *  TriageLevel.SendKeys(triageLevel);
         *  Thread.Sleep(2000);
         *
         *  if (CaseOrigin.Displayed)
         *  {
         *      CaseOrigin.Click();
         *      var x2 = caseOrigin;
         *      var x1 = "//*[contains(text(),'";
         *      var x3 = "')]";
         *      Thread.Sleep(3000);
         *      driver.FindElement(By.XPath(x1 + x2 + x3)).Click();
         *
         *  }
         *  else
         *  {
         *      throw new Exception("Case Origin could not be selected");
         *  }
         *
         *  wait.Until(ExpectedConditions.ElementToBeClickable(_txtSubject));
         *  Subject.Clear();
         *  Subject.SendKeys(subject);
         *  Thread.Sleep(2000);
         *
         *  wait.Until(ExpectedConditions.ElementToBeClickable(_txtDescription));
         *  Description.Clear();
         *  Description.SendKeys(description);
         *  Thread.Sleep(2000);
         *
         * }
         */
        public void CreateTechSupportCase(string orgName, string contactName, string technologyTeam, string caseOrigin, string workflow, string category, string status, string priority, string supportClassification, string SCLevel1, string SCLevel2, string subject, string description)
        {
            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(50));

            wait.Until(ExpectedConditions.ElementToBeClickable(_txtOrganisationName));
            OrganisationName.Clear();
            OrganisationName.SendKeys(orgName);
            Thread.Sleep(2000);

            wait.Until(ExpectedConditions.ElementToBeClickable(_txtContactName));
            ContactName.Clear();
            ContactName.SendKeys(contactName);
            Thread.Sleep(2000);

            if (TechnologyTeam.Displayed)
            {
                TechnologyTeam.Click();
                var x2 = technologyTeam;
                var x1 = "//*[contains(text(),'";
                var x3 = "')]";
                Thread.Sleep(3000);
                driver.FindElement(By.XPath(x1 + x2 + x3)).Click();
            }
            else
            {
                throw new Exception("Team could not be selected");
            }

            IWebElement   dropDownOriginListBox = driver.FindElement(_listCaseOrigin);
            SelectElement clickOrigin           = new SelectElement(dropDownOriginListBox);

            //Thread.Sleep(2000);
            clickOrigin.SelectByText(caseOrigin);
            //Thread.Sleep(2000);

            IWebElement   dropDownWorkFlowListBox = driver.FindElement(_listWorkflow);
            SelectElement clickWorkFlow           = new SelectElement(dropDownWorkFlowListBox);

            //Thread.Sleep(2000);
            clickWorkFlow.SelectByText(workflow);
            //Thread.Sleep(2000);

            IWebElement   dropDownCategoryListBox = driver.FindElement(_listCategory);
            SelectElement clickCategory           = new SelectElement(dropDownCategoryListBox);

            //Thread.Sleep(2000);
            clickCategory.SelectByText(category);
            //Thread.Sleep(2000);

            IWebElement   dropDownStatusListBox = driver.FindElement(_listStatus);
            SelectElement clickStatus           = new SelectElement(dropDownStatusListBox);

            Thread.Sleep(2000);
            clickStatus.SelectByText(status);
            Thread.Sleep(2000);

            if (CasePriority.Displayed)
            {
                CasePriority.Click();
                var x2 = priority;
                var x1 = "//*[contains(text(),'";
                var x3 = "')]";
                Thread.Sleep(3000);
                driver.FindElement(By.XPath(x1 + x2 + x3)).Click();
            }
            else
            {
                throw new Exception("Case Priority could not be selected");
            }

            IWebElement   dropDownSCListBox = driver.FindElement(_listSupportClassification);
            SelectElement clickSC           = new SelectElement(dropDownSCListBox);

            //Thread.Sleep(2000);
            clickSC.SelectByText(supportClassification);
            //Thread.Sleep(2000);

            IWebElement   dropDownSCL1ListBox = driver.FindElement(_listSCLevel1);
            SelectElement clickSCL1           = new SelectElement(dropDownSCL1ListBox);

            //Thread.Sleep(2000);
            clickSCL1.SelectByText(SCLevel1);
            //Thread.Sleep(2000);

            IWebElement   dropDownSCL2ListBox = driver.FindElement(_listSCLevel2);
            SelectElement clickSCL2           = new SelectElement(dropDownSCL2ListBox);

            //Thread.Sleep(2000);
            clickSCL2.SelectByText(SCLevel2);
            //Thread.Sleep(2000);

            wait.Until(ExpectedConditions.ElementToBeClickable(_txtSubject));
            Subject.Clear();
            Subject.SendKeys(subject);
            Thread.Sleep(2000);

            wait.Until(ExpectedConditions.ElementToBeClickable(_txtDescription));
            Description.Clear();
            Description.SendKeys(description);
            Thread.Sleep(2000);
        }