Esempio n. 1
0
        public List <Thecase> Query(int proid, Thecase thecase)
        {
            List <Thecase> thecases = null;

            using (var dbContext = new CasemanaContext())
            {
                //if (thecase.Proid != null)
                //{
                //    thecases = dbContext.Thecase.Where(x => x.Proid == thecase.Proid).ToList();
                //}
                //else if (thecase.Pid != null)
                //{
                //    thecases = dbContext.Thecase.Where(x => x.Pid == thecase.Pid).ToList();
                //}
                //else if (thecase.Unid != null)
                //{
                //    thecases = dbContext.Thecase.Where(x => x.Unid == thecase.Unid).ToList();
                //}
                //else

                if (proid == 0)
                {
                    thecases = dbContext.Thecase.Where(x => x.Ctitle.Contains(thecase.Ctitle)).ToList();
                }
                else
                {
                    thecases = dbContext.Thecase.Where(x => x.Ctitle.Contains(thecase.Ctitle) && x.Proid == proid).ToList();
                }
            }
            return(thecases);
        }
Esempio n. 2
0
        public Project ShowDetail(int proid)
        {
            Project project = new Project();

            using (var dbContext = new CasemanaContext()) {
                project = dbContext.Project.FirstOrDefault(x => x.Proid == proid);
            }
            return(project);
        }
Esempio n. 3
0
 public int Create(Userdetail detail)
 {
     using (var dbContext = new CasemanaContext())
     {
         dbContext.Userdetail.Add(detail);
         dbContext.SaveChanges();
     }
     return(detail.Uid);
 }
Esempio n. 4
0
        public List <Unit> QueryByProid(int proid)
        {
            List <Unit> units = null;

            using (var dbContext = new CasemanaContext())
            {
                units = dbContext.Unit.Where(x => x.Proid == proid).ToList();
            }
            return(units);
        }
Esempio n. 5
0
        public List <Unit> GetAll()
        {
            List <Unit> units = null;

            using (var dbContext = new CasemanaContext())
            {
                units = dbContext.Unit.ToList();
            }
            return(units);
        }
Esempio n. 6
0
        /// <summary>
        /// 展示详情
        /// </summary>
        /// <param name="pid"></param>
        /// <returns></returns>
        public Plan Show(int pid)
        {
            Plan plan = null;

            using (var dbContext = new CasemanaContext())
            {
                plan = dbContext.Plan.FirstOrDefault(x => x.Pid == pid);
            }
            return(plan);
        }
Esempio n. 7
0
        /// <summary>
        /// 获取用例列表
        /// </summary>
        /// <returns></returns>
        public List <Plan> GetAll()
        {
            List <Plan> plans = null;

            using (var dbContet = new CasemanaContext())
            {
                plans = dbContet.Plan.ToList();
            }
            return(plans);
        }
Esempio n. 8
0
        public List <Plan> QueryByProid(int proid)
        {
            List <Plan> plans = null;

            using (var dbContext = new CasemanaContext())
            {
                plans = dbContext.Plan.Where(x => x.Proid == proid).ToList();
            }
            return(plans);
        }
Esempio n. 9
0
        public Userrelation ShowDetail(int?uid)
        {
            Userrelation relation = new Userrelation();

            using (var dbContext = new CasemanaContext())
            {
                relation = dbContext.Userrelation.FirstOrDefault(x => x.Uid == uid);
            }
            return(relation);
        }
Esempio n. 10
0
        public List <Userrelation> QueryByProid(int proid)
        {
            List <Userrelation> relations = null;

            using (var dbContext = new CasemanaContext())
            {
                relations = dbContext.Userrelation.Where(x => x.Proid == proid).ToList();
            }
            return(relations);
        }
Esempio n. 11
0
        public Unit ShowDetail(int unid)
        {
            var unit = new Unit();

            using (var dbContext = new CasemanaContext())
            {
                unit = dbContext.Unit.FirstOrDefault(x => x.Unid == unid);
            }
            return(unit);
        }
Esempio n. 12
0
        public List <Project> Query(Project project)
        {
            List <Project> projects = null;

            using (var dbContext = new CasemanaContext())
            {
                projects = dbContext.Project.Where(x => x.Proname == project.Proname).ToList();
            }
            return(projects);
        }
Esempio n. 13
0
        public List <Thecase> QueryByName(String name)
        {
            List <Thecase> thecases = null;

            using (var dbContext = new CasemanaContext())
            {
                thecases = dbContext.Thecase.Where(x => x.Name == name).ToList();
            }
            return(thecases);
        }
Esempio n. 14
0
        public List <Project> QueryById(int proid)
        {
            List <Project> projects = null;

            using (var dbContext = new CasemanaContext())
            {
                projects = dbContext.Project.Where(x => x.Proid == proid).ToList();
            }
            return(projects);
        }
Esempio n. 15
0
        public List <Userrelation> Query(Userrelation relation)
        {
            List <Userrelation> relations = null;

            using (var dbContext = new CasemanaContext())
            {
                relations = dbContext.Userrelation.Where(x => x.Name.Contains(relation.Name)).ToList();
            }
            return(relations);
        }
Esempio n. 16
0
        public Casedetail ShowDetail(int cid)
        {
            Casedetail casedetail = null;

            using (var dbContext = new CasemanaContext())
            {
                casedetail = dbContext.Casedetail.FirstOrDefault(x => x.Cid == cid);
            }
            return(casedetail);
        }
Esempio n. 17
0
        public List <Userrelation> GetAll()
        {
            List <Userrelation> relations = null;

            using (var dbContext = new CasemanaContext())
            {
                relations = dbContext.Userrelation.ToList();
            }
            return(relations);
        }
Esempio n. 18
0
        public List <Thecase> QueryByPid(int pid)
        {
            List <Thecase> thecases = null;

            using (var dbContext = new CasemanaContext())
            {
                thecases = dbContext.Thecase.Where(x => x.Pid == pid).ToList();
            }
            return(thecases);
        }
Esempio n. 19
0
        /// <summary>
        /// 获取用例列表
        /// </summary>
        /// <returns></returns>
        public List <Thecase> GetAll()
        {
            List <Thecase> thecases = null;

            using (var dbContext = new CasemanaContext())
            {
                thecases = dbContext.Thecase.ToList();
            }
            return(thecases);
        }
Esempio n. 20
0
        public Thecase ShowDetail(int cid)
        {
            Thecase thecase = null;

            using (var dbContext = new CasemanaContext())
            {
                thecase = dbContext.Thecase.FirstOrDefault(x => x.Cid == cid);
            }
            return(thecase);
        }
Esempio n. 21
0
        public List <Project> GetAll()
        {
            List <Project> projects = null;

            using (var dbContext = new CasemanaContext())
            {
                projects = dbContext.Project.ToList();
            }
            return(projects);
        }
Esempio n. 22
0
        public Employ ShowDetail(int?eid)
        {
            Employ employ = new Employ();

            using (var dbContext = new CasemanaContext())
            {
                employ = dbContext.Employ.FirstOrDefault(x => x.Eid == eid);
            }
            return(employ);
        }
Esempio n. 23
0
        public Userdetail ShowDetail(int?uid)
        {
            Userdetail user = null;

            using (var dbContext = new CasemanaContext())
            {
                user = dbContext.Userdetail.FirstOrDefault(x => x.Uid == uid);
            }
            return(user);
        }
Esempio n. 24
0
        public int Create(Project project)
        {
            int count = 0;

            using (var dbContext = new CasemanaContext()) {
                dbContext.Project.Add(project);
                count = dbContext.SaveChanges();
            }
            return(count);
        }
Esempio n. 25
0
        public int Create(Unit unit)
        {
            int count = 0;

            using (var dbContext = new CasemanaContext())
            {
                dbContext.Unit.Add(unit);
                count = dbContext.SaveChanges();
            }
            return(count);
        }
Esempio n. 26
0
        public int Create(Userrelation relation)
        {
            int count = 0;

            using (var dbContext = new CasemanaContext())
            {
                dbContext.Userrelation.Add(relation);
                count = dbContext.SaveChanges();
            }
            return(count);
        }
Esempio n. 27
0
        public int Create(Casedetail casedetail)
        {
            int count = 0;

            using (var dbContext = new CasemanaContext())
            {
                dbContext.Casedetail.Add(casedetail);
                count = dbContext.SaveChanges();
            }
            return(casedetail.Cid);
        }
Esempio n. 28
0
        /// <summary>
        /// 添加计划
        /// </summary>
        /// <param name="pname"></param>
        /// <param name="pstorage"></param>
        /// <returns></returns>
        public int Create(Plan plan)
        {
            int count = 0;

            using (var dbContext = new CasemanaContext())
            {
                dbContext.Plan.Add(plan);
                count = dbContext.SaveChanges();
            }
            return(count);
        }
Esempio n. 29
0
        public int Create(Thecase thecase)
        {
            int count = 0;

            using (var dbContext = new CasemanaContext())
            {
                dbContext.Thecase.Add(thecase);
                count = dbContext.SaveChanges();
            }
            if (count == 0)
            {
            }
            return(thecase.Cid);
        }
Esempio n. 30
0
        public List <Unit> Query(int proid, string unname)
        {
            List <Unit> units = null;

            using (var dbContext = new CasemanaContext())
            {
                if (proid == 0)
                {
                    units = dbContext.Unit.Where(x => x.UnName.Contains(unname)).ToList();
                }
                else
                {
                    units = dbContext.Unit.Where(x => x.Proid == proid && x.UnName.Contains(unname)).ToList();
                }
            }
            return(units);
        }