Beispiel #1
0
        public static int stu_project_count(string stu_num)
        {
            stu_insert stu_Insert = new stu_insert
            {
                stu_num = stu_num
            };
            DataSet ds    = BLL.stuBll.select_project_count(stu_Insert);
            int     count = ds.Tables[0].Rows.Count;

            return(count);
        }
Beispiel #2
0
 public static bool insert_pro(stu_insert stu_Insert)
 {
     if (DAL.stuDal.insert_pro(stu_Insert) == true)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
 public void ProcessRequest(HttpContext context)
 {
     if (context.Session["id"] == null)
     {
         context.Response.Write("nologin");
     }
     else
     {
         stu_insert stu_Insert = new stu_insert()
         {
             stu_num = context.Request["stu_num"]
         };
         if (BLL.stuBll.select_stuinfo(stu_Insert).Tables[0].Rows.Count > 0)
         {
             DataSet       ds    = BLL.stuBll.select_stuinfo(stu_Insert);
             StringBuilder json_ = new StringBuilder();
             json_.Append("[");
             for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
             {
                 json_.Append("{");
                 for (int j = 0; j < ds.Tables[0].Columns.Count; j++)
                 {
                     if (j != ds.Tables[0].Columns.Count - 1)
                     {
                         json_.Append("\"" + ds.Tables[0].Columns[j].ToString() + "\":\"" + ds.Tables[0].Rows[i][j].ToString() + "\",");
                     }
                     else
                     {
                         if (i == ds.Tables[0].Rows.Count - 1)
                         {
                             json_.Append("\"" + ds.Tables[0].Columns[j].ToString() + "\":\"" + ds.Tables[0].Rows[i][j].ToString() + "\"}");
                         }
                         else
                         {
                             json_.Append("\"" + ds.Tables[0].Columns[j].ToString() + "\":\"" + ds.Tables[0].Rows[i][j].ToString() + "\"},");
                         }
                     }
                 }
             }
             json_.Append("]");
             context.Response.ContentType = "text/plain";
             context.Response.Write(json_);
         }
         else
         {
             context.Response.ContentType = "text/plain";
             context.Response.Write("false");
         }
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            string     stu_num    = context.Request["stu_num"];
            stu_insert stu_Insert = new stu_insert()
            {
                stu_num = stu_num
            };

            if (BLL.stuBll.del_stu_info_insert(stu_Insert) == true)
            {
                context.Response.ContentType = "text/plain";
                context.Response.Write("true");
            }
            else
            {
                context.Response.ContentType = "text/plain";
                context.Response.Write("false");
            }
        }
Beispiel #5
0
 public void ProcessRequest(HttpContext context)
 {
     ////List<Teacher> json_item = new List<Teacher>();
     //接受前台ajax传输过来的数据 取到学生的学号  看学生添加的选题数量是不是到达最大
     if (context.Session["id"] == null)
     {
         context.Response.Write("nologin");
     }
     else
     {
         string stu_num      = context.Request["name"];
         int    insert_count = Convert.ToInt32(context.Request["count"]);
         int    count        = stu_project_count(stu_num);
         if ((count + insert_count) >= 1)
         {
             context.Response.Write("false");
         }
         else
         {
             string json_ = context.Request["data"];
             context.Response.ContentType = "text/plain";
             List <stu_insert> json_item = JsonConvert.DeserializeObject <List <stu_insert> >(json_);
             if (json_item.Count > 1)
             {
                 context.Response.Write("false");
             }
             else
             {
                 foreach (var item in json_item)
                 {
                     BLL.stuBll.insert_pro(item);
                 }
                 stu_insert s = new stu_insert();
                 //BLL.stuBll.updateIsYes()
                 context.Response.Write("true");
             }
         }
     }
 }
Beispiel #6
0
 public void ProcessRequest(HttpContext context)
 {
     if (context.Session["tea_id"] == null)
     {
         context.Response.Write("nologin");
     }
     else
     {
         stu_insert stu_Insert = new stu_insert()
         {
             project_name = context.Request["project_name"]
         };
         if (BLL.stuBll.stu_del_projectName(stu_Insert) == true)
         {
             context.Response.ContentType = "text/plain";
             context.Response.Write("true");
         }
         else
         {
             context.Response.ContentType = "text/plain";
             context.Response.Write("false");
         }
     }
 }
Beispiel #7
0
        public static DataSet select_project_count(stu_insert stu_Insert)
        {
            DataSet ds = DAL.stuDal.select_project_count(stu_Insert);

            return(ds);
        }
Beispiel #8
0
 public static bool del_stu_info_insert(stu_insert stu_Insert)
 {
     return(DAL.stuDal.del_stu_info_insert(stu_Insert));
 }
Beispiel #9
0
 public static DataSet select_stuinfo(stu_insert stu_Insert)
 {
     return(DAL.stuDal.select_stuinfo(stu_Insert));
 }
Beispiel #10
0
 public static bool stu_del_projectName(stu_insert stu_Insert)
 {
     return(DAL.stuDal.stu_del_projectName(stu_Insert));
 }
Beispiel #11
0
        public static DataSet select_project_count(stu_insert stu_Insert)
        {
            string sql = "select * from stu_insert_info where stu_num='" + stu_Insert.stu_num + "'";

            return(sqlHeleper.selectAll(sql));
        }
Beispiel #12
0
        public static bool del_stu_info_insert(stu_insert stu_Insert)
        {
            string sql = "delete from stu_insert_info where stu_num='" + stu_Insert.stu_num + "'";

            return(sqlHeleper.all(sql));
        }
Beispiel #13
0
        public static bool insert_pro(stu_insert stu_Insert)
        {
            string sql = "insert into stu_insert_info(stu_num,teacher,project_name,project_info) values('" + stu_Insert.stu_num + "','" + stu_Insert.tea_name + "','" + stu_Insert.project_name + "','" + stu_Insert.project_info + "')";

            return(sqlHeleper.all(sql));
        }
Beispiel #14
0
        public static bool stu_del_projectName(stu_insert stu_Insert)
        {
            string sql = "delete from stu_insert_info where project_name='" + stu_Insert.project_name + "'";

            return(sqlHeleper.all(sql));
        }