/// <summary> /// 添加学校 /// </summary> /// <param name="context"></param> public void btnSchoolAdd(HttpContext context) { string Code = context.Request["Code"].ToString(); string Name = context.Request["Name"].ToString(); string Remark = context.Request["Remark"].ToString(); int Pid = int.Parse(context.Request["Pid"].ToString()); SchoolsInfo S = new SchoolsInfo(); S.School_Code = Code; S.P_ID = Pid; S.School_Name = Name; S.School_Remark = Remark; bool b = BLL.SchooInfo_BLL.SchoolidAdd(S); string str = ""; if (b) { str = "1"; } else { str = "0"; } string json = JsonConvert.SerializeObject(str); context.Response.Write(json); }
/// <summary> /// 根据校区编号添加学校 /// </summary> /// <param name="School_ID"></param> /// <returns></returns> public static bool SchoolidAdd(SchoolsInfo S) { string sql = "insert into Schools(P_ID,School_Code,School_Name,School_Remark) values(@P_ID,@School_Code,@School_Name,@School_Remark)"; SqlParameter[] para = { new SqlParameter("P_ID", S.P_ID), new SqlParameter("School_Code", S.School_Code), new SqlParameter("School_Name", S.School_Name), new SqlParameter("School_Remark", S.School_Remark) }; int i = DBHelper.ExecuteNonQuery(sql, para); if (i > 0) { return(true); } else { return(false); } }
/// <summary> /// 根据校区编号修改学校 /// </summary> /// <param name="School_ID"></param> /// <returns></returns> public static bool SchoolidUpdate(SchoolsInfo S) { string sql = "update Schools set School_Code=@School_Code, School_Name=@School_Name,School_Remark=@School_Remark where School_ID=@School_ID and P_ID=@P_ID"; SqlParameter[] para = { new SqlParameter("P_ID", S.P_ID), new SqlParameter("School_Code", S.School_Code), new SqlParameter("School_Name", S.School_Name), new SqlParameter("School_Remark", S.School_Remark), new SqlParameter("School_ID", S.School_ID) }; int i = DBHelper.ExecuteNonQuery(sql, para); if (i > 0) { return(true); } else { return(false); } }
/// <summary> /// 根据校区编号修改学校 /// </summary> /// <param name="School_ID"></param> /// <returns></returns> public static bool SchoolidUpdate(SchoolsInfo S) { return(DAL.SchooInfo_DAL.SchoolidUpdate(S)); }