public Outputclass Update_Course(Coursereg coureg) { Outputclass outputclass = new Outputclass(); try { SqlCommand cmd = new SqlCommand("UPDATECOURSE", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CName", coureg.COURSENAME); cmd.Parameters.AddWithValue("@CNOOFD", coureg.COURSEPERID); cmd.Parameters.AddWithValue("@CSTDT", coureg.COURSEFROMDATE); cmd.Parameters.AddWithValue("@CEDT", coureg.COURSETODATE); cmd.Parameters.AddWithValue("@CDES", coureg.Description); cmd.Parameters.AddWithValue("@CAMT", coureg.COURSEAMOUNT); cmd.Parameters.AddWithValue("@CTRAINERNAME", coureg.TRAINERNAME); cmd.Parameters.AddWithValue("@STATUS", coureg.STATUS); cmd.Parameters.AddWithValue("@CIMPORTANCE", coureg.COURSEIMPORTANCE); Connection(); int i = cmd.ExecuteNonQuery(); if (i > 0) { outputclass.Count = i; } return(outputclass); } catch (Exception ex) { outputclass.Msg = ex.ToString(); return(outputclass); } finally { conn.Close(); } }
public Outputclass Update_qns(Coursereg coureg) { Outputclass outputclass = new Outputclass(); try { SqlCommand cmd = new SqlCommand("UPDATE_QNS", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CID", coureg.Courseid); cmd.Parameters.AddWithValue("@NOOFQNS", coureg.NUMBEROSQUETIONS); Connection(); int i = cmd.ExecuteNonQuery(); if (i > 0) { outputclass.Count = i; } return(outputclass); } catch (Exception ex) { outputclass.Msg = ex.ToString(); return(outputclass); } finally { conn.Close(); } }
public Outputclass AUDITTRAILS(Audittrails adt) { Outputclass outputclass = new Outputclass(); try { SqlCommand cmd = new SqlCommand("Insert_AUDITTRAILS", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@USERID", adt.USERID); cmd.Parameters.AddWithValue("@USERNAME", adt.USERNAME); cmd.Parameters.AddWithValue("@ACTIONOFATTEMPT", adt.ACTIONOFATTEMPT); cmd.Parameters.AddWithValue("@TYPEOFATTEMPT", adt.TYPEOFATTEMPT); cmd.Parameters.AddWithValue("@DESCRIPTION", adt.DESCRIPTION); cmd.Parameters.AddWithValue("@FRONTENDDATE", adt.FRONTENDDATE); cmd.Parameters.AddWithValue("@BACKENDDATE", adt.BACKENDDATE); Connection(); int i = cmd.ExecuteNonQuery(); if (i > 0) { outputclass.Count = i; } return(outputclass); } catch (Exception ex) { outputclass.Msg = ex.ToString(); return(outputclass); } finally { conn.Close(); } }
public Outputclass COURSE_APPROVE(string userid, string courseid, string text) { Outputclass opcls = new Outputclass(); try { SqlCommand cmd = new SqlCommand("COURSE_APPROVE", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@USERID", userid); cmd.Parameters.AddWithValue("@COURSEID", courseid); cmd.Parameters.AddWithValue("@BTNTEXT", text); DataTable dt = new DataTable(); Connection(); opcls.Count = cmd.ExecuteNonQuery(); return(opcls); } catch (Exception ex) { return(null); } finally { conn.Close(); } }
public Outputclass Insert_transid(Usercourseassign usercouass) { Outputclass outputclass = new Outputclass(); try { SqlCommand cmd = new SqlCommand("INSERT_TRANSACTIONID", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@COURSEID", usercouass.COURSEID); cmd.Parameters.AddWithValue("@USERID", usercouass.USERID); cmd.Parameters.AddWithValue("@DATEOFAPPROVE", usercouass.DATEOFAPPROVE); cmd.Parameters.AddWithValue("@EXAMSTATUS", usercouass.EXAMSTATUSASSIGN); cmd.Parameters.AddWithValue("@TRANSACTIONID", usercouass.TRANSACTIONID); Connection(); int i = cmd.ExecuteNonQuery(); if (i > 0) { outputclass.Count = i; } return(outputclass); } catch (Exception ex) { outputclass.Msg = ex.ToString(); return(outputclass); } finally { conn.Close(); } }
public Outputclass Insert_Examrequest(string COURSEID, string USERID) { Outputclass outputclass = new Outputclass(); try { SqlCommand cmd = new SqlCommand("EXAM_REQUEST", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@COURSEID", COURSEID); cmd.Parameters.AddWithValue("@USERID", USERID); Connection(); int i = cmd.ExecuteNonQuery(); if (i > 0) { outputclass.Count = i; } return(outputclass); } catch (Exception ex) { outputclass.Msg = ex.ToString(); return(outputclass); } finally { conn.Close(); } }
public Outputclass Create_Exam(Examtable exam) { Outputclass outputclass = new Outputclass(); try { SqlCommand cmd = new SqlCommand("INSERT_EXAMDATA", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@USERID", exam.USERID); cmd.Parameters.AddWithValue("@COURSEID", exam.COURSEID); cmd.Parameters.AddWithValue("@EXAMCODE", exam.EXAMCODE); cmd.Parameters.AddWithValue("@ATTPT", exam.ATTEMPT); cmd.Parameters.AddWithValue("@QNID", exam.QUESTIONID); cmd.Parameters.AddWithValue("@QUESTION", exam.QUESTION); cmd.Parameters.AddWithValue("@UANS", exam.USERANSWER); cmd.Parameters.AddWithValue("@MARKS", exam.MARKS); Connection(); int i = cmd.ExecuteNonQuery(); if (i > 0) { outputclass.Count = i; } return(outputclass); } catch (Exception ex) { outputclass.Msg = ex.ToString(); return(outputclass); } finally { conn.Close(); } }
public Outputclass Update_QUESTIONs(Questioneries qns) { Outputclass outputclass = new Outputclass(); try { SqlCommand cmd = new SqlCommand("UPDATE_QUESIONARIES", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@QID", qns.QUESTIONID); cmd.Parameters.AddWithValue("@QUESTION", qns.QUESTION); cmd.Parameters.AddWithValue("@MARKS", qns.MMarks); cmd.Parameters.AddWithValue("@A", qns.OP1); cmd.Parameters.AddWithValue("@B", qns.OP2); cmd.Parameters.AddWithValue("@C", qns.OP3); cmd.Parameters.AddWithValue("@D", qns.OP4); cmd.Parameters.AddWithValue("@ANSWER", qns.ANSWER); Connection(); int i = cmd.ExecuteNonQuery(); if (i > 0) { outputclass.Count = i; } return(outputclass); } catch (Exception ex) { outputclass.Msg = ex.ToString(); return(outputclass); } finally { conn.Close(); } }
public Outputclass Create_Course(Coursereg coureg) { Outputclass outputclass = new Outputclass(); try { SqlCommand cmd = new SqlCommand("Insert_COURSEREGISTRATION", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@COURSENAME", coureg.COURSENAME); cmd.Parameters.AddWithValue("@COURSEPERIOD", coureg.COURSEPERID); cmd.Parameters.AddWithValue("@COURSEFROMDATE", coureg.COURSEFROMDATE); cmd.Parameters.AddWithValue("@COURSETODATE", coureg.COURSETODATE); //cmd.Parameters.AddWithValue("@NUMBEROSQUETIONS", coureg.NUMBEROSQUETIONS); cmd.Parameters.AddWithValue("@NUMBEROFDAYS", coureg.NUMBEROFDAYS); cmd.Parameters.AddWithValue("@TOTALMARKS", coureg.TOTALMARKS); cmd.Parameters.AddWithValue("@STATUS", "ACTIVE"); cmd.Parameters.AddWithValue("@DESCRIPTION", coureg.Description); cmd.Parameters.AddWithValue("@COURSEAMOUNT", coureg.COURSEAMOUNT); cmd.Parameters.AddWithValue("@TRAINER", coureg.TRAINERNAME); cmd.Parameters.AddWithValue("@COURSEIMPORTANCE", coureg.COURSEIMPORTANCE); cmd.Parameters.AddWithValue("@DURATIONINHOURS", coureg.COURSEDURATIONINHRS); Connection(); int i = cmd.ExecuteNonQuery(); if (i > 0) { outputclass.Count = i; } return(outputclass); } catch (Exception ex) { outputclass.Msg = ex.ToString(); return(outputclass); } finally { conn.Close(); } }