Ejemplo n.º 1
0
    public void BindCompanyHistory(bool needRebind, int itemsToShow)
    {
        int itemstoDisplay = Convert.ToInt32(Gen_GeneralUseValueList.GetGen_GeneralUseValueList("DefaultListToShow")[0].Value);

        CompanyHistoryList companyHistryList = CompanyHistoryList.GetCompanyHistoryList(jury.Id);

        if (itemsToShow > itemstoDisplay)
        {
            radCompanyList.DataSource = companyHistryList.Take(itemsToShow);
        }
        else
        {
            radCompanyList.DataSource = companyHistryList.Take(itemstoDisplay);
        }

        if (needRebind)
        {
            radCompanyList.Rebind();
        }



        lnkSHowMore.Visible = companyHistryList.Count > itemstoDisplay && companyHistryList.Count > itemsToShow;
        lnkSHowLess.Visible = radCompanyList.Items.Count > itemstoDisplay;
    }
Ejemplo n.º 2
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        JuryList JuryLists = JuryList.GetJuryList("", "");

        foreach (Jury jury in JuryLists)
        {
            List <CompanyHistory> companies = CompanyHistoryList.GetCompanyHistoryList(jury.Id).OrderByDescending(x => x.DateCreated).ToList();
            if (companies.Count > 0)
            { //EDIT HERE
                int            count = 1;
                CompanyHistory CurrCompanyHistory = null;
                //EDIT DATE CREATED
                foreach (CompanyHistory com in companies)
                {
                    if (count == 1)
                    {
                        //NEW COMPANY HISTORY
                        CompanyHistory compnyHistroy = CompanyHistory.NewCompanyHistory();
                        SaveCompanyHistory(jury, compnyHistroy, com.DateCreatedString);
                    }
                    else
                    {
                        SaveCompanyHistory(jury, CurrCompanyHistory, com.DateCreatedString);
                    }

                    if (count != companies.Count || companies.Count == 1)
                    {
                        CurrCompanyHistory = com;
                    }

                    count++;
                }

                //FOR LATEST COMPANY HISTORY
                SaveCompanyHistory(jury, CurrCompanyHistory, jury.DateCreatedString);
            }
            else
            {   //NEW COMPANY HISTORY
                CompanyHistory compnyHistroy = CompanyHistory.NewCompanyHistory();
                SaveCompanyHistory(jury, compnyHistroy, "Empty");
            }
        }
    }