public int UpdateUserType(string usertyp) { int save = 0; DBSqlConnection con = new DBSqlConnection(); //string sql = @"UPDATE [dbo].[UserType] SET [UserTyp] = '" + usertyp + "' WHERE [UserTyp] = '" + usertyp + "'"; string sql = @"UPDATE [dbo].[UserType] SET [UserType] = '" + usertyp + "' WHERE [UserType] = '" + usertyp + "'"; try { SqlCommand cmd = new SqlCommand(sql, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public DataTable GetDataFromTableCours3(string topic) { DataTable dt = new DataTable(); string sql = @"select * from [dbo].[Course_Topic] where [Topic] = '" + topic + "' "; DBSqlConnection con = new DBSqlConnection(); SqlDataAdapter da = new SqlDataAdapter(sql, con.getSqlConnection()); da.Fill(dt); return(dt); }
public DataTable GetDataFromTableDepFloor(string Dep_Floor) { DataTable dt = new DataTable(); string sql = @"select * from [dbo].[Departments] where [Dep_Floor] ='" + Dep_Floor + "' "; DBSqlConnection con = new DBSqlConnection(); SqlDataAdapter da = new SqlDataAdapter(sql, con.getSqlConnection()); da.Fill(dt); return(dt); }
public DataTable GetDataFromTableDay(string day) { DataTable dt = new DataTable(); string sql = @"SELECT * from [dbo]. [ReguDay] where [RegularDay] = '" + day + "'"; DBSqlConnection con = new DBSqlConnection(); SqlDataAdapter da = new SqlDataAdapter(sql, con.getSqlConnection()); da.Fill(dt); return(dt); }
public DataTable GetDataFromTableMark(string name) { DataTable dt = new DataTable(); string sql = @"select * from [dbo].[Mark_Distribution] where [Mar_Dis_Name] = '" + name + "' "; DBSqlConnection con = new DBSqlConnection(); SqlDataAdapter da = new SqlDataAdapter(sql, con.getSqlConnection()); da.Fill(dt); return(dt); }
public DataTable GetDataFromTableF2(string fEm) { DataTable dt = new DataTable(); string sql = @"select * from [dbo].[Faculties] where [Email] = '" + fEm + "'"; DBSqlConnection con = new DBSqlConnection(); SqlDataAdapter da = new SqlDataAdapter(sql, con.getSqlConnection()); da.Fill(dt); return(dt); }
public DataTable GetDataFromTableCours(string Title) { DataTable dt = new DataTable(); string sql = @"select * from [dbo].[Courses] where [Title] ='" + Title + "'"; DBSqlConnection con = new DBSqlConnection(); SqlDataAdapter da = new SqlDataAdapter(sql, con.getSqlConnection()); da.Fill(dt); return(dt); }
public DataTable GetDataFromTableHoliD3(string heD) { DataTable dt = new DataTable(); string sql = @"select * from [dbo].[HoliDay_List] where [Holiday_End_Date]= '" + heD + "'"; DBSqlConnection con = new DBSqlConnection(); SqlDataAdapter da = new SqlDataAdapter(sql, con.getSqlConnection()); da.Fill(dt); return(dt); }
public int saveDepInfo(string dep, string depFlor) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sqlCinf = @"INSERT INTO [dbo].[Departments] ([DepName] ,[Dep_Floor]) VALUES ('" + dep + "','" + depFlor + "')"; try { SqlCommand cmd = new SqlCommand(sqlCinf, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public int saveMarknfo(string markdn, string mark, string semTyp) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sqlCinf = @"INSERT INTO [dbo].[Mark_Distribution] ([Mar_Dis_Name] ,[Marks] ,[SemTy_Id]) VALUES ('" + markdn + "','" + mark + "','" + semTyp + "')"; try { SqlCommand cmd = new SqlCommand(sqlCinf, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public int saveUInfo(string sName, string userT, string lLog, string pass) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sqlCinf = @"INSERT INTO [dbo].[Users] ([UserName],[User_Type], [Password] ,[Last_Login]) VALUES ('" + sName + "','" + userT + "','" + pass + "','" + lLog + "')"; try { SqlCommand cmd = new SqlCommand(sqlCinf, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public int saveFacultyInfo(string fFn, string fLn, string fCn, string fEm, string fSn, string ddDepId) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sql = @"INSERT INTO [dbo].[Faculties] ([FirstName] ,[LastName] ,[ShortName] ,[ContactNo] ,[Email], [Dep_ID]) VALUES ('" + fFn + "', '" + fLn + "', '" + fSn + "', '" + fCn + "', '" + fEm + "', '" + ddDepId + "')"; try { SqlCommand cmd = new SqlCommand(sql, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public int saveInfoDay(string day) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sqlCinf = @"INSERT INTO [dbo].[ReguDay] ([RegularDay]) VALUES ('" + day + "')"; try { SqlCommand cmd = new SqlCommand(sqlCinf, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public int UpdateCourseInfo(string ddCCode, string ddCTitle, string cHour) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sql = @"UPDATE [dbo].[Courses] SET [Course_Code] = '" + ddCCode + "' ,[Credit_Hour] = '" + cHour + "' ,[Title] = '" + ddCTitle + "' WHERE [Title] = '" + ddCTitle + "'"; try { SqlCommand cmd = new SqlCommand(sql, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public int saveUInfoCT(string date, string topic, string title) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sqlCinf = @"INSERT INTO [dbo].[Course_Topic] ([Topic] ,[Title],[Date] ) VALUES ('" + topic + "','" + title + "','" + date + "')"; try { SqlCommand cmd = new SqlCommand(sqlCinf, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public int saveHoliDInfo(string name, string hsD, string heD) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sqlCinf = @"INSERT INTO [dbo].[HoliDay_List] ([Name] ,[Holiday_Start_Date] ,[Holiday_End_Date]) VALUES ('" + name + "','" + hsD + "','" + heD + "')"; try { SqlCommand cmd = new SqlCommand(sqlCinf, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public int Updatefaculty(string fFn, string fLn, string fCn, string fEm, string fSn) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sql = @"UPDATE [dbo].[Faculties] SET [FirstName] = '" + fFn + "',[LastName] = '" + fLn + "',[ShortName] = '" + fSn + "',[ContactNo] = '" + fCn + "',[Email] = '" + fEm + "' WHERE [Email] = '" + fEm + "' "; try { SqlCommand cmd = new SqlCommand(sql, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public int UpdateDepartment(string depname, string depflor) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sql = @"UPDATE [dbo].[Departments] SET [DepName] = '" + depname + "' ,[Dep_Floor] = '" + depflor + "' WHERE [Dep_Floor] = '" + depflor + "'"; try { SqlCommand cmd = new SqlCommand(sql, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
//internal int public int UpdateUInfoCT(string topic, string id) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sqlCinf = @"UPDATE [dbo].[CourseTriTopic] SET [Topic] ='" + topic + "' Where [Id] ='" + id + "' "; try { SqlCommand cmd = new SqlCommand(sqlCinf, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public int saveCFInfo(string userType) { int save = 0; DBSqlConnection con = new DBSqlConnection(); string sqlCinf = @"INSERT INTO [dbo].[UserType] ([UserType]) VALUES ('" + userType + "')"; try { SqlCommand cmd = new SqlCommand(sqlCinf, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }
public int saveCourseInfo(string cCode, string cTitle, string cHour) //, string ddFacId { int save = 0; DBSqlConnection con = new DBSqlConnection(); // ,[FId] string sqlCinf = @"INSERT INTO [dbo].[Courses] ([Course_Code] ,[Credit_Hour] ,[Title]) VALUES ('" + cCode + "','" + cHour + "','" + cTitle + "')"; //,'" + semtid + "','" + facId + "' try { SqlCommand cmd = new SqlCommand(sqlCinf, con.getSqlConnection()); cmd.ExecuteNonQuery(); save++; } catch (Exception r) { r.Message.ToString(); save = 0; } finally { con.CloseConnection(); } return(save); }