Example #1
0
        public ActionResult CreateProject(ProjectInfo NewPJ)
        {
            if (ModelState.IsValid)
            {
                var pjsrv = new ProjectService();

                //Check existed Project Name
                var pjcnt = pjsrv.CountProjectbyName(NewPJ.ProjIDs.Name);
                NewPJ.ProjIDs.Name += (pjcnt > 0) ? "_(" + pjcnt + ")" : "";

                ////Try to connect database
                //if (pjsrv.TestConnect(NewPJ.ConnIDs))
                //{
                //    return Content("It can attemp the connection");
                //}
                //else
                //{
                //    return Content("Cannot connect to your database");
                //}

                //Check existed PIPINGMOD on destinated database and create it on that databse if it is not exist

                //Create project database :: projectname + _DB
                if (pjsrv.CreateProject(NewPJ.ConnIDs))
                {
                    return Content("Created Sucessfull");
                }
                else
                {
                    return Content("Cannot created");
                }
            }
            return View();
        }
Example #2
0
 //
 // GET: /pjbrowser/
 public ActionResult Index()
 {
     var pjlist = new ProjectService().ProjectList();
     return View(pjlist);
 }