public static int AddRecord(StudentInfo stu) { string sql = string.Format("insert into CheckRecordTable values(NULL, {0},'{1}', '{2}', {3}, '{4}')", AccountInfo.AccountSession.ID, AccountInfo.AccountSession.Person, DateTime.Now.ToString("yyyy-MM-dd"), stu.ID, stu.Name); return(SQLiteControl.ExecuteNonQuery(sql)); }
public static int Updata(StudentInfo stu) { string sql = string.Format("update StudentsTable set Name='{0}', Sex='{1}',Parents='{2}',Contacts='{3}',Address='{4}',Tuition={5},Remaining={6},ClassHours={7},Pay={8},LastPayDate='{9}',NotPay={10} where ID={11}", stu.Name, stu.Sex, stu.Parents, stu.Contacts, stu.Address, stu.Tuition, stu.Remaining, stu.ClassHours, stu.Pay ? 1 : 0, stu.LastPayDate.ToString("yyyy-MM-dd"), stu.NotPay, stu.ID); return(SQLiteControl.ExecuteNonQuery(sql)); }
/// <summary> /// 创建学生 /// </summary> /// <param name="stu"></param> /// <returns></returns> public static int CreateStudentInfo(StudentInfo stu) { string sql = string.Format("insert into StudentsTable values(NULL,'{0}','{1}','{2}','{3}','{4}','{5}',{6},{7},{8},{9},'{10}',{11}, {12})", stu.SerialNum, stu.Name, stu.Sex, stu.Parents, stu.Contacts, stu.Address, stu.Tuition, stu.Remaining, stu.ClassHours, stu.Pay ? 1 : 0, stu.LastPayDate.ToString("yyyy-MM-dd"), stu.NotPay, 0); return(SQLiteControl.ExecuteNonQuery(sql)); }
/// <summary> /// 创建班级 /// </summary> /// <param name="arg"></param> /// <returns></returns> public static int CreateGroup(GroupClassInfo arg) { string sql = string.Format("insert into GroupClassTable values(NULL, '{0}', '{1}','{2}','{3}','{4}', 0)", arg.GroupName, arg.CreatePerson, arg.CreateDate.ToString("yyyy-MM-dd"), arg.PersonID, arg.ClassTeacher); return(SQLiteControl.ExecuteNonQuery(sql)); }
/// <summary> /// 修改班级信息 /// </summary> /// <param name="arg"></param> /// <returns></returns> public static int ModifyGroup(GroupClassInfo arg) { string sql = string.Format( "update GroupClassTable set GroupName = '{0}', ClassTeacher = '{1}' where ID ={2}", arg.GroupName, arg.ClassTeacher, arg.ID); return(SQLiteControl.ExecuteNonQuery(sql)); }
public static int CreateRecord(PayRecordInfo payRecord) { string sql = string.Format("insert into PayRecordTable values(NULL,{0},'{1}','{2}',{3},'{4}','{5}',{6},{7},{8},{9},{10},'{11}')", payRecord.StudentID, payRecord.StudentName, payRecord.LastDateTime.ToString("yyyy-MM-dd"), payRecord.OperationID, payRecord.OperationPerson, payRecord.Remark, payRecord.Tuition, payRecord.Remaining, payRecord.ClassHours, payRecord.Pay ? 1 : 0, payRecord.NotPay, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); return(SQLiteControl.ExecuteNonQuery(sql)); }
public static bool RegisterAccount(AccountInfo account) { string sql = string.Format( "insert into UsersTable values(NULL, '{0}', '{1}', '{2}', '{3}', {4})", account.Person, account.Account, account.Password, account.Key, account.Power); int result = SQLiteControl.ExecuteNonQuery(sql); if (result != 1) { return(false); } return(true); }
public static bool SimpleDelete(int[] id) { string sql = string.Format("delete from UsersTable where ID in ({0}", id[0]); for (int i = 1; i < id.Length; i++) { sql += string.Format(", {0}", id[i]); } sql += ")"; int result = SQLiteControl.ExecuteNonQuery(sql); if (result > 0) { return(true); } return(false); }
/// <summary> /// 为小组添加成员 /// </summary> /// <returns></returns> public static int AddMembers(int GroupID, int[] StudentsID) { if (StudentsID.Length <= 0) { return(-1); } string sql = string.Format("insert into StudentsCheckinTable values(NULL, {0}, {1}", GroupID, StudentsID[0]); for (int i = 1; i < StudentsID.Length; i++) { sql += string.Format("),(NULL, {0}, {1}", GroupID, StudentsID[i]); } sql += ")"; return(SQLiteControl.ExecuteNonQuery(sql)); }
public static int DeleteMemebers(int GroupID, int StudentsID) { string sql = string.Format("delete from StudentsCheckinTable where GroupID = {0} and StudentID = {1}", GroupID, StudentsID); return(SQLiteControl.ExecuteNonQuery(sql)); }