Пример #1
0
        public int StudentUpdate(TwoorganModel sm)
        {
            Twoorgan stu = new Twoorgan()
            {
                Tid = sm.Tid, TName = sm.TName, Pid = sm.Pid, Sid = sm.Sid, Oid = sm.Oid
            };

            return(Update(stu));
        }
Пример #2
0
        public List <TwoorganModel> StudentSelect()
        {
            List <Twoorgan>      list  = Select();
            List <TwoorganModel> list2 = new List <TwoorganModel>();

            foreach (Twoorgan item in list)
            {
                TwoorganModel sm = new TwoorganModel()
                {
                    Tid = item.Tid, TName = item.TName, Pid = item.Pid, Sid = item.Sid, Oid = item.Oid
                };
                list2.Add(sm);
            }
            return(list2);
        }
Пример #3
0
        public ActionResult Del(int id)
        {
            TwoorganModel om = new TwoorganModel();

            om.Tid = id;
            int result = sb.StudentDelete(om);

            if (result > 0)
            {
                return(Content("<script>alert('删除成功');window.location.href='../Index';</script>"));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
Пример #4
0
        public ActionResult Add(string TName, int Pid, int Sid)
        {
            TwoorganModel om = new TwoorganModel()
            {
                Oid = int.Parse(Request["cfsk.firstKindId"]), TName = TName, Pid = Pid, Sid = Sid
            };
            int result = sb.StudentAdd(om);

            if (result > 0)
            {
                return(Content("<script>alert('添加成功');window.location.href='../Twoorgan/Index';</script>"));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
Пример #5
0
        public ActionResult Update(TwoorganModel om)
        {
            om.Tid   = int.Parse(Request["cfsk.secondKindId2"]);
            om.Pid   = int.Parse(Request["cffk.firstKindSalaryId"]);
            om.Sid   = int.Parse(Request["cffk.firstKindSaleId"]);
            om.TName = Request["cffk.firstKindName"];
            om.Oid   = int.Parse(Request["cffk.firstKindId123"]);
            int result = sb.StudentUpdate(om);

            if (result > 0)
            {
                return(Content("<script>alert('修改成功 ');window.location.href='../Twoorgan/Index';</script>"));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
Пример #6
0
        public List <TwoorganModel> SelectStudentBy(int id)
        {
            MyDbContext     db   = CreateContext();
            List <Twoorgan> list = db.Twoorgan.AsNoTracking()
                                   .Where(e => e.Tid == id)
                                   .Select(e => e)
                                   .ToList();
            List <TwoorganModel> list2 = new List <TwoorganModel>();

            foreach (Twoorgan item in list)
            {
                TwoorganModel sm = new TwoorganModel()
                {
                    Tid = item.Tid, TName = item.TName, Pid = item.Pid, Sid = item.Sid
                };
                list2.Add(sm);
            }
            return(list2);;
        }
Пример #7
0
 public int StudentUpdate(TwoorganModel sm)
 {
     return(sd.StudentUpdate(sm));
 }
Пример #8
0
 public int StudentAdd(TwoorganModel sm)
 {
     return(sd.StudentAdd(sm));
 }