Ejemplo n.º 1
0
        public JsonResult Add(PZ_FIO kurator)
        {
            CorrectKurator correctKurator = new CorrectKurator(kurator);

            kurator = correctKurator.Kurator;
            db.PZ_FIO.Add(kurator);
            db.SaveChanges();

            return(Json(1, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public JsonResult Update(PZ_FIO kurator)
        {
            PZ_FIO editClient = db.PZ_FIO.First(d => d.id == kurator.id);

            editClient.fio          = kurator.fio;
            editClient.i            = kurator.i;
            editClient.o            = kurator.o;
            editClient.id_PZ_Client = kurator.id_PZ_Client;
            editClient.email        = kurator.email;
            editClient.phone        = kurator.phone;
            editClient.position     = kurator.position;
            CorrectKurator correctKurator = new CorrectKurator(editClient);

            editClient = correctKurator.Kurator;
            db.Entry(editClient).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();

            return(Json(1, JsonRequestBehavior.AllowGet));
        }