Ejemplo n.º 1
0
        public ActionResult Create([Bind(Include = "ID,FIO,Address,Gave,Got,Comment,WhoAdded,Who")] CNAP cNAP)
        {
            if (ModelState.IsValid)
            {
                var r = new Disk1.Controllers.ValuesController().Post("правий (город)", cNAP);
                if (!r)
                {
                    return(new HttpStatusCodeResult(400, "Неверный запрос"));
                }
                //string s = null;
                //for (int i = 0; i < Request.Headers.Count; i++)
                //{
                //    s += Request.Headers[i];
                //}

                //var rrr = Request.Headers["Authorization"];
                //HttpClient cleint = new HttpClient();
                //cleint.DefaultRequestHeaders.Add("Authorization",Request.Headers["Authorization"]);
                //cleint.BaseAddress = new Uri("http://localhost:4106");

                //var myContent = JsonConvert.SerializeObject(cNAP);
                //var buffer = System.Text.Encoding.UTF8.GetBytes(myContent);
                //var byteContent = new ByteArrayContent(buffer);
                //byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");

                //var rr =  cleint.PutAsJsonAsync("api/values/правий", byteContent).Result;
                Session["selected"] = cNAP.Who;
                return(RedirectToAction("Index"));
            }

            return(View(cNAP));
        }
Ejemplo n.º 2
0
        public ActionResult Index(int?page)
        {
            ViewBag.username = User.Identity.Name;
            List <CNAP> list     = null;
            var         response = new Disk1.Controllers.ValuesController().Get("правий (город)");

            if (response == null)
            {
                return(new HttpStatusCodeResult(400, "Такой таблицы не существует"));
            }

            try
            {
                list = (List <CNAP>)response;
            }
            catch
            {
                return(new HttpStatusCodeResult(400, "Приведение не осуществилось"));
            }

            var pageNumber = page ?? 1;
            var items      = list.OrderByDescending(e => e.ID).ToPagedList(pageNumber, 50);

            return(View(items));
        }
Ejemplo n.º 3
0
        public ActionResult DeleteConfirmed(int id)
        {
            var r = new Disk1.Controllers.ValuesController().Delete(id, "6-зем");

            if (!r)
            {
                return(new HttpStatusCodeResult(400, "Неверный запрос"));
            }

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 5
0
        public ActionResult Create([Bind(Include = "ID,FIO,Address,Gave,Got,Comment,WhoAdded,Who")] Left Left)
        {
            if (ModelState.IsValid)
            {
                var r = new Disk1.Controllers.ValuesController().Post("левий (райони)", Left);
                if (!r)
                {
                    return(new HttpStatusCodeResult(400, "Неверный запрос"));
                }
                return(RedirectToAction("Index"));
            }

            return(View(Left));
        }
Ejemplo n.º 6
0
        public ActionResult Edit([Bind(Include = "ID,FIO,Gave,Got,Comment,WhoAdded,Who")] Alteration Alteration)
        {
            if (ModelState.IsValid)
            {
                var r = new Disk1.Controllers.ValuesController().Put("внесеня змін", Alteration);
                if (!r)
                {
                    return(new HttpStatusCodeResult(400, "Неверный запрос"));
                }

                return(RedirectToAction("Index"));
            }
            return(View(Alteration));
        }
Ejemplo n.º 7
0
        public ActionResult DeleteConfirmed(int id)
        {
            //CNAP cNAP = await db.CNAP.FindAsync(id);
            //db.CNAP.Remove(cNAP);
            //await db.SaveChangesAsync();
            var r = new Disk1.Controllers.ValuesController().Delete(id, "внесеня змін");

            if (!r)
            {
                return(new HttpStatusCodeResult(400, "Неверный запрос"));
            }

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 8
0
 public ActionResult Edit([Bind(Include = "ID,FIO,Address,Gave,Got,Comment,WhoAdded,Who")] Regulations Regulations)
 {
     if (ModelState.IsValid)
     {
         var r = new Disk1.Controllers.ValuesController().Put("Норматівки", Regulations);
         if (!r)
         {
             return(new HttpStatusCodeResult(400, "Неверный запрос"));
         }
         Session["selected"] = Regulations.Who;
         return(RedirectToAction("Index"));
     }
     return(View(Regulations));
 }
Ejemplo n.º 9
0
        public ActionResult Edit([Bind(Include = "ID,FIO,Gave,Got,Comment,WhoAdded,Who")] NotPrivatization NotPrivatization)
        {
            if (ModelState.IsValid)
            {
                var r = new Disk1.Controllers.ValuesController().Put("неприватизация", NotPrivatization);
                if (!r)
                {
                    return(new HttpStatusCodeResult(400, "Неверный запрос"));
                }

                return(RedirectToAction("Index"));
            }
            return(View(NotPrivatization));
        }
Ejemplo n.º 10
0
        public ActionResult Edit([Bind(Include = "ID,FIO,Got,Comment,WhoAdded")] Online Online)
        {
            if (ModelState.IsValid)
            {
                var r = new Disk1.Controllers.ValuesController().Put("Онлайн витяг", Online);
                if (!r)
                {
                    return(new HttpStatusCodeResult(400, "Неверный запрос"));
                }

                return(RedirectToAction("Index"));
            }
            return(View(Online));
        }
Ejemplo n.º 11
0
        public ActionResult Edit([Bind(Include = "ID,FIO,Gave,Got,Comment,WhoAdded,Who")] Dumping Dumping)
        {
            if (ModelState.IsValid)
            {
                var r = new Disk1.Controllers.ValuesController().Put("викопіювання", Dumping);
                if (!r)
                {
                    return(new HttpStatusCodeResult(400, "Неверный запрос"));
                }

                return(RedirectToAction("Index"));
            }
            return(View(Dumping));
        }
Ejemplo n.º 12
0
        public ActionResult Edit([Bind(Include = "ID,FIO,Gave,Got,Comment,WhoAdded,Who")] Zav80 Zav80)
        {
            if (ModelState.IsValid)
            {
                var r = new Disk1.Controllers.ValuesController().Put("заявка-витяг 80грн.", Zav80);
                if (!r)
                {
                    return(new HttpStatusCodeResult(400, "Неверный запрос"));
                }

                return(RedirectToAction("Index"));
            }
            return(View(Zav80));
        }
Ejemplo n.º 13
0
        public ActionResult Create([Bind(Include = "ID,FIO,Address,Gave,Got,Comment,WhoAdded,Who")] ControlCNAP ControlCNAP)
        {
            if (ModelState.IsValid)
            {
                var r = new Disk1.Controllers.ValuesController().Post("ЦНАП контроль", ControlCNAP);
                if (!r)
                {
                    return(new HttpStatusCodeResult(400, "Неверный запрос"));
                }
                Session["selected"] = ControlCNAP.Who;
                return(RedirectToAction("Index"));
            }

            return(View(ControlCNAP));
        }
Ejemplo n.º 14
0
        public ActionResult Index()
        {
            ViewBag.username = User.Identity.Name;
            List <Sixzem> list     = null;
            var           response = new Disk1.Controllers.ValuesController().Get("6-зем");

            if (response == null)
            {
                return(new HttpStatusCodeResult(400, "Такой таблицы не существует"));
            }

            try
            {
                list = (List <Sixzem>)response;
            }
            catch
            {
                return(new HttpStatusCodeResult(400, "Приведение не осуществилось"));
            }

            return(View(list.OrderByDescending(e => e.ID).ToList()));
        }
Ejemplo n.º 15
0
        //неприватизация
        public ActionResult nonPrivatization()
        {
            ViewBag.username = User.Identity.Name;
            List <NotPrivatization> list = null;
            var response = new Disk1.Controllers.ValuesController().Get("неприватизация");

            if (response == null)
            {
                return(new HttpStatusCodeResult(400, "Такой таблицы не существует"));
            }

            try
            {
                list = (List <NotPrivatization>)response;
            }
            catch
            {
                return(new HttpStatusCodeResult(400, "Приведение не осуществилось"));
            }

            return(View(list.OrderByDescending(e => e.ID)));
        }
Ejemplo n.º 16
0
        //нормативки
        public ActionResult Normative()
        {
            ViewBag.username = User.Identity.Name;
            List <Regulations> list = null;
            var response            = new Disk1.Controllers.ValuesController().Get("Норматівки");

            if (response == null)
            {
                return(new HttpStatusCodeResult(400, "Такой таблицы не существует"));
            }

            try
            {
                list = (List <Regulations>)response;
            }
            catch
            {
                return(new HttpStatusCodeResult(400, "Приведение не осуществилось"));
            }

            return(View(list.OrderByDescending(e => e.ID)));
        }