Пример #1
0
        public JsonResult Add([FromBody] ProjectData p)
        {
            //X509Certificate2 clientCertificate = Security.GetClientCertificate(HttpContext);
            ProjectLib projectLib = new ProjectLib(Repository);
            VwProject  p1         = projectLib.AddNewProject(p);

            return(Json(p1));
        }
Пример #2
0
        public JsonResult Update([FromBody] ProjectData p)
        {
            //X509Certificate2 clientCertificate = Security.GetClientCertificate(HttpContext);
            ProjectLib projectLib = new ProjectLib(Repository);

            projectLib.UpdateProject(p);

            return(Json("OK"));
        }
Пример #3
0
        public JsonResult GetVendorsForProject(int id = 0)
        {
            ProjectLib projectLib = new ProjectLib(Repository);

            if (id == 0)
            {
                var projects = projectLib.GetProjects();
                Response.StatusCode = 200;
                return(Json(projects));
            }
            else
            {
                var     project = projectLib.FindProject(id);
                Vendors vendors = projectLib.GetVendors(id);
                Response.StatusCode = 200;
                return(Json(project));
            }
        }