protected void LoadUserSchoolsFilterItems(string userid) { ArrayList sSchools; sSchools = SchoolBLL.getSchoolsByUserId(userid); GridViewSchool.DataSource = sSchools; GridViewSchool.DataBind(); }
static void Main(string[] args) { int menu = 0; do { Console.Clear(); Console.WriteLine("MENU: \n\n"); Console.WriteLine("1. Save Student in DB"); Console.WriteLine("2. Simple Querying"); Console.WriteLine("3. Update Data"); Console.WriteLine("4. Delete Data"); Console.WriteLine("5. Updating Data on Disconnected Scenario"); Console.WriteLine("6. ChangeTracker"); Console.WriteLine("7. Exit\n"); menu = int.Parse(Console.ReadLine()); Console.WriteLine("\n"); switch (menu) { case 1: SchoolBLL.SaveGradeDB(); SchoolBLL.SaveStudentDB(); Console.ReadLine(); break; case 2: SchoolBLL.SimpleQuerying(); Console.ReadLine(); break; case 3: SchoolBLL.UpdatingData(); Console.ReadLine(); break; case 4: SchoolBLL.DeletingData(); Console.ReadLine(); break; case 5: SchoolBLL.UpdatingOnDisconnectedScenario(); Console.ReadLine(); break; case 6: SchoolBLL.ChangeTracker(); Console.ReadLine(); break; } } while (menu != 7); }
/// <summary> /// 获取字段,首选默认 /// </summary> /// <returns></returns> public static SelectList GetSysField() { Account account = AccountModel.GetCurrentAccount(); string biaoshi = account.BiaoShi; ISchoolBLL baseDDL = new SchoolBLL(); var ar = baseDDL.GetByBiaoShi(biaoshi); return(new SelectList(baseDDL.GetByBiaoShi(biaoshi), "Name", "Name")); }
protected void LoadDataListSchool() { DListSchool.DataSource = SchoolBLL.getSchoolTop5(Userid); DListSchool.DataBind(); if (DListSchool.Items.Count <= 0) { lblSchool.Visible = false; DListSchool.Visible = false; } }
protected void SaveSchool() { SchoolBO objSchool = new SchoolBO(); objSchool.UserId = Userid; objSchool.Name = txtSchool.Text; objSchool.Description = txtSchoolDescription.Text; if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtSchool.Text + ".jpg"))) { objSchool.Image = txtSchool.Text + ".jpg"; } else if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtSchool.Text + ".png"))) { objSchool.Image = txtSchool.Text + ".png"; } else { objSchool.Image = "DefaultSchool.png"; } SchoolBLL.insertSchool(objSchool); LoadDataListUniversity(); }
protected void GetSuggestionsByCriteria() { string HomeTownValue = HomeTownTextBox.Text; string EmployerValue = EmployerTextBox.Text; string UniversityValue = EducationTextBox.Text; string LocationValue = LocationTextBox.Text; string SchoolValue = SchoolTextBox.Text; bool hometownmatches = false; bool employermatches = false; bool unimatches = false; bool locationmatches = false; bool schoolmatches = false; bool mutualfriendmatches = false; List <UserFriendsBO> filteredlist = new List <UserFriendsBO>(); List <UserFriendsBO> list = new List <UserFriendsBO>(); list = FriendsBLL.getAllSuggestions(Userid); List <UserFriendsBO> scoredlist = FriendsBLL.RecommendationScoring(list, Userid); foreach (UserFriendsBO Useritem in scoredlist) { ArrayList uEmployers = new ArrayList(); ArrayList uUniversity = new ArrayList(); ArrayList uSchool = new ArrayList(); ArrayList sEmployers = new ArrayList(); ArrayList sUniversity = new ArrayList(); ArrayList sSchool = new ArrayList(); ArrayList uMF = new ArrayList(); hometownmatches = false; employermatches = false; unimatches = false; locationmatches = false; schoolmatches = false; mutualfriendmatches = false; sEmployers = EmployerBLL.getEmployersByUserId(Useritem.FriendUserId); sUniversity = UniversityDAL.getUnisByUserId(Useritem.FriendUserId); sSchool = SchoolBLL.getSchoolsByUserId(Useritem.FriendUserId); if (HomeTownValue.Equals(""))//if no value specified by user by default true { hometownmatches = true; } else { if (Useritem.Hometown != null) { hometownmatches = Useritem.Hometown.Equals(HomeTownValue); } } bool mfchecked = false; for (int i = 0; i < GridViewMutualFriends.Rows.Count; i++) { GridViewRow row = GridViewMutualFriends.Rows[i]; // 0 means the first column if your Select column is not first write it 's correct index CheckBox chk = row.Cells[0].FindControl("CheckBox1") as CheckBox; if (chk != null && chk.Checked) { mfchecked = true; Label lbl = (Label)GridViewMutualFriends.Rows[i].Cells[0].FindControl("Label1"); string value = lbl.Text; uMF.Add(value); //ListViewBLL.UpdateFriendListSearch(value, list); } } foreach (string umf in uMF) { if (Useritem.MutualFriendName.Equals(umf)) { mutualfriendmatches = true; } } //} if (mfchecked == false) { mutualfriendmatches = true; } bool empchecked = false; for (int i = 0; i < GridViewEmps.Rows.Count; i++) { GridViewRow row = GridViewEmps.Rows[i]; CheckBox chk = row.Cells[0].FindControl("CheckBox1") as CheckBox; if (chk != null && chk.Checked) { empchecked = true; Label lbl = (Label)GridViewEmps.Rows[i].Cells[0].FindControl("Label1"); string value = lbl.Text; uEmployers.Add(value); } } foreach (string semp in sEmployers) { foreach (string uemp in uEmployers) { if (semp.Equals(uemp)) { employermatches = true; } } } //} if (empchecked == false) { if (EmployerValue.Equals("")) { employermatches = true; } else { foreach (string semp in sEmployers) { if (semp.Equals(EmployerValue)) { employermatches = true; } } } } bool unichecked = false; for (int i = 0; i < GridViewUnis.Rows.Count; i++) { GridViewRow row = GridViewUnis.Rows[i]; // 0 means the first column if your Select column is not first write it 's correct index CheckBox chk = row.Cells[0].FindControl("CheckBox1") as CheckBox; if (chk != null && chk.Checked) { unichecked = true; Label lbl = (Label)GridViewUnis.Rows[i].Cells[0].FindControl("Label1"); string value = lbl.Text; uUniversity.Add(value); //ListViewBLL.UpdateFriendListSearch(value, list); } } foreach (string suni in sUniversity) { foreach (string uuni in uUniversity) { if (suni.Equals(uuni)) { unimatches = true; } } } //} if (unichecked == false) { if (UniversityValue.Equals("")) { unimatches = true; } else { foreach (string sUni in sUniversity) { if (sUni.Equals(UniversityValue)) { unimatches = true; } } } } bool schoolchecked = false; for (int i = 0; i < GridViewSchool.Rows.Count; i++) { GridViewRow row = GridViewSchool.Rows[i]; // 0 means the first column if your Select column is not first write it 's correct index CheckBox chk = row.Cells[0].FindControl("CheckBox1") as CheckBox; if (chk != null && chk.Checked) { schoolchecked = true; Label lbl = (Label)GridViewSchool.Rows[i].Cells[0].FindControl("Label1"); string value = lbl.Text; uSchool.Add(value); //ListViewBLL.UpdateFriendListSearch(value, list); } } foreach (string sschool in sSchool) { foreach (string uschool in uSchool) { if (sschool.Equals(uSchool)) { schoolmatches = true; } } } //} if (schoolchecked == false) { if (SchoolValue.Equals("")) { schoolmatches = true; } else { foreach (string sschool in sSchool) { if (sschool.Equals(SchoolValue)) { schoolmatches = true; } } } } if (LocationValue.Equals("")) { locationmatches = true; } else { if (Useritem.Location != null) { locationmatches = Useritem.Location.Equals(LocationValue); } } if (hometownmatches && employermatches && unimatches && locationmatches && schoolmatches && mutualfriendmatches) { filteredlist.Add(Useritem); } } GridViewFriendsList.DataSource = null; GridViewFriendsList.DataBind(); if (!MutualFriendsFetched) { //get the top 2 mutual friends for filter options//only for the first time foreach (UserFriendsBO uitem in filteredlist) { if (uitem.MutualFriendsCount > 0) { if (!mutualFriends.Contains(uitem.MutualFriendName)) { mutualFriends.Add(uitem.MutualFriendName); } } } MutualFriendsFetched = true; } GridViewFriendsList.DataSource = filteredlist; GridViewFriendsList.DataBind(); }
protected void LoadDataListSchool() { DListSchool.DataSource = SchoolBLL.getSchoolTop5(Userid); DListSchool.DataBind(); }
public SchoolController(SchoolBLL bll) { m_BLL = bll; }
protected void DListSchool_SelectedIndexChanged(object sender, EventArgs e) { SchoolBLL.deleteSchool(DListSchool.DataKeys[DListSchool.SelectedIndex].ToString()); LoadDataListSchool(); }