Esempio n. 1
0
        public Software_Requirement InsertRequirement(Software_Requirement sr)
        {
            sr.createddate = DateTime.Now;

            IPFinalDBDataContext finalDB = new IPFinalDBDataContext();
            finalDB.Software_Requirements.InsertOnSubmit(sr);

            finalDB.SubmitChanges();

            return sr;
        }
Esempio n. 2
0
        public Software_Requirement DeleteRequirement(int id)
        {
            IPFinalDBDataContext finalDB = new IPFinalDBDataContext();
            var requirement = (from sr in finalDB.Software_Requirements
                               where sr.id == id
                               select sr).Single();
            finalDB.Software_Requirements.DeleteOnSubmit(requirement);

            finalDB.SubmitChanges();
            return null;
        }
Esempio n. 3
0
        public Work_Package DeletePackage(int id)
        {
            IPFinalDBDataContext finalDB = new IPFinalDBDataContext();
            var requirement = (from wp in finalDB.Work_Packages
                               where wp.id == id
                               select wp).FirstOrDefault();
            finalDB.Work_Packages.DeleteOnSubmit(requirement);

            finalDB.SubmitChanges();
            return null;
        }
Esempio n. 4
0
        public Software_Requirement UpdateRequirement(Software_Requirement sr)
        {
            IPFinalDBDataContext finalDB = new IPFinalDBDataContext();
            var requirement = (from d in finalDB.Software_Requirements
                               where d.id == sr.id
                               select d).Single();

            requirement.description = sr.description;
            requirement.platform = sr.platform;
            requirement.title = sr.title;
            finalDB.SubmitChanges();

            return requirement;
        }
Esempio n. 5
0
        public Work_Package InsertPackage(Work_Package wp)
        {
            wp.createddate = DateTime.Now;

            IPFinalDBDataContext finalDB = new IPFinalDBDataContext();
            var task = from w in finalDB.Work_Packages
                       where w.task_id == wp.task_id
                       select w.workorder;

            int maxOrder = 0;
            if (task != null && task.Count() > 0)
                maxOrder = task.Max<int>();
            wp.workorder = maxOrder + 5;
            finalDB.Work_Packages.InsertOnSubmit(wp);
            finalDB.SubmitChanges();

            return wp;
        }
Esempio n. 6
0
        public bool UpdateRequirements(int id, List<Package_Software> reqs)
        {
            // try
            //{
                IPFinalDBDataContext finalDB = new IPFinalDBDataContext();
                finalDB.DeletePackageSoftware(id);

                foreach (Package_Software item in reqs)
                {
                    finalDB.Package_Softwares.InsertOnSubmit(item);
                }

                finalDB.SubmitChanges();

                return true;
            //}
            //catch { return false; }
        }
Esempio n. 7
0
        public Work_Package UpdatePackage(Work_Package wp)
        {
            IPFinalDBDataContext finalDB = new IPFinalDBDataContext();
            var package = (from d in finalDB.Work_Packages
                           where d.id == wp.id
                           select d).Single();

            package.description = wp.description;
            package.name = wp.name;
            package.status = wp.status;
            package.notes = wp.notes;
            finalDB.SubmitChanges();

            return package;
        }