public void LoadEduLevelData() { EduLevelsRepository elir = new EduLevelsRepository(); Session["EduLevelData"] = elir.GetAllEduLevels(); GridView1.DataSource = Session["EduLevelData"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", elir.EduLevelCount().ToString().ToFarsiNumber(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["EduLevelData"] as DataTable).Rows.Count.ToString().ToFarsiNumber(), Resources.DashboardText.SelectRecordCount); }
public void loadform() { try { FacultiesRepositpry fair = new FacultiesRepositpry(); DataTable dt = fair.GetAllFaculties(); ddlfacultuy.Items.Clear(); foreach (DataRow dr in dt.Rows) { ddlfacultuy.Items.Add(new ListItem(dr["FacultyTitle"].ToString(), dr["FacultyID"].ToString())); } EduLevelsRepository leveir = new EduLevelsRepository(); DataTable dtlevel = leveir.GetAllEduLevels(); foreach (DataRow dr in dtlevel.Rows) { ddllevel.Items.Add(new ListItem(dr["LevelTitle"].ToString(), dr["LevelID"].ToString())); } EduFieldsRepository fieldir = new EduFieldsRepository(); DataTable dtfield = fieldir.GetAllEduFields(); foreach (DataRow dr in dtfield.Rows) { ddlfield.Items.Add(new ListItem(dr["FieldTitle"].ToString(), dr["FieldID"].ToString())); } VEduTendenciesRepository tenir = new VEduTendenciesRepository(); DataTable ten = tenir.GetAllTendency(); foreach (DataRow dr in ten.Rows) { ddltendency.Items.Add(new ListItem(dr["TendencyTitle"].ToString(), dr["TendencyID"].ToString())); } } catch { Redirector.Goto(Redirector.PageName.errorpage); } }
public DataTable GetEduLevel(string username, string password) { WebServiceAccountsRepository webir = new WebServiceAccountsRepository(); WebServiceAccount currentuser = webir.FindByUserName(username); if (currentuser != null) { if (currentuser.Password == password) { EduLevelsRepository depir = new EduLevelsRepository(); return(depir.GetAllEduLevels()); } else { return(null); } } else { return(null); } }
public void loadform(string stdi) { //try //{ FacultiesRepositpry fair = new FacultiesRepositpry(); DataTable dt = fair.GetAllFaculties(); ddlfacultuy.Items.Clear(); foreach (DataRow dr in dt.Rows) { ddlfacultuy.Items.Add(new ListItem(dr["FacultyTitle"].ToString(), dr["FacultyID"].ToString())); } EduLevelsRepository leveir = new EduLevelsRepository(); DataTable dtlevel = leveir.GetAllEduLevels(); foreach (DataRow dr in dtlevel.Rows) { ddllevel.Items.Add(new ListItem(dr["LevelTitle"].ToString(), dr["LevelID"].ToString())); } EduFieldsRepository fieldir = new EduFieldsRepository(); DataTable dtfield = fieldir.GetAllEduFields(); foreach (DataRow dr in dtfield.Rows) { ddlfield.Items.Add(new ListItem(dr["FieldTitle"].ToString(), dr["FieldID"].ToString())); } VEduTendenciesRepository tenir = new VEduTendenciesRepository(); DataTable ten = tenir.GetAllTendency(); foreach (DataRow dr in ten.Rows) { ddltendency.Items.Add(new ListItem(dr["TendencyTitle"].ToString(), dr["TendencyID"].ToString())); } VStudentsRepository vstir = new VStudentsRepository(); VStudent std = vstir.FindByid(stdi.ToInt()); if (std != null) { lblstdid.Text = std.StudentID.ToString(); txtstdcode.Text = std.StudentCode; txtname.Text = std.FirstName; txtlastname.Text = std.LastName; RadioButtonList1.SelectedValue = std.Gender.ToString(); txtnationalcode.Text = std.NationalCode; lblfaculty.Text = std.FacultyTitle; lbllevel.Text = std.LevelTitle; lblfield.Text = std.FieldTitle; lbltend.Text = std.TendencyTitle; RadioButtonList2.SelectedValue = std.EntryTerm.ToString(); lblusername.Text = std.Username; if (txtpass.Text != null) { txtpass.Text = std.Password; } // ImageButton1.ImageUrl = std.ImageFileName; Session["newfacultyid"] = std.FacultyID.ToString(); Session["newlevelid"] = std.LevelID.ToString(); Session["newfieldid"] = std.FieldID.ToString(); Session["newtenid"] = std.TendencyID.ToString(); Session["pass"] = std.Password; chkActiveAccount.Checked = (std.Status.Value == 0 ? true : false); Session["imageurl"] = std.ImageFileName; if (Session["imageurl"].ToString() != null) { ImageButton2.ImageUrl = "~/file/" + std.ImageFileName; } } else { Redirector.Goto(Redirector.PageName.errorpage); } //} //catch //{ // Redirector.Goto(Redirector.PageName.errorpage); //} }