コード例 #1
0
ファイル: Suggestions.aspx.cs プロジェクト: usmanasif/pyramid
    protected void LoadUserSchoolsFilterItems(string userid)
    {
        ArrayList sSchools;

        sSchools = SchoolBLL.getSchoolsByUserId(userid);
        GridViewSchool.DataSource = sSchools;
        GridViewSchool.DataBind();
    }
コード例 #2
0
        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);
        }
コード例 #3
0
        /// <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"));
        }
コード例 #4
0
 protected void LoadDataListSchool()
 {
     DListSchool.DataSource = SchoolBLL.getSchoolTop5(Userid);
     DListSchool.DataBind();
     if (DListSchool.Items.Count <= 0)
     {
         lblSchool.Visible   = false;
         DListSchool.Visible = false;
     }
 }
コード例 #5
0
    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();
    }
コード例 #6
0
ファイル: Suggestions.aspx.cs プロジェクト: usmanasif/pyramid
    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();
    }
コード例 #7
0
ファイル: MyProfile.aspx.cs プロジェクト: usmanasif/pyramid
 protected void LoadDataListSchool()
 {
     DListSchool.DataSource = SchoolBLL.getSchoolTop5(Userid);
     DListSchool.DataBind();
 }
コード例 #8
0
ファイル: SchoolController.cs プロジェクト: vipsms/WeiXiu
 public SchoolController(SchoolBLL bll)
 {
     m_BLL = bll;
 }
コード例 #9
0
 protected void DListSchool_SelectedIndexChanged(object sender, EventArgs e)
 {
     SchoolBLL.deleteSchool(DListSchool.DataKeys[DListSchool.SelectedIndex].ToString());
     LoadDataListSchool();
 }