public ExtendedCollection<ExamCategory> GetECList() { ExtendedCollection<ExamCategory> list = new ExtendedCollection<ExamCategory>(); IDataReader dr = GetData; while (dr.Read()) { ExamCategory item = new ExamCategory(); if (dr["ECName"] != DBNull.Value) { item.ExamName = (string)dr["ECName"]; } if (dr["ECDesc"] != DBNull.Value) { item.ExamDescription = (string)dr["ECDesc"]; } if (dr["ECID"] != DBNull.Value) { item.ECID = (byte)dr["ECID"]; } if (dr["isActive"] != DBNull.Value) { item.isActive = (byte)dr["isActive"]; } list.Add(item); } dr.Close(); return list; }
public override int Add(ExamCategory ec) { string name = ec.ExamName; string desc = ec.ExamDescription; int id = ec.ECID; int isValid = ec.isActive; return Blogic.AddNewExamCategory(name, desc, id, isValid); }
protected void Page_Load(object sender, EventArgs e) { Master.PAGEID = 1; Page.Header.DataBind(); if (!Page.IsPostBack) { /*Countries Drop Down List Generation*/ CountryRepository CntryList = new CountryRepository(); ExtendedCollection<Country> LC = CntryList.GetCountryList(); Country[] Countries = new Country[LC.Count]; LC.CopyTo(Countries, 0); for (int i = 0; i < Countries.GetLength(0); i++) { Cntry.Items.Add(Countries[i].Name); } /*State List - Sample Code*/ StateRepository StateList = new StateRepository(); ExtendedCollection<State> LS = StateList.GetStateList(97); /*City List - Sample Code*/ CityRepository CityList = new CityRepository(); ExtendedCollection<City> LCity = CityList.GetCityList(8); /*ExamCategory Repeater Bind */ ExamCategoryRepository ECList = new ExamCategoryRepository(); ExtendedCollection<ExamCategory> EC = ECList.GetECList(); ExamCategory[] ECs = new ExamCategory[EC.Count]; EC.CopyTo(ECs, 0); for (int i = 0; i < ECs.GetLength(0); i++) { ExamCategoryList.Items.Add(new ListItem(ECs[i].ExamName.ToString(), ECs[i].ECID.ToString())); } } HideFormIfLogin.Visible = true; if (Page.IsPostBack) { securecode = HttpContext.Current.Session["randomstruserreg"].ToString(); } //Check whether user is login, if login, hide the registration form. //We don't want to allow users who are logon to register. //if they want to regsiter a new a count, they must logout first. if (Authentication.IsUserAuthenticated) { HideFormIfLogin.Visible = false; lblWarningMessage.Visible = true; lblWarningMessage.Text = "Sorry! You cannot register a new account when you are logon.<br>If you want to register for a new account, you must logout first."; } }
public virtual int Update(ExamCategory ec) { return 0; }
public virtual int ShortAdd(ExamCategory ec) { return 0; }
public virtual int QuickAdd(ExamCategory ec) { return 0; }
public virtual int Deactivate(ExamCategory ec) { return 0; }