Пример #1
0
        public List <threeorganizationModel> threeorganizationWhere(string id)
        {
            MyDbContext db = CreateContext();
            List <threeorganization> list = db.threeorganization.AsNoTracking()
                                            .Where(e => e.twoCodeName == id)
                                            .Select(e => e)
                                            .ToList();
            List <threeorganizationModel> list2 = new List <threeorganizationModel>();

            foreach (threeorganization item in list)
            {
                threeorganizationModel last = new threeorganizationModel()
                {
                    threeID         = item.threeID,
                    oneName         = item.oneName,
                    twoCodeName     = item.twoCodeName,
                    threeCode       = item.threeCode,
                    threeCodeName   = item.threeCodeName,
                    threeCodemarket = item.threeCodemarket,
                    threeCodepd     = item.threeCodepd
                };
                list2.Add(last);
            }
            return(list2);
        }
Пример #2
0
        public int threeorganizationDel(threeorganizationModel three)
        {
            threeorganization last = new threeorganization()
            {
                threeID = three.threeID
            };

            return(Delete(last));
        }
Пример #3
0
        public ActionResult Deletethree(int id)
        {
            threeorganizationModel three = new threeorganizationModel()
            {
                threeID = id
            };
            int pd = ithree.threeorganizationDel(three);

            return(Content(JsonConvert.SerializeObject(pd)));
        }
Пример #4
0
 public ActionResult InsertthreeWhere(threeorganizationModel three)
 {
     if (ithree.threeorganizationUpd(three) > 0)
     {
         Response.Write("<script>alert('修改成功')</script>");
         return(Selectthree());
     }
     else
     {
         Response.Write("<script>alert('修改成功')</script>");
         return(View());
     }
 }
Пример #5
0
        public int threeorganizationAdd(threeorganizationModel three)
        {
            threeorganization last = new threeorganization()
            {
                oneName         = three.oneName,
                twoCodeName     = three.twoCodeName,
                threeCode       = three.threeCode,
                threeCodeName   = three.threeCodeName,
                threeCodemarket = three.threeCodemarket,
                threeCodepd     = three.threeCodepd
            };

            return(Add(last));
        }
Пример #6
0
        public int threeorganizationUpd(threeorganizationModel three)
        {
            threeorganization last = new threeorganization()
            {
                threeID         = three.threeID,
                oneName         = three.oneName,
                twoCodeName     = three.twoCodeName,
                threeCode       = three.threeCode,
                threeCodeName   = three.threeCodeName,
                threeCodemarket = three.threeCodemarket,
                threeCodepd     = three.threeCodepd
            };

            return(Update(last));
        }
Пример #7
0
        public ActionResult SelectWherethree(int id)
        {
            List <threeorganizationModel> list  = ithree.threeorganizationSelectWhere(id);
            threeorganizationModel        three = null;

            foreach (threeorganizationModel item in list)
            {
                three = new threeorganizationModel()
                {
                    threeID         = id,
                    oneName         = item.oneName,
                    twoCodeName     = item.twoCodeName,
                    threeCode       = item.threeCode,
                    threeCodeName   = item.threeCodeName,
                    threeCodemarket = item.threeCodemarket,
                    threeCodepd     = item.threeCodepd
                };
            }
            return(View("SelectWherethree", three));
        }
Пример #8
0
        public List <threeorganizationModel> threeorganizationSelect()
        {
            List <threeorganization>      list  = Select();
            List <threeorganizationModel> list2 = new List <threeorganizationModel>();

            foreach (threeorganization item in list)
            {
                threeorganizationModel last = new threeorganizationModel()
                {
                    threeID         = item.threeID,
                    oneName         = item.oneName,
                    twoCodeName     = item.twoCodeName,
                    threeCode       = item.threeCode,
                    threeCodeName   = item.threeCodeName,
                    threeCodemarket = item.threeCodemarket,
                    threeCodepd     = item.threeCodepd
                };
                list2.Add(last);
            }
            return(list2);
        }
Пример #9
0
 public int threeorganizationUpd(threeorganizationModel three)
 {
     return(ithree.threeorganizationUpd(three));
 }