Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #3
0
 static UserEntities()
 {
     DbContext = new ProjectManagementEntities();
 }
Beispiel #4
0
 static TaskEntities()
 {
     DbContext = new ProjectManagementEntities();
 }