/// <summary> /// 增加一条数据 /// </summary> public bool Add(SeatManage.ClassModel.School model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_SM_School("); strSql.Append("SchoolNo,SchoolName)"); strSql.Append(" values ("); strSql.Append("@SchoolNo,@SchoolName)"); SqlParameter[] parameters = { new SqlParameter("@SchoolNo", SqlDbType.NVarChar, 50), new SqlParameter("@SchoolName", SqlDbType.NVarChar, 100) }; parameters[0].Value = model.No; parameters[1].Value = model.Name; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(SeatManage.ClassModel.School model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update T_SM_School set "); strSql.Append("SchoolName=@SchoolName"); strSql.Append(" where SchoolNo=@SchoolNo "); SqlParameter[] parameters = { new SqlParameter("@SchoolName", SqlDbType.NVarChar, 100), new SqlParameter("@SchoolNo", SqlDbType.NVarChar, 50) }; parameters[0].Value = model.Name; parameters[1].Value = model.No; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 删除校区 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool DeleteSchool(SeatManage.ClassModel.School model) { try { return(school_dal.Delete(model)); } catch { throw; } }
/// <summary> /// 新增校区 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool AddSchoolInfo(SeatManage.ClassModel.School model) { try { return(school_dal.Add(model)); } catch { throw; } }