예제 #1
0
        //ajax提交处理的action
        public ActionResult AddAction(JiaoXueJieDuanBiao jxjd)
        {
            if (jxjd.ShenHeShiFouTongGuo == null)
            {
                jxjd.ShenHeShiFouTongGuo = false;
            }
            if (jxjd.ShiFouQiYong == null)
            {
                jxjd.ShiFouQiYong = false;
            }
            var jdm = bll.SelectGetName(jxjd.JieDuanMing);

            if (jdm == null)
            {
                int n = bll.Addjiaoxuejieduan(jxjd);
                if (n > 0)
                {
                    return(Json(new { errorNo = "0", errorInfo = "教学阶段新增成功" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { errorNo = "1", errorInfo = "教学阶段新增失败,请检查重试" }, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(Json(new { errorNo = "1", errorInfo = "此阶段名已经存在,请重新输入" }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #2
0
        //修改时提交
        public ActionResult UpdateAction(JiaoXueJieDuanBiao jxjd)
        {
            if (jxjd.ShenHeShiFouTongGuo == null)
            {
                jxjd.ShenHeShiFouTongGuo = false;
            }
            if (jxjd.ShiFouQiYong == null)
            {
                jxjd.ShiFouQiYong = false;
            }

            var name = bll.SelectGetName(jxjd.JieDuanMing, jxjd.ID);

            if (A == false)
            {
                if (name == null)
                {
                    int n = bll.Updatejiaoxuejieduan(jxjd);
                    if (n > 0)
                    {
                        return(Json(new { errorNo = "0", errorInfo = "教学阶段基本信息修改成功" }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { errorNo = "1", errorInfo = "教学阶段基本信息修改失败,请检查重试" }, JsonRequestBehavior.AllowGet));
                    }
                }
                else
                {
                    return(Json(new { errorNo = "1", errorInfo = "此阶段名已经存在,请重新输入" }, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(Json(new { errorNo = "1", errorInfo = "审核已通过,不能修改" }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #3
0
 //1.以对象删除
 public int Detelejiaoxuejieduan(JiaoXueJieDuanBiao jxjd)
 {
     return(dal.Deletejiaoxuejieduan(jxjd));
 }
예제 #4
0
 public int Updatejiaoxuejieduan(JiaoXueJieDuanBiao jxjd)
 {
     return(dal.Updatejiaoxuejieduan(jxjd));
 }
예제 #5
0
 public int Addjiaoxuejieduan(JiaoXueJieDuanBiao jxjd)
 {
     return(dal.Addjiaoxuejieduan(jxjd));
 }
예제 #6
0
 public int Deletejiaoxuejieduan(JiaoXueJieDuanBiao jxjd)
 {
     context.Set <JiaoXueJieDuanBiao>().Attach(jxjd);
     context.Set <JiaoXueJieDuanBiao>().Remove(jxjd);
     return(context.SaveChanges());
 }
예제 #7
0
 public int Updatejiaoxuejieduan(JiaoXueJieDuanBiao jxjd)
 {
     context.Set <JiaoXueJieDuanBiao>().Attach(jxjd);
     context.Entry <JiaoXueJieDuanBiao>(jxjd).State = EntityState.Modified;
     return(context.SaveChanges());
 }
예제 #8
0
 public int Addjiaoxuejieduan(JiaoXueJieDuanBiao jxjd)
 {
     context.Set <JiaoXueJieDuanBiao>().Add(jxjd);
     return(context.SaveChanges());
 }