public static void AddProjectToDB(PROJECTS model)
 {
     using (var context = new Contextt())
     {
         context.ProjectContext.Add(model);
         context.SaveChanges();
     };
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     Implements the OnDisconnection method of the IDTExtensibility2 interface.
        ///     Receives notification that the Add-in is being unloaded.
        /// </summary>
        /// <param term='disconnectMode'>
        ///      Describes how the Add-in is being unloaded.
        /// </param>
        /// <param term='custom'>
        ///      Array of parameters that are host application specific.
        /// </param>
        /// <seealso class='IDTExtensibility2' />
        public void OnDisconnection(Extensibility.ext_DisconnectMode disconnectMode, ref System.Array custom)
        {
            addInInstance = null;
            PLACES.Destroy();
            MAPS.Destroy();
            PROJECTS.Destroy();
            ABOUT.Destroy();
            DocumentStorage.Destroy();
            MMUtils.MindManager = null;
            m_myTab.Delete();
            m_myTab = null;

            System.GC.Collect();
        }
        public ActionResult CreateProject(PROJECTS model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            DbOperations.AddProjectToDB(model);

            var model2 = new PROJECT_EMPLOYEES();

            model2.ProjectCode  = model.ProjectCode;
            model2.ProjectOwner = true;
            model2.EmployeeId   = GetLoggedUserId();
            DbOperations.AddProjectEmployeeToDB(model2);

            return(RedirectToAction("ProjectList"));
        }
        public ActionResult CreateProject()
        {
            var model = new PROJECTS();

            return(View(model));
        }