public static void Update_Student_Rating_In_DB(Student s) { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Update_Student_Rating @ID, @Rating "; c.Parameters.AddWithValue("@ID", s.getId()); c.Parameters.AddWithValue("@Rating", s.getRating()); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public static void update_ActivityFeedback_Recieve_Student_In_DB(ActivityFeedback af) { if (af.getRecieveStudent() != null) { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_add_ActivityFeedback_Recieve_Student @RecieveStudent, @Id"; c.Parameters.AddWithValue("@RecieveStudent", af.getRecieveStudent().getId()); c.Parameters.AddWithValue("@Id", af.getId()); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); } }
public static void create_Grade_In_DB(Grade g) { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_create_Grade @pfID, @qId, @value "; c.Parameters.AddWithValue("@pfID", g.getParentFeedback().getId()); c.Parameters.AddWithValue("@qId", g.getQuestion().getId()); c.Parameters.AddWithValue("@value", g.getValue()); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public static void update_ed_approvalNote_in_DB(EquipmentDemand ed, String status) { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_update_EquipmentDemand_ApprovalNote @EquipmentDemand, @ApprovalNote"; c.Parameters.AddWithValue("@EquipmentDemand", ed.getId()); c.Parameters.AddWithValue("@ApprovalNote", ed.getApprovalNote()); Console.WriteLine(c.ToString()); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public static void create_ParentFeedbak_In_DB(ParentsFeedBack pf) { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_create_ParentFeedbak @ID, @StudentId, @DT, @Description "; c.Parameters.AddWithValue("@ID", pf.getId()); c.Parameters.AddWithValue("@StudentId", pf.getCreator().getId()); c.Parameters.AddWithValue("@DT", pf.getDateTime()); c.Parameters.AddWithValue("@Description", pf.getDescription()); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public static void create_Contain_In_DB(contain con) { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_add_Contain @ProductName, @EdId, @Quantity, @Description "; c.Parameters.AddWithValue("@ProductName", con.getProduct().getName()); c.Parameters.AddWithValue("@EdId", con.getEquipmentDemand().getId()); c.Parameters.AddWithValue("@Quantity", con.getQuantity()); c.Parameters.AddWithValue("@Description", con.getDescription()); Console.WriteLine(c.ToString()); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public static void create_ActivityFeedback_In_DB(ActivityFeedback af) { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_add_ActivityFeedback1 @Id, @Dt, @Description, @Creator"; c.Parameters.AddWithValue("@id", af.getId()); c.Parameters.AddWithValue("@Dt", af.getDateTime()); c.Parameters.AddWithValue("@Description", af.getDescription()); if (af.getCreator() != null) { c.Parameters.AddWithValue("@Creator", af.getCreator().getId()); } SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public static void create_note_In_DB(Note note) { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_add_Note @NoteID, @NoteDT, @LastShow, @Description, @Title, @NoteCreator "; c.Parameters.AddWithValue("@NoteID", note.getId()); c.Parameters.AddWithValue("@NoteDT", note.getNoteDT()); c.Parameters.AddWithValue("@LastShow", note.getLastShown()); c.Parameters.AddWithValue("@Description", note.getDescription()); c.Parameters.AddWithValue("@Title", note.getTitle()); c.Parameters.AddWithValue("@NoteCreator", note.getCreator().getId()); Console.WriteLine(c.ToString()); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public static void create_EquipmentDemand_In_DB(EquipmentDemand ed) { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_add_EquipmentDemand @id, @Emp, @reason"; c.Parameters.AddWithValue("@id", ed.getId()); if (ed.getCreator() != null) { c.Parameters.AddWithValue("@Emp", ed.getCreator().getId()); } c.Parameters.AddWithValue("@reason", ed.getReason()); Console.WriteLine(c.ToString()); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }