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 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 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); }
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 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); }
//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 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 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 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); }