Пример #1
0
        public int UpdateStatii(Statii category)
        {
            var entry = this.dbcontext.Entry(category);

            entry.State = EntityState.Modified;

            return(this.dbcontext.SaveChanges());
        }
Пример #2
0
        public void ListView1_InsertItem()
        {
            var item = new Statii();

            TryUpdateModel(item);
            if (ModelState.IsValid)
            {
                this.StatiiiServices.InsertStatiq(item);
            }
        }
Пример #3
0
        // The id parameter name should match the DataKeyNames value set on the control
        public void ListView1_UpdateItem(int id)
        {
            Statii item = null;

            // Load the item here, e.g. item = MyDataLayer.Find(id);
            item = this.StatiiiServices.GetById(id);
            if (item == null)
            {
                // The item wasn't found
                ModelState.AddModelError("", String.Format("Item with id {0} was not found", id));
                return;
            }
            TryUpdateModel(item);
            if (ModelState.IsValid)
            {
                this.StatiiiServices.UpdateStatii(item);
            }
        }
Пример #4
0
 public int InsertStatiq(Statii statiq)
 {
     this.dbcontext.statii.Add(statiq);
     return(this.dbcontext.SaveChanges());
 }