Example #1
0
        public static bool InsertProjectDetail(ProjectDetail project)
        {
            bool status;

            project.StatusId = 1;
            using (var myContext = new ProjectManagementEntities())
            {
                try
                {
                    myContext.ProjectDetails.Add(project);
                    myContext.SaveChanges();
                    status = true;
                }
                catch (Exception ex)
                {
                    status = false;
                }
            }

            return(status);
        }
Example #2
0
        public static bool DeleteProject(int id)
        {
            bool status;

            using (var myContext = new ProjectManagementEntities())
            {
                try
                {
                    ProjectDetail prodItem = myContext.ProjectDetails.Where(p => p.Id == id).FirstOrDefault();
                    if (prodItem != null)
                    {
                        myContext.ProjectDetails.Remove(prodItem);
                        myContext.SaveChanges();
                    }
                    status = true;
                }
                catch (Exception)
                {
                    status = false;
                }
            }
            return(status);
        }
Example #3
0
 static UserEntities()
 {
     DbContext = new ProjectManagementEntities();
 }
Example #4
0
 static TaskEntities()
 {
     DbContext = new ProjectManagementEntities();
 }