示例#1
0
        public ActionResult Edit([Bind(Include = "ID,FIO,Address,Gave,Got,Comment,WhoAdded,Who")] Sixzem Sixzem)
        {
            if (ModelState.IsValid)
            {
                var r = new Disk1.Controllers.ValuesController().Put("6-зем", Sixzem);
                if (!r)
                {
                    return(new HttpStatusCodeResult(400, "Неверный запрос"));
                }

                return(RedirectToAction("Index"));
            }
            return(View(Sixzem));
        }
示例#2
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Sixzem Sixzem = (Sixzem) new Disk1.Controllers.CellController().Get(id, "6-зем");

            if (Sixzem == null)
            {
                return(HttpNotFound());
            }
            ViewBag.WhoList = new Disk1.Models.DropDownListSettings().WhoList();
            return(View(Sixzem));
        }
示例#3
0
        // DELETE api/values/5
        public bool Delete(int?id, [FromBody] string tablename)
        {
            if (id == null)
            {
                return(false);
            }
            if (string.IsNullOrEmpty(tablename))
            {
                return(false);
            }

            //db.Entry(cNAP).State = EntityState.Modified;
            switch (tablename)
            {
            case "правий (город)":
            {
                CNAP cNAP = bd.CNAP.Find(id);
                bd.CNAP.Remove(cNAP);
                bd.SaveChanges();
                return(true);
            }

            case "ЦНАП контроль":
            {
                ControlCNAP ControlCNAP = bd.ControlCNAP.Find(id);
                bd.ControlCNAP.Remove(ControlCNAP);
                bd.SaveChanges();
                return(true);
            }

            case "левий (райони)":
            {
                Left Left = bd.Left.Find(id);
                bd.Left.Remove(Left);
                bd.SaveChanges();
                return(true);
            }

            case "Норматівки":
            {
                Regulations Regulations = bd.Regulations.Find(id);
                bd.Regulations.Remove(Regulations);
                bd.SaveChanges();
                return(true);
            }

            case "неприватизация":
            {
                NotPrivatization NotPrivatization = bd.NotPrivatization.Find(id);
                bd.NotPrivatization.Remove(NotPrivatization);
                bd.SaveChanges();
                return(true);
            }

            case "внесеня змін":
            {
                Alteration Alteration = bd.Alteration.Find(id);
                bd.Alteration.Remove(Alteration);
                bd.SaveChanges();
                return(true);
            }

            case "Онлайн витяг":
            {
                Online Online = bd.Online.Find(id);
                bd.Online.Remove(Online);
                bd.SaveChanges();
                return(true);
            }

            case "6-зем":
            {
                Sixzem Sixzem = bd.Sixzem.Find(id);
                bd.Sixzem.Remove(Sixzem);
                bd.SaveChanges();
                return(true);
            }

            case "викопіювання":
            {
                Dumping Dumping = bd.Dumping.Find(id);
                bd.Dumping.Remove(Dumping);
                bd.SaveChanges();
                return(true);
            }

            case "заявка-витяг 80грн.":
            {
                Zav80 Zav80 = bd.Zav80.Find(id);
                bd.Zav80.Remove(Zav80);
                bd.SaveChanges();
                return(true);
            }

            default:
            {
                return(false);
            }
            }
        }