public static STD_Archive GetSTD_ArchiveByID(int id) { STD_Archive sTD_Archive = new STD_Archive(); SqlSTD_ArchiveProvider sqlSTD_ArchiveProvider = new SqlSTD_ArchiveProvider(); sTD_Archive = sqlSTD_ArchiveProvider.GetSTD_ArchiveByID(id); return sTD_Archive; }
private void loadRoutine() { try { STD_RoutineTime routineTime = new STD_RoutineTime(); routineTime.RoomID = Request.QueryString["RoomID"] == null ? 0 : int.Parse(Request.QueryString["RoomID"]); routineTime.RoutineID = Request.QueryString["RoutineID"] == null ? 0 : int.Parse(Request.QueryString["RoutineID"]); routineTime.ClassID = Request.QueryString["ClassID"] == null ? 0 : int.Parse(Request.QueryString["ClassID"]); routineTime.SubjectID = Request.QueryString["SubjectID"] == null ? 0 : int.Parse(Request.QueryString["SubjectID"]); routineTime.EmployeeID = Request.QueryString["EmployeeID"] == null ? "" : Request.QueryString["EmployeeID"]; string StudentID = Request.QueryString["StudentID"] == null ? "" : Request.QueryString["StudentID"]; lblRoutineDisplay.Text= STD_RoutineTimeManager.getRoutineTextDayTop(routineTime, StudentID); lblRoutineDisplay.Text = lblRoutineDisplay.Text.Replace("id='tblRoutineDisplay'", "border='1'"); lblRoutineDisplay.Text = lblRoutineDisplay.Text.Replace("id='tblRoutineDisplayTeacher'", "border='1'"); if (Request.QueryString["Archive"] != null) { STD_Archive sTD_Archive = new STD_Archive(); sTD_Archive.Archive = lblRoutineDisplay.Text; sTD_Archive.AddedDate = DateTime.Now; int resutl = STD_ArchiveManager.InsertSTD_Archive(sTD_Archive); } } catch (Exception ex) { } }
public STD_Archive GetSTD_ArchiveFromReader(IDataReader reader) { try { STD_Archive sTD_Archive = new STD_Archive ( (int)reader["STD_ArchiveID"], reader["Archive"].ToString(), (DateTime)reader["AddedDate"] ); return sTD_Archive; } catch(Exception ex) { return null; } }
public static bool UpdateSTD_Archive(STD_Archive sTD_Archive) { SqlSTD_ArchiveProvider sqlSTD_ArchiveProvider = new SqlSTD_ArchiveProvider(); return sqlSTD_ArchiveProvider.UpdateSTD_Archive(sTD_Archive); }
public static int InsertSTD_Archive(STD_Archive sTD_Archive) { SqlSTD_ArchiveProvider sqlSTD_ArchiveProvider = new SqlSTD_ArchiveProvider(); return sqlSTD_ArchiveProvider.InsertSTD_Archive(sTD_Archive); }
public bool UpdateSTD_Archive(STD_Archive sTD_Archive) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("CUC_UpdateSTD_Archive", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@STD_ArchiveID", SqlDbType.Int).Value = sTD_Archive.STD_ArchiveID; cmd.Parameters.Add("@Archive", SqlDbType.NText).Value = sTD_Archive.Archive; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = sTD_Archive.AddedDate; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public int InsertSTD_Archive(STD_Archive sTD_Archive) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("CUC_InsertSTD_Archive", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@STD_ArchiveID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@Archive", SqlDbType.NText).Value = sTD_Archive.Archive; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = sTD_Archive.AddedDate; connection.Open(); int result = cmd.ExecuteNonQuery(); return (int)cmd.Parameters["@STD_ArchiveID"].Value; } }