/// <summary> /// For Student Profile Page /// </summary> /// <param name="svvMailID"></param> /// <param name="error"></param> /// <returns></returns> public static DataSet fetchStdFullDetailIfExist(string svvMailID, out string error) { try { using (MySqlConnection connection = new ConnectionManager().GetDatabaseConnection()) { using (MySqlCommand command_personalData = new MySqlCommand("sp_fetchStdPersonalData", connection)) { using (MySqlCommand command_GradData = new MySqlCommand("sp_fetchStdTyData", connection)) { using (MySqlCommand command_HscData = new MySqlCommand("sp_fetchStdHscData", connection)) { using (MySqlCommand command_SScData = new MySqlCommand("sp_fetchStdSscData", connection)) { using (MySqlCommand command_OtherData = new MySqlCommand("sp_fetchStdOtherDetailsData", connection)) { command_personalData.CommandType = CommandType.StoredProcedure; command_GradData.CommandType = CommandType.StoredProcedure; command_HscData.CommandType = CommandType.StoredProcedure; command_SScData.CommandType = CommandType.StoredProcedure; command_OtherData.CommandType = CommandType.StoredProcedure; command_personalData.Parameters.Add("@svvID", MySqlDbType.VarChar).Value = svvMailID; command_GradData.Parameters.Add("@svvID", MySqlDbType.VarChar).Value = svvMailID; command_HscData.Parameters.Add("@svvID", MySqlDbType.VarChar).Value = svvMailID; command_SScData.Parameters.Add("@svvID", MySqlDbType.VarChar).Value = svvMailID; command_OtherData.Parameters.Add("@svvID", MySqlDbType.VarChar).Value = svvMailID; MySqlDataAdapter adapterPerosnal = new MySqlDataAdapter(); MySqlDataAdapter adapterTy = new MySqlDataAdapter(); MySqlDataAdapter adapterHsc = new MySqlDataAdapter(); MySqlDataAdapter adapterSsc = new MySqlDataAdapter(); MySqlDataAdapter adapterOther = new MySqlDataAdapter(); DataSet ds = new DataSet(); DataTable perosnal = new DataTable(); DataTable ty = new DataTable(); DataTable hsc = new DataTable(); DataTable ssc = new DataTable(); DataTable other = new DataTable(); connection.Open(); MySqlTransaction tranCon = connection.BeginTransaction(); adapterPerosnal.SelectCommand = command_personalData; adapterTy.SelectCommand = command_GradData; adapterHsc.SelectCommand = command_HscData; adapterSsc.SelectCommand = command_SScData; adapterOther.SelectCommand = command_OtherData; adapterPerosnal.Fill(perosnal); adapterTy.Fill(ty); adapterHsc.Fill(hsc); adapterSsc.Fill(ssc); adapterOther.Fill(other); tranCon.Commit(); connection.Close(); ds.Tables.Add(perosnal); ds.Tables.Add(ty); ds.Tables.Add(hsc); ds.Tables.Add(ssc); ds.Tables.Add(other); error = null; return ds; } } } } } } } catch (Exception ex) { error = ex.Message; return null; } }
public static DataSet fetchCompanyClassDivision() { using (MySqlConnection con = new ConnectionManager().GetDatabaseConnection()) { using (MySqlCommand cmdComp = new MySqlCommand("sp_fetchCompanies", con)) { using (MySqlCommand cmdClass = new MySqlCommand("sp_fetchBranches", con)) { //using (MySqlCommand cmdDiv = new MySqlCommand("sp_fetchDivisions", con)) //uncomment all these if you wanted the interviews event division wise and developed the content as pe the need //{ cmdComp.CommandType = CommandType.StoredProcedure; cmdClass.CommandType = CommandType.StoredProcedure; //cmdDiv.CommandType = CommandType.StoredProcedure; MySqlDataAdapter company = new MySqlDataAdapter(); MySqlDataAdapter classes = new MySqlDataAdapter(); //MySqlDataAdapter division = new MySqlDataAdapter(); DataSet ds = new DataSet(); DataTable d1 = new DataTable(); DataTable d2 = new DataTable(); //DataTable d3 = new DataTable(); con.Open(); MySqlTransaction tranCon = con.BeginTransaction(); company.SelectCommand = cmdComp; classes.SelectCommand = cmdClass; //division.SelectCommand = cmdDiv; company.Fill(d1); classes.Fill(d2); //division.Fill(d3); tranCon.Commit(); con.Close(); ds.Tables.Add(d1); ds.Tables.Add(d2); //ds.Tables.Add(d3); return ds; // } } } } }
public static DataSet fetchInterviewsEvents(string svv_mail_id) { using (MySqlConnection connection = new ConnectionManager().GetDatabaseConnection()) { using (MySqlCommand command = new MySqlCommand("sp_fetchInterviews", connection)) { using (MySqlCommand command_check = new MySqlCommand("sp_fetchStudentIntrestedData", connection)) { command.CommandType = CommandType.StoredProcedure; command_check.CommandType = CommandType.StoredProcedure; command.Parameters.Add("svvID", MySqlDbType.VarChar).Value = svv_mail_id; command_check.Parameters.Add("svvID", MySqlDbType.VarChar).Value = svv_mail_id; MySqlDataAdapter interview = new MySqlDataAdapter(); MySqlDataAdapter intrested = new MySqlDataAdapter(); DataSet ds = new DataSet(); DataTable dt_interview = new DataTable(); DataTable dt_intrested = new DataTable(); connection.Open(); MySqlTransaction tranCon = connection.BeginTransaction(); interview.SelectCommand = command; intrested.SelectCommand = command_check; interview.Fill(dt_interview); intrested.Fill(dt_intrested); tranCon.Commit(); connection.Close(); ds.Tables.Add(dt_interview); ds.Tables.Add(dt_intrested); return ds; } } } }
public static DataSet fetchClassDivision() { using (MySqlConnection con = new ConnectionManager().GetDatabaseConnection()) { using (MySqlCommand cmd = new MySqlCommand("sp_fetchBranches", con)) { using (MySqlCommand cmddiv = new MySqlCommand("sp_fetchDivisions", con)) { cmd.CommandType = CommandType.StoredProcedure; cmddiv.CommandType = CommandType.StoredProcedure; MySqlDataAdapter classes = new MySqlDataAdapter(); MySqlDataAdapter division = new MySqlDataAdapter(); DataSet ds = new DataSet(); DataTable d1 = new DataTable(); DataTable d2 = new DataTable(); con.Open(); MySqlTransaction tranCon = con.BeginTransaction(); classes.SelectCommand = cmd; division.SelectCommand = cmddiv; classes.Fill(d1); division.Fill(d2); tranCon.Commit(); con.Close(); ds.Tables.Add(d1); ds.Tables.Add(d2); return ds; } } } }
public static bool isInterviewEventCreated(string company_id, string date, string Description, int TyPer, int HscPer, int SscPer,int Backlogs, List<Int32> branch_ids, out string error) { try { using (MySqlConnection connection = new ConnectionManager().GetDatabaseConnection()) { int affectedRows = 0; connection.Open(); MySqlTransaction tranCon = connection.BeginTransaction(); foreach(int id in branch_ids) { using (MySqlCommand command = new MySqlCommand("sp_createInterviewEvent", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@cID", MySqlDbType.VarChar).Value = company_id; command.Parameters.Add("@edate", MySqlDbType.Date).Value = date; command.Parameters.Add("@description", MySqlDbType.VarChar).Value = Description; command.Parameters.Add("@typer", MySqlDbType.Int32).Value = TyPer; command.Parameters.Add("@hscper", MySqlDbType.Int32).Value = HscPer; command.Parameters.Add("@sscper", MySqlDbType.Int32).Value = SscPer; command.Parameters.Add("@bklogs", MySqlDbType.Int32).Value = Backlogs; command.Parameters.Add("@b_id", MySqlDbType.Int32).Value = id; affectedRows += command.ExecuteNonQuery(); } } tranCon.Commit(); connection.Close(); if (affectedRows > 1) { error = null; return true; } else { error = null; return false; } } } catch (Exception ex) { error = ex.Message; return true; } }