strICT.InFlow.Web.Controllers.ManageBOsController.generateBO C# (CSharp) Method

generateBO() public method

public generateBO ( int id ) : System.Web.Mvc.ActionResult
id int
return System.Web.Mvc.ActionResult
        public ActionResult generateBO(int id)
        {


            Model2JSON mj = new Model2JSON(id);

            string jsonschema = mj.getSchema();
            string jsondata = mj.getDefaultData();

            Model2Html mh = new Model2Html(id);

            string html = mh.getcsHTML();

            BO_BusinessObject bo = new BO_BusinessObject();

            bo.Name = "new BO" + id;
            bo.DefaultData = jsondata;
            bo.JsonSchema = jsonschema;
            bo.ViewData = html;

            _BOdb.BusinessObjects.Add(bo);
            _BOdb.SaveChanges();

            //bo.VirtualPath = "/Views/BORepository/bo" + bo.Id + ".cshtml";
            _BOdb.SaveChanges();

            //writeViewData(bo.VirtualPath, html);

            _BODdb.BOD_BOs.Remove(_BODdb.BOD_BOs.Find(id));
            _BODdb.SaveChanges();

            return RedirectToAction("Details", new { id = bo.Id });
        }