public static List <Departments> GetDeptNames()//list for combox departs { try { string query = "Select * From DepartdataTable"; string tblName = "DepartdataTable"; List <Departments> deptList = new List <Departments>(); if (_dataSet.Tables.Contains(tblName)) { } else { DataAcesslogic.ReadDataFromDb(_dataSet, query, tblName); } for (int i = 0; i < _dataSet.Tables[tblName].Rows.Count; i++) { DataRow row = _dataSet.Tables[tblName].Rows[i]; Departments dpt = new Departments(); dpt.DepartmentName = row["Departmant"].ToString(); deptList.Add(dpt); } // end of loop return(deptList); } catch (Exception ex) { throw ex; } }
public static bool InsertData(PlayerInfo newplyr)//insert in check table { tblName = "chkTable"; string query = "INSERT INTO " + tblName + "(Name,RegNo,teamname) VALUES('" + newplyr.PlayrName.ToUpper() + "','" + newplyr.PlayerRegno + "','" + newplyr.Playerteamname + "');"; try { DataAcesslogic.ReadDataFromDb(_dataSet, query, tblName); return(true); } catch (Exception ex) { throw ex; } }
public static bool InsertDataa(PlayerInfo nwplayer, string tblName)//insert in Players table { //tblName = "PlayerdataTable"; string query = "INSERT INTO " + tblName + "(Name,Semester,RegNo,Teamdepart,Depart) VALUES('" + nwplayer.PlayrName.ToUpper() + "','" + nwplayer.Playersemester + "','" + nwplayer.PlayerRegno.ToUpper() + "','" + nwplayer.Playerteamname.ToUpper() + "','" + nwplayer.Playerdepart.ToUpper() + "');"; try { DataAcesslogic.ReadDataFromDb(_dataSet, query, tblName); return(true); } catch (Exception ex) { throw ex; } }
public static bool InsertData(TeamInfo nwteam, string tblName)//insert in team table { //tblName = "TeamdataTable"; string query = "INSERT INTO " + tblName + "(TeamName,TeamSemester,TeamDepart) VALUES('" + nwteam.TeamName.ToUpper() + "','" + nwteam.Teasemester + "','" + nwteam.Depart.ToUpper() + "');"; try { DataAcesslogic.ReadDataFromDb(_dataSet, query, tblName); return(true); } catch (Exception ex) { throw ex; } }
public static bool deletdata(PlayerInfo nwplyr)//clear check data { tblName = "chkTable"; string query = "Delete From chkTable Where teamname='" + nwplyr.Playerteamname.ToUpper() + "'"; try { DataAcesslogic.ReadDataFromDb(_dataSet, query, tblName); ReadData(); return(true); } catch (Exception ex) { throw ex; } }
public static bool ReadData() { tblName = "chkTable"; string query = "Select * From chkTable "; try { DataAcesslogic.ReadDataFromDb(_dataSet, query, tblName); if (_dataSet.Tables[tblName].Rows.Count > 0) { return(true); } return(false); } catch (Exception ex) { throw ex; } }
public static bool validtionDbUni(PlayerInfo newplayer)//unidata validation { string query = "Select * From UniData Where StudentName='" + newplayer.PlayrName.ToLower() + "' and StudentRegNO='" + newplayer.PlayerRegno + "' "; try { DataAcesslogic.ReadDataFromDb(_dataSet, query, "UniData"); if (_dataSet.Tables["UniData"].Rows.Count > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }
public static bool validtionDbplr(PlayerInfo newplayer)//validation from playrsDb { string query = "Select * From PlayerdataTable Where Name='" + newplayer.PlayrName + "' and RegNo='" + newplayer.PlayerRegno + "' "; try { DataAcesslogic.ReadDataFromDb(_dataSet, query, "PlayerdataTable"); if (_dataSet.Tables["PlayerdataTable"].Rows.Count > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }
public static bool validationtabletanessDb(TeamInfo nwteam)//team validition from regstrd teams { string query = "Select * From TAbletennisteamTable Where Teamname='" + nwteam.TeamName.ToUpper() + "'"; try { DataAcesslogic.ReadDataFromDb(_dataSet, query, "TAbletennisteamTable"); //football if (_dataSet.Tables["TAbletennisteamTable"].Rows.Count > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }
public static bool validationDb(PlayerInfo nwplayr)//validition from checktable { string query = "Select * From chkTable Where Name='" + nwplayr.PlayrName.ToUpper() + "' and RegNo='" + nwplayr.PlayerRegno.ToUpper() + "' and teamname='" + nwplayr.Playerteamname.ToUpper() + "'"; try { DataAcesslogic.ReadDataFromDb(_dataSet, query, "chkTable"); if (_dataSet.Tables["chkTable"].Rows.Count > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }
//login validtion ... public static bool ValidateUser(UserInfo _user) { string query = "Select * From LoginData Where Username='******' and Password='******' "; try { DataAcesslogic.ReadDataFromDb(_dataSet, query, "LoginData"); if (_dataSet.Tables["LoginData"].Rows.Count > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }