public async Task <ActionResult> DeleteConfirmed(int id)
        {
            AttributesType attributesType = await db.AttributesTypes.FindAsync(id);

            db.AttributesTypes.Remove(attributesType);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 //Drop down control
 public static void DropDown(string element, string value, AttributesType elemenType)
 {
     if (elemenType == AttributesType.Id)
     {
         new SelectElement(AttributesCollect.driver.FindElement(By.Id(element))).SelectByText(value);
     }
     if (elemenType == AttributesType.Name)
     {
         new SelectElement(AttributesCollect.driver.FindElement(By.Name(element))).SelectByText(value);
     }
 }
Esempio n. 3
0
        //Button,CheckBox, anybox = Click

        public static void Click(string element, AttributesType elemenType)
        {
            if (elemenType == AttributesType.Id)
            {
                AttributesCollect.driver.FindElement(By.Id(element)).Click();
            }
            if (elemenType == AttributesType.Name)
            {
                AttributesCollect.driver.FindElement(By.Name(element)).Click();
            }
        }
Esempio n. 4
0
 //EnterText
 public static void EnterText(string element, string value, AttributesType elemenType)
 {
     if (elemenType == AttributesType.Id)
     {
         AttributesCollect.driver.FindElement(By.Id(element)).SendKeys(value);
     }
     if (elemenType == AttributesType.Name)
     {
         AttributesCollect.driver.FindElement(By.Name(element)).SendKeys(value);
     }
 }
        public async Task <ActionResult> Edit([Bind(Include = "ID,AttributeType")] AttributesType attributesType)
        {
            if (ModelState.IsValid)
            {
                db.Entry(attributesType).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(attributesType));
        }
        public async Task <ActionResult> Create([Bind(Include = "ID,AttributeType")] AttributesType attributesType)
        {
            if (ModelState.IsValid)
            {
                db.AttributesTypes.Add(attributesType);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(attributesType));
        }
        // GET: AttributesTypes/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AttributesType attributesType = await db.AttributesTypes.FindAsync(id);

            if (attributesType == null)
            {
                return(HttpNotFound());
            }
            return(View(attributesType));
        }
 public static string GetTextDBL(string element, AttributesType elemenType)
 {
     if (elemenType == AttributesType.Id)
     {
         return(new SelectElement(AttributesCollect.driver.FindElement(By.Id(element))).AllSelectedOptions.SingleOrDefault().Text);
     }
     if (elemenType == AttributesType.Name)
     {
         return(new SelectElement(AttributesCollect.driver.FindElement(By.Name(element))).AllSelectedOptions.SingleOrDefault().Text);
     }
     else
     {
         return(String.Empty);
     }
 }
Esempio n. 9
0
        /// <summary>
        ///     Kreira XACML request na osnovu atributa pristiglih iz domenskog zahteva
        /// </summary>
        /// <param name="DomainAttributes"></param>
        private RequestType CreateXacmlRequest(Dictionary <string, List <DomainAttribute> > DomainAttributes)
        {
            RequestType request = new RequestType();

            request.ReturnPolicyIdList = false;

            request.Attributes = new AttributesType[DomainAttributes.Count];
            int attrCount = 0;

            foreach (KeyValuePair <string, List <DomainAttribute> > kvp in DomainAttributes)
            {
                AttributesType Attributes = new AttributesType();

                /// provera da li kategorije ima u dictionary, ako nema kreira se Xacml atribut sa vrednosti
                /// kategorije iz domenskog oblika
                string category = null;
                if (!AttributeConversionManager.CategoryConversion.TryGetValue(kvp.Key, out category))
                {
                    category = kvp.Key;
                }

                Attributes.Category = category;

                Attributes.Attribute = new AttributeType[kvp.Value.Count];
                int index = 0;

                foreach (DomainAttribute attr in kvp.Value)
                {
                    AttributeType AttrType = new AttributeType();
                    AttrType = CreateXacmlAttribute(attr);
                    Attributes.Attribute[index++] = AttrType;
                }

                request.Attributes[attrCount++] = Attributes;
            }

            return(request);
        }
Esempio n. 10
0
        public static string GetText(string element, AttributesType elemenType)
        {
            if (elemenType == AttributesType.Id)
            {
                return(AttributesCollect.driver.FindElement(By.Id(element)).Text);
            }
            if (elemenType == AttributesType.Name)
            {
                return(AttributesCollect.driver.FindElement(By.Name(element)).Text);
            }
            if (elemenType == AttributesType.CssName)
            {
                return(AttributesCollect.driver.FindElement(By.CssSelector(element)).Text);
            }
            if (elemenType == AttributesType.ClassName)
            {
                return(AttributesCollect.driver.FindElement(By.ClassName(element)).Text);
            }

            else
            {
                return(String.Empty);
            }
        }