public static bool CheckMemberID(string memberID) { DbCommand dbComm = BaseDB.CreateCommand(); dbComm.CommandText = "E_Admin_Members_CheckMemberID"; DbParameter param = dbComm.CreateParameter(); param.ParameterName = "@MemberID"; param.Value = memberID; param.DbType = DbType.String; dbComm.Parameters.Add(param); int count; try { count = int.Parse(BaseDB.ExecuteScalar(dbComm)); } catch (Exception exc) { throw exc; } return(count > 0); }
public static int AddNewCategory(string categoryName, string categoryDesc, int sectionID, int parentID) { int categoryID = 0; //Add Section DbCommand dbComm = BaseDB.CreateCommand(); dbComm.CommandText = "E_AddNewCategory"; DbParameter dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@CategoryName"; dbParam.Value = categoryName; dbParam.Size = 125; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@CategoryDesc"; dbParam.Value = categoryDesc; dbParam.Size = 255; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@SectionID"; dbParam.Value = sectionID; dbParam.DbType = DbType.Int32; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@ParentID"; dbParam.Value = parentID; dbParam.DbType = DbType.Int32; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); try { categoryID = int.Parse(BaseDB.ExecuteScalar(dbComm)); } catch (Exception exc) { throw exc; } //bool urlUpdated = AdminURL.UpdateID(categoryURL, categoryID); return(categoryID); }
public static int AddNewSection(string sectionName, string sectionDesc) { int sectionID = 0; DbCommand dbComm = BaseDB.CreateCommand(); dbComm.CommandText = "E_AddNewSection"; DbParameter dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@CategoryName"; dbParam.Value = sectionName; dbParam.Size = 125; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@CategoryDesc"; dbParam.Value = sectionDesc; dbParam.Size = 255; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); try { sectionID = int.Parse(BaseDB.ExecuteScalar(dbComm)); } catch (Exception exc) { throw exc; } //bool urlUpdated = AdminURL.UpdateID(sectionURL, sectionID); return(sectionID); }
public static int UpdateMemberInfo(string memberID, string password, string email, string fname, string lname, string korName, string phone, string address, string address2, string city, string state, string zip, string progressStatus, bool activeStatus, DateTime joined) { DbCommand dbComm = BaseDB.CreateCommand(); dbComm.CommandText = "E_Admin_Members_UpdateMemberInfo"; DbParameter param = dbComm.CreateParameter(); param.ParameterName = "@MemberID"; param.Value = memberID; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@Password"; param.Value = password; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@Email"; param.Value = email; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@FName"; param.Value = fname; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@LName"; param.Value = lname; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@KorName"; param.Value = korName; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@Phone"; param.Value = phone; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@Address"; param.Value = address; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@Address2"; param.Value = address2; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@City"; param.Value = city; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@State"; param.Value = state; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@Zip"; param.Value = zip; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@ProgressStatus"; param.Value = progressStatus; param.DbType = DbType.String; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@ActiveStatus"; param.Value = activeStatus; param.DbType = DbType.Boolean; dbComm.Parameters.Add(param); param = dbComm.CreateParameter(); param.ParameterName = "@Joined"; param.Value = joined; param.DbType = DbType.DateTime; dbComm.Parameters.Add(param); int id; try { id = int.Parse(BaseDB.ExecuteScalar(dbComm)); } catch (Exception exc) { throw exc; } return(id); }
public static int UpdateNews(int newsID, string newsTitle, string source, string author, string newsSmallDesc, string newsDesc, bool hidden, DateTime modified) { DbCommand dbComm = BaseDB.CreateCommand(); DbParameter dbParam; if (newsID == 0) { dbComm.CommandText = "E_AddNewNews"; } else { dbComm.CommandText = "E_UpdateNews"; dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@NewsID"; dbParam.Value = newsID; dbParam.DbType = DbType.Int32; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); } dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Modified"; dbParam.Value = modified; dbParam.DbType = DbType.DateTime; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@NewsTitle"; dbParam.Value = newsTitle; dbParam.Size = 125; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@NewsSmallDesc"; dbParam.Value = newsSmallDesc; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@NewsDesc"; dbParam.Value = newsDesc; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Hidden"; dbParam.Value = hidden; dbParam.DbType = DbType.Boolean; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Source"; dbParam.Value = source; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Author"; dbParam.Value = author; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); try { newsID = int.Parse(BaseDB.ExecuteScalar(dbComm)); } catch (Exception exc) { throw exc; } return(newsID); }
public static int AddNewEmailCounseling(string korName, string engFName, string engLName, string birthday, string korZip, string korAddress, string korAddress2, string address, string address2, string city, string state, string zip, string phone1, string phone2, string email, string sitePath, string counselingType, string counselingDesc) { DbCommand dbComm = BaseDB.CreateCommand(); DbParameter dbParam; dbComm.CommandText = "E_AddNewEmailCounseling"; dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@KorName"; dbParam.Value = korName; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@EngFName"; dbParam.Value = engFName; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@EngLName"; dbParam.Value = engLName; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Birthday"; dbParam.Value = birthday; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@KorZip"; dbParam.Value = korZip; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@KorAddress"; dbParam.Value = korAddress; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@KorAddress2"; dbParam.Value = korAddress2; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Address"; dbParam.Value = address; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Address2"; dbParam.Value = address2; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@City"; dbParam.Value = city; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@State"; dbParam.Value = state; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Zip"; dbParam.Value = zip; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Phone1"; dbParam.Value = phone1; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Phone2"; dbParam.Value = phone2; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Email"; dbParam.Value = email; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@SitePath"; dbParam.Value = sitePath; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@CounselingType"; dbParam.Value = counselingType; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@CounselingDesc"; dbParam.Value = counselingDesc; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); int contentID; try { contentID = int.Parse(BaseDB.ExecuteScalar(dbComm)); } catch (Exception exc) { throw exc; } return(contentID); }
public static int UpdateCase(int caseID, string caseTitle, string caseFileName, string caseSmallDesc, bool hidden, DateTime modified) { DbCommand dbComm = BaseDB.CreateCommand(); DbParameter dbParam; if (caseID == 0) { dbComm.CommandText = "E_AddNewCase"; } else { dbComm.CommandText = "E_UpdateCase"; dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@CaseID"; dbParam.Value = caseID; dbParam.DbType = DbType.Int32; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Modified"; dbParam.Value = modified; dbParam.DbType = DbType.DateTime; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); } dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@CaseTitle"; dbParam.Value = caseTitle; dbParam.Size = 125; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@CaseFileName"; dbParam.Value = caseFileName; dbParam.Size = 125; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@CaseSmallDesc"; dbParam.Value = caseSmallDesc; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Hidden"; dbParam.Value = hidden; dbParam.DbType = DbType.Boolean; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); try { caseID = int.Parse(BaseDB.ExecuteScalar(dbComm)); } catch (Exception exc) { throw exc; } return(caseID); }
public static int UpdateProgress(int progressID, string memberID, string title, string smallDesc, DateTime added) { DbCommand dbComm = BaseDB.CreateCommand(); DbParameter dbParam; if (progressID == 0) { dbComm.CommandText = "E_Admin_Progress_AddNewProgress"; dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@MemberID"; dbParam.Value = memberID; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); } else { dbComm.CommandText = "E_Admin_Progress_UpdateProgress"; dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@ProgressID"; dbParam.Value = progressID; dbParam.DbType = DbType.Int32; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); } dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Title"; dbParam.Value = title; dbParam.Size = 125; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@SmallDesc"; dbParam.Value = smallDesc; dbParam.DbType = DbType.String; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); dbParam = dbComm.CreateParameter(); dbParam.ParameterName = "@Added"; dbParam.Value = added; dbParam.DbType = DbType.DateTime; dbParam.Direction = ParameterDirection.Input; dbComm.Parameters.Add(dbParam); try { progressID = int.Parse(BaseDB.ExecuteScalar(dbComm)); } catch (Exception exc) { throw exc; } return(progressID); }