Exemple #1
0
    protected void LoadForm()
    {
        if (forgetPasswordVisible)
        {
            lnkForgetPass.Visible     = true;
            lnkForgetPass.NavigateUrl = forgetPasswordRedirection;
        }

        if (Request.Cookies["wdduw2013JuryLogin"] != null)
        {
            try
            {
                EffieJuryManagementApp.Jury jury = EffieJuryManagementApp.Jury.GetJury(GeneralFunction.GetValueGuid(Request.Cookies["wdduw2013JuryLogin"].Value, true));

                if (jury.IsActive)
                {
                    Security.SetLoginSessionJury(jury);

                    Response.Redirect(loginSuccessRedirection);
                }
            }
            catch
            {
                if (Request.Cookies["wdduw2013JuryLogin"] != null)
                {
                    Response.Cookies["wdduw2013JuryLogin"].Expires = DateTime.Now.AddMinutes(-1);
                }
            }
        }
    }
Exemple #2
0
    protected void radGridTemplateHistory_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            EffieJuryManagementApp.EmailSent emailsent = (EffieJuryManagementApp.EmailSent)e.Item.DataItem;

            if (emailsent != null)
            {
                EffieJuryManagementApp.Jury jury = EffieJuryManagementApp.Jury.GetJury(emailsent.JuryId);

                if (jury != null)
                {
                    Label lblType = (Label)e.Item.FindControl("lblType");
                    lblType.Text = jury.Type;

                    LinkButton lnkBtnJuryId = (LinkButton)e.Item.FindControl("lnkBtnJuryId");
                    lnkBtnJuryId.Text            = jury.SerialNo;
                    lnkBtnJuryId.CommandArgument = jury.Id.ToString();

                    HyperLink lnk = (HyperLink)e.Item.FindControl("lnkJuryName");
                    lnk.Text        = jury.FirstName + " " + jury.LastName;
                    lnk.NavigateUrl = "mailto:" + jury.Email;
                }

                Label lblEmailTemplate = (Label)e.Item.FindControl("lblEmailTemplate");
                lblEmailTemplate.Text = emailsent.TemplateName;
            }
        }
    }
Exemple #3
0
 protected bool isJuryInvited(EffieJuryManagementApp.Jury jury, string Year)
 {
     EffieJuryManagementApp.InvitationList invitations = EffieJuryManagementApp.InvitationList.GetInvitationList(jury.Id, Year);
     if (invitations.Any())
     {
         return(true);
     }
     return(false);
 }
Exemple #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        jury  = EffieJuryManagementApp.Jury.GetJury(new Guid(Request.QueryString["juryId"]));
        round = Request.QueryString["r"];

        if (!IsPostBack)
        {
            LoadForm();
            PopulateForm();
        }
    }
Exemple #5
0
    protected void LoadForm()
    {
        EffieJuryManagementApp.Jury jury = Security.GetLoginSessionJury();
        if (jury != null)
        {
            lblJuryName.Text = jury.FirstName + " " + jury.LastName;


            //if (registration.LastSignIn.ToString("yyyyMMdd") != "99991231")
            //    lblSign.Text = registration.LastSignIn.ToString("dd MMM yyyy hh:mm tt");
        }
    }
Exemple #6
0
    protected void radGridEntry_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "Score")
        {
            try
            {
                Score score = Score.GetScore(new Guid(e.CommandArgument.ToString()));
                EffieJuryManagementApp.Jury jury = EffieJuryManagementApp.Jury.GetJury(score.Juryid);

                GeneralFunction.SetRedirect("../Admin/JuryScoreList.aspx?r=" + round + "&juryId=" + jury.Id.ToString());  // to return from whereever
                Security.SetLoginSessionJury(jury);
                Response.Redirect("../Jury/EntryScore.aspx?eId=" + score.EntryId.ToString() + "&r=" + round + "&a=1");
            }
            catch { }
        }
    }
Exemple #7
0
    protected void radGridJury_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            EffieJuryManagementApp.Jury jury = (EffieJuryManagementApp.Jury)e.Item.DataItem;

            LinkButton lnkBtn = null;
            Label      lbl    = null;
            HyperLink  lnk    = null;

            // Jury Name
            lnkBtn                 = (LinkButton)e.Item.FindControl("btnJuryName");
            lnkBtn.Text            = jury.FirstName + " " + jury.LastName;
            lnkBtn.CommandArgument = jury.Id.ToString();
        }
    }
Exemple #8
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (!chkOK.Checked)
        {
            lbError.Text = "Please tick the checkbox before proceeding.";
            return;
        }

        // update jury
        EffieJuryManagementApp.Jury jury = Security.GetLoginSessionJury();
        if (jury != null)
        {
            jury.IsFirstTimeLogin = false;
            jury.Save();

            Response.Redirect("Dashboard.aspx");
        }
    }
Exemple #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //GeneralFunction.WriteTxtFile("F:\\www\\Effie2018.Web\\storage\\llog\\test.txt", "start:" + DateTime.Now.ToString());
        jury = Security.GetLoginSessionJury();
        //round = ConfigurationManager.AppSettings["CurrentJuryRound"]; // "1"; // hardcoded to round 1 for now   Request.QueryString["r"];
        round = GeneralFunction.GetSystemData().ActiveRound;

        if (!IsPostBack)
        {
            // Enable this for Round 1 Jury
            if (jury.IsFirstTimeLogin)
            {
                Response.Redirect("../Jury/JuryTC.aspx");
            }

            LoadForm();
            PopulateForm();
        }
        //GeneralFunction.WriteTxtFile("F:\\www\\Effie2018.Web\\storage\\llog\\test.txt", "end:" + DateTime.Now.ToString());
    }
Exemple #10
0
    public void GenerateEmails(Guid templateId)
    {
        string evetnYear = string.Empty;

        try
        {
            evetnYear = Gen_GeneralUseValueList.GetGen_GeneralUseValueList("EventCode")[0].Value;
        }
        catch { }

        lblError.Text = string.Empty;
        int counter = 0;

        foreach (GridDataItem item in radGridEntry.Items)
        {
            CheckBox    chkbox = (CheckBox)item.FindControl("chkboxSelect");
            HiddenField hdfId  = (HiddenField)item.FindControl("hdfId");

            if (chkbox.Checked)
            {
                EffieJuryManagementApp.Jury jury = EffieJuryManagementApp.Jury.GetJury(new Guid(hdfId.Value.ToString()));
                Email.SendTemplateEmailJury(jury, templateId);
                GeneralFunction.SaveEmailSentLogJury(jury, templateId, evetnYear);

                chkbox.Checked = false;
                counter++;
            }
        }

        if (counter == 0)
        {
            lblError.Text = "Please select at least one jury to send email.<br/>";
        }
        else
        {
            phSelectTemplate.Visible = false;
            lblError.Text            = "Email sent to " + (counter).ToString() + " Jury(s).<br/>";
        }
    }
Exemple #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["eId"] != null && Request.QueryString["eId"] != "")
        {
            entry = Entry.GetEntry(new Guid(Request.QueryString["eId"]));
        }
        else
        {
            Response.Redirect("../Jury/Dashboard.aspx");
        }


        if (Request.QueryString["a"] != null && Request.QueryString["a"] != "")
        {
            isAdminSpoof = true;
        }
        else
        {
            isAdminSpoof = false;
        }

        GeneralFunction.GetAllEntryCache(true); // refresh entry cache
        jury  = Security.GetLoginSessionJury();
        round = Request.QueryString["r"];
        //score = GeneralFunction.GetScoreFromMatchingEntryCache(entry, jury.Id);


        if (!IsPostBack)
        {
            LoadForm();
            PopulateForm();
        }

        Page.ClientScript.RegisterStartupScript(this.GetType(), "OnChangeddlRecom" +
                                                DateTime.Now.ToString(), "OnChangeddlRecom('" + AdvancementFlag.ClientID + "','" + ddlRecommendation.ClientID + "', '" + round + "');", true);
    }
Exemple #12
0
    protected void btnExport_Click(object sender, EventArgs e)
    {
        object data = GeneralFunction.GetReportDataCache();

        if (data != null)
        {
            List <Score> flist = (List <Score>)data;

            XLWorkbook   workbook     = new XLWorkbook();
            MemoryStream memoryStream = new MemoryStream();
            int          x            = 1;
            int          y            = 1;
            string       sheetName    = "Flag Report";
            workbook.Worksheets.Add(sheetName);
            x = 1;


            #region Basic Entry Headers
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("No."); x++;


            // basic details
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("EntryId"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Category"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Title"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Client"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Entrant"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Country"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Panel"); x++;


            #endregion


            #region Jury Headers

            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("JuryId"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Jury Name"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Title"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Company"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Network"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Holding Company"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Country"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Jury Flag"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Flag Reason"); x++;
            workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue("Date"); x++;

            #endregion

            y++;
            flist = flist.OrderByDescending(p => p.DateSubmitted).ToList();
            foreach (Score score in flist)
            {
                x = 1;
                Entry entry = GeneralFunction.GetEntryFromIDCache(score.EntryId);
                EffieJuryManagementApp.Jury jury    = GeneralFunction.GetJuryFromIDCache(score.Juryid, round);
                List <JuryPanelCategory>    jcpList = GeneralFunction.GetJuryPanelCategoryFromCategoryPS(entry.CategoryMarketFromRound(round), entry.CategoryPSFromRound(round), entry.CategoryPSDetailFromRound(round), round);

                #region Basic Entry DataRows

                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue((y - 1).ToString()); x++;

                // Basic Details
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(entry.Serial); x++;
                //workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(GeneralFunction.GetEntryMarket(entry.CategoryMarketFromRound(round)) + " - " + entry.CategoryPSDetailFromRound(round)); x++;
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(entry.CategoryPSDetailFromRound(round)); x++;
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(entry.Campaign); x++;
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(entry.Client); x++;

                Registration reg = GeneralFunction.GetRegistrationFromEntry(entry);
                if (reg != null)
                {
                    workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(reg.Company); x++;
                    workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(reg.Country); x++;

                    string panel = "";
                    if (jcpList.Count > 0)
                    {
                        panel = jcpList[0].PanelId;
                    }
                    workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(panel); x++;
                }
                else
                {
                    x = x + 3;
                }


                // jury
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(jury.SerialNo); x++;
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(jury.FirstName + " " + jury.LastName); x++;
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(jury.Designation); x++;
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(jury.Company); x++;

                string network = jury.Network;
                if (jury.NetworkOthers != "")
                {
                    network += " - " + jury.NetworkOthers;
                }
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(network); x++;
                string holdingcompany = jury.HoldingCompany;
                if (jury.HoldingCompanyOthers != "")
                {
                    holdingcompany += " - " + jury.HoldingCompanyOthers;
                }
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(holdingcompany); x++;

                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(jury.Country); x++;


                // flag and remarks
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(score.IsRecuse ? "Jury Recusal" : score.Flag); x++;

                //string recuse = "No";
                //if (score.IsAdminRecuse) recuse = "Yes";
                //workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(recuse); x++;
                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(score.IsRecuse ? score.RecuseRemarks : score.FlagOthers); x++;

                string DateSubmitted = "";
                if (score.DateSubmitted != DateTime.MinValue)
                {
                    DateSubmitted = score.DateSubmitted.ToString("dd MMM yyyy");
                }

                workbook.Worksheets.Worksheet(sheetName).Cell(y, x).SetValue(DateSubmitted); x++;

                #endregion

                y++;
            }



            workbook.SaveAs(memoryStream);

            Response.Clear();
            Response.ContentType = "application/vnd.ms-excel";
            Response.AddHeader("content-disposition", "attachment;filename=Effie_Flag_Report.xlsx");

            memoryStream.WriteTo(Response.OutputStream);
            Response.End();
        }
    }
Exemple #13
0
    private void BindGrid(bool isCustomSort, string sortExpression, GridSortOrder order, bool needRebind)
    {
        ScoreList list = GeneralFunction.GetAllScoreCache(needRebind);

        // filter only flagged, not recused, submitted
        List <Score> slist = new List <Score>();

        foreach (Score score in list)
        {
            /* Commented because have to show recused entries also */

            //if (score.Flag != "" && score.IsSubmitted && !score.IsAdminRecuse && !score.IsRecuse && score.Round == round)
            //    slist.Add(score);

            if (((score.Flag != "" && score.IsSubmitted) || (score.IsRecuse)) && score.Round == round)
            {
                slist.Add(score);
            }
        }

        // filter
        string status        = (string)ViewState["TabFilterValue"];
        string advanceSearch = (string)ViewState["AdvanceSearch"];

        List <Score> flist = new List <Score>();

        if (advanceSearch == "1")
        {
            // Advanced search
            // basic fields
            // user's country

            List <Guid> entryIdList  = GeneralFunction.GetFilteredEntryListFromRegCountry(ddlCountry.SelectedValue, true);
            List <Guid> entryIdList2 = GeneralFunction.GetFilteredScoreListFromRegCompany(txtSearch.Text.Trim(), true);

            // juryname
            List <Guid> entryIdList4 = GeneralFunction.GetFilteredScoreListFromJuryAssignment(txtSearch.Text.Trim(), "", "", round, true);

            // juryid
            List <Guid> entryIdList5 = GeneralFunction.GetFilteredScoreListFromJuryAssignment("", txtSearch.Text.Trim(), "", round, true);

            // jurycompany
            List <Guid> entryIdList6 = GeneralFunction.GetFilteredScoreListFromJuryAssignment("", "", txtSearch.Text.Trim(), round, true);



            foreach (Score item in slist)
            {
                // category strip out the prefix
                string category = ddlCategory.SelectedValue;
                if (category.Length > 3)
                {
                    category = category.Substring(3, category.Length - 3);
                }

                // Jury who scored
                EffieJuryManagementApp.Jury jury = GeneralFunction.GetJuryFromIDCache(item.Juryid, round);

                // Entry
                Entry entry = GeneralFunction.GetEntryFromIDCache(item.EntryId);

                if (
                    (ddlNetwork.SelectedValue == "" || (ddlNetwork.SelectedValue != "" && jury.Network == ddlNetwork.SelectedValue)) &&
                    (ddlHoldingCompany.SelectedValue == "" || (ddlHoldingCompany.SelectedValue != "" && jury.HoldingCompany == ddlHoldingCompany.SelectedValue)) &&

                    (ddlMarket.SelectedValue == "" || (ddlMarket.SelectedValue != "" && entry.CategoryMarket == ddlMarket.SelectedValue)) &&
                    (category == "" || (category != "" && (entry.CategoryPSDetailFromRound(round) == category || GeneralFunction.IsCategoryInCategoryGroup(category, entry.CategoryPSDetailFromRound(round))))) &&
                    (ddlCountry.SelectedValue == "" || (ddlCountry.SelectedValue != "" && entryIdList.Contains(entry.Id))) &&
                    (
                        (ddlJuryFlag.SelectedValue == "" || (ddlJuryFlag.SelectedValue != "" && item.Flag == ddlJuryFlag.SelectedValue)) ||
                        (ddlJuryFlag.SelectedValue == "JuryRecusal" && item.IsRecuse)
                    ) &&
                    (ddlRecuse.SelectedValue == "" || (ddlRecuse.SelectedValue != "" && (item.IsAdminRecuse.ToString() == ddlRecuse.SelectedValue || item.IsRecuse.ToString() == ddlRecuse.SelectedValue))) &&

                    (
                        (txtSearch.Text.Trim() == "" || (txtSearch.Text.Trim() != "" && (ddlSearch.SelectedValue == "" || ddlSearch.SelectedValue == "entryId") && entry.Serial.ToUpper().IndexOf(txtSearch.Text.Trim().ToUpper()) != -1)) ||
                        (txtSearch.Text.Trim() == "" || (txtSearch.Text.Trim() != "" && (ddlSearch.SelectedValue == "" || ddlSearch.SelectedValue == "title") && entry.Campaign.ToUpper().IndexOf(txtSearch.Text.Trim().ToUpper()) != -1)) ||
                        (txtSearch.Text.Trim() == "" || (txtSearch.Text.Trim() != "" && (ddlSearch.SelectedValue == "" || ddlSearch.SelectedValue == "entrant") && entryIdList2.Contains(item.Id))) ||
                        (txtSearch.Text.Trim() == "" || (txtSearch.Text.Trim() != "" && (ddlSearch.SelectedValue == "" || ddlSearch.SelectedValue == "juryname") && entryIdList4.Contains(item.Id))) ||
                        (txtSearch.Text.Trim() == "" || (txtSearch.Text.Trim() != "" && (ddlSearch.SelectedValue == "" || ddlSearch.SelectedValue == "juryId") && entryIdList5.Contains(item.Id))) ||
                        (txtSearch.Text.Trim() == "" || (txtSearch.Text.Trim() != "" && (ddlSearch.SelectedValue == "" || ddlSearch.SelectedValue == "jurycompany") && entryIdList6.Contains(item.Id)))

                    )
                    )
                {
                    flist.Add(item);
                }
            }
        }
        else
        {
            // tab filtering
            //if (status == "WDN")
            //{
            //    foreach (Entry item in list)
            //        if (item.WithdrawnStatus != "") flist.Add(item);
            //}
            //else
            //{
            //    foreach (Entry item in list)
            //        if (status == "" || (status != "" && item.Status == status)) flist.Add(item);
            //}
            flist = slist;
        }

        // Sort
        List <Entry> sortedEntries = GeneralFunction.GetAllEntryCache(false).ToList();
        var          result        = flist.Join(sortedEntries, score => score.EntryId, entry => entry.Id, (score, entry) => new { Score = score, Entry = entry }).OrderBy(x => x.Entry.Serial).Select(x => x.Score).ToList();

        #region CustomSorting

        if (isCustomSort)
        {
            List <Registration> regList = RegistrationList.GetRegistrationList(string.Empty, string.Empty, string.Empty).ToList();
            List <EffieJuryManagementApp.Jury> juryList = EffieJuryManagementApp.JuryList.GetJuryList(string.Empty, string.Empty).ToList();

            if (sortExpression.Equals("Serial"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.Serial select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.Serial descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("Country"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id join reg in regList on entry.RegistrationId equals reg.Id orderby reg.Country select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id join reg in regList on entry.RegistrationId equals reg.Id orderby reg.Country descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("Campaign"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.Campaign select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.Campaign descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("CategoryMarket"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.CategoryMarket select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.CategoryMarket descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("Client"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.Client select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.Client descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("Panel"))
            {
                List <Score>             sortedfList   = new List <Score>();
                List <Score>             filteredfList = new List <Score>();
                List <JuryPanelCategory> pnlCategory   = new List <JuryPanelCategory>();

                switch (order)
                {
                case GridSortOrder.Ascending:
                {
                    pnlCategory = JuryPanelCategoryList.GetJuryPanelCategoryList(string.Empty, string.Empty).OrderBy(m => m.PanelId).ToList();

                    foreach (JuryPanelCategory pnl in pnlCategory)
                    {
                        List <Entry> pnlEntries = GeneralFunction.GetEntryListFromCategory(pnl.CategoryPSDetail, round).OrderBy(m => m.CategoryPSDetail).ToList();

                        sortedfList.AddRange((from entry in pnlEntries
                                              join score in flist on entry.Id equals score.EntryId
                                              select score).ToList());
                    }

                    filteredfList.AddRange(sortedfList);

                    List <Score> preFilteredList = flist.Except(sortedfList).ToList();

                    preFilteredList = (from score in preFilteredList join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.CategoryPSDetail select score).ToList();

                    filteredfList.AddRange(preFilteredList);

                    break;
                }

                case GridSortOrder.Descending:
                {
                    pnlCategory = JuryPanelCategoryList.GetJuryPanelCategoryList(string.Empty, string.Empty).OrderByDescending(m => m.PanelId).ToList();

                    foreach (JuryPanelCategory pnl in pnlCategory)
                    {
                        List <Entry> pnlEntries = GeneralFunction.GetEntryListFromCategory(pnl.CategoryPSDetail, round).OrderByDescending(m => m.CategoryPSDetail).ToList();

                        sortedfList.AddRange((from entry in pnlEntries
                                              join mainentry in flist on entry.Id equals mainentry.Id
                                              select mainentry).ToList());
                    }

                    filteredfList.AddRange(sortedfList);

                    List <Score> preFilteredList = flist.Except(sortedfList).ToList();

                    preFilteredList = (from score in preFilteredList join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.CategoryPSDetail descending select score).ToList();

                    filteredfList.AddRange(preFilteredList);

                    break;
                }

                case GridSortOrder.None:
                {
                    pnlCategory = JuryPanelCategoryList.GetJuryPanelCategoryList(string.Empty, string.Empty).ToList();

                    foreach (JuryPanelCategory pnl in pnlCategory)
                    {
                        List <Entry> pnlEntries = GeneralFunction.GetEntryListFromCategory(pnl.CategoryPSDetail, round);

                        sortedfList.AddRange((from entry in pnlEntries
                                              join mainentry in flist on entry.Id equals mainentry.Id
                                              select mainentry).ToList());
                    }

                    filteredfList.AddRange(sortedfList);
                    filteredfList.AddRange(flist.Except(sortedfList).ToList());

                    break;
                }
                }

                flist = filteredfList;
            }
            else if (sortExpression.Equals("Entrant"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id join reg in regList on entry.RegistrationId equals reg.Id orderby reg.Company select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id join reg in regList on entry.RegistrationId equals reg.Id orderby reg.Company descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("Brand"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.Brand select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join entry in sortedEntries on score.EntryId equals entry.Id orderby entry.Brand descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("JuryID"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join jury in juryList on score.Juryid equals jury.Id orderby jury.SerialNo select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join jury in juryList on score.Juryid equals jury.Id orderby jury.SerialNo descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("JuryName"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join jury in juryList on score.Juryid equals jury.Id orderby jury.FirstName, jury.LastName select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join jury in juryList on score.Juryid equals jury.Id orderby jury.FirstName, jury.LastName descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("JuryTitle"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join jury in juryList on score.Juryid equals jury.Id orderby jury.Designation select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join jury in juryList on score.Juryid equals jury.Id orderby jury.Designation descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("JuryCompany"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join jury in juryList on score.Juryid equals jury.Id orderby jury.Company select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join jury in juryList on score.Juryid equals jury.Id orderby jury.Company descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("JuryCountry"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = (from score in flist join jury in juryList on score.Juryid equals jury.Id orderby jury.Country select score).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = (from score in flist join jury in juryList on score.Juryid equals jury.Id orderby jury.Country descending select score).ToList();
                    break;

                case GridSortOrder.None:
                    flist = (from score in flist select score).ToList();
                    break;
                }
            }
            else if (sortExpression.Equals("JuryFlag"))
            {
                switch (order)
                {
                case GridSortOrder.Ascending:
                    flist = flist.OrderBy(x => x.Flags).ToList();
                    break;

                case GridSortOrder.Descending:
                    flist = flist.OrderByDescending(x => x.Flags).ToList();
                    break;

                case GridSortOrder.None:
                    flist = flist.OrderBy(x => x.Flags).ToList();
                    break;
                }
            }
        }
        else
        {
            flist = (from score in flist select score).ToList();
        }

        #endregion


        radGridEntry.DataSource = flist;
        if (needRebind)
        {
            radGridEntry.Rebind();
        }

        GeneralFunction.SetReportDataCache(result);


        // hide show checkboxes for certain status
        //if (status == StatusEntry.UploadPending || status == StatusEntry.UploadCompleted)
        //{
        //    foreach (GridDataItem item in radGridEntry.Items)
        //    {
        //        CheckBox chkbox = (CheckBox)item.FindControl("chkbox");
        //        if (chkbox != null) chkbox.Visible = true;
        //        Security.SecureControlByHiding(chkbox);
        //    }
        //}
    }
Exemple #14
0
    public void GenerateInvitation(SendInvitationCriteria invCriteria, Guid templateId)
    {
        string evetnYear = string.Empty;

        try
        {
            evetnYear = Gen_GeneralUseValueList.GetGen_GeneralUseValueList("EventCode")[0].Value;
        }
        catch { }

        lblError.Text = string.Empty;
        int counter = 0;

        foreach (GridDataItem item in radGridEntry.Items)
        {
            CheckBox    chkbox = (CheckBox)item.FindControl("chkbox");
            HiddenField hdfId  = (HiddenField)item.FindControl("hdfId");

            if (chkbox.Checked)
            {
                EffieJuryManagementApp.Jury jury = EffieJuryManagementApp.Jury.GetJury(new Guid(hdfId.Value.ToString()));

                EffieJuryManagementApp.InvitationList invList = EffieJuryManagementApp.InvitationList.GetInvitationList(jury.Id, Gen_GeneralUseValueList.GetGen_GeneralUseValueList("EventCode")[0].Value);

                EffieJuryManagementApp.Invitation inv = null;

                if (invList.Count > 0)
                {
                    inv = invList[0];
                }
                else
                {
                    inv = EffieJuryManagementApp.Invitation.NewInvitation();
                }

                inv.EventCode = Gen_GeneralUseValueList.GetGen_GeneralUseValueList("EventCode")[0].Value.ToString();
                inv.JuryId    = jury.Id;

                if (invCriteria.isRound1)
                {
                    inv.IsRound1Invited           = true;
                    inv.DateRound1EmailSentString = DateTime.Now.ToString();
                }
                if (invCriteria.isRound2)
                {
                    inv.IsRound2Invited           = true;
                    inv.DateRound2EmailSentString = DateTime.Now.ToString();
                }

                if (inv.IsNew)
                {
                    inv.DateCreatedString = DateTime.Now.ToString();
                }

                inv.DateModifiedString = DateTime.Now.ToString();

                if (invCriteria.isSend)
                {
                    Email.SendInvitationTemplateEmail(inv, templateId);
                    GeneralFunction.SaveEmailSentLogJury(jury, templateId, evetnYear);
                }
                else
                {
                    inv.IsLocked = true;
                }

                if (inv.IsValid)
                {
                    inv.Save();
                }

                chkbox.Checked = false;
                counter++;
            }
        }

        if (counter == 0)
        {
            lblError.Text = "Please select at least one jury to send Invitation.<br/>";
        }
        else
        {
            if (invCriteria.isSend)
            {
                lblError.Text = "Email sent to " + (counter).ToString() + " Jury(s).<br/>";
            }
            else
            {
                lblError.Text = "Invitation added for " + (counter).ToString() + " Jury(s).<br/>";
            }
        }
    }
Exemple #15
0
    protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            EffieJuryManagementApp.Jury jury = (EffieJuryManagementApp.Jury)e.Item.DataItem;

            LinkButton lnkBtn = null;
            Label      lbl    = null;
            HyperLink  lnk    = null;

            // Jury Id
            lnkBtn                 = (LinkButton)e.Item.FindControl("lnkBtnJuryId");
            lnkBtn.Text            = jury.SerialNo;
            lnkBtn.CommandArgument = jury.Id.ToString();


            // Jury Name
            lnk             = (HyperLink)e.Item.FindControl("lnkJuryName");
            lnk.Text        = jury.FirstName + " " + jury.LastName;
            lnk.NavigateUrl = "mailto:" + jury.Email;


            // Round 1 Panel
            lbl = (Label)e.Item.FindControl("lbJuryPanelRound1");
            string round1PanelId = GeneralFunction.CleanDelimiterList(jury.Round1PanelId, '|', ", ");

            if (String.IsNullOrEmpty(round1PanelId))
            {
                lbl.Text = "-";
            }
            else
            {
                lbl.Text = round1PanelId;
            }


            //// Round 1
            //lbl = (Label)e.Item.FindControl("lbRound1");
            //lbl.Text = "N";
            //if (jury.Round1PanelId != "") lbl.Text = "Y";


            // Round 2 Panel
            lbl = (Label)e.Item.FindControl("lbJuryPanelRound2");
            string round2PanelId = GeneralFunction.CleanDelimiterList(jury.Round2PanelId, '|', ", ");

            if (String.IsNullOrEmpty(round2PanelId))
            {
                lbl.Text = "-";
            }
            else
            {
                lbl.Text = round2PanelId;
            }

            //// Round 2
            //lbl = (Label)e.Item.FindControl("lbRound2");
            //lbl.Text = "N";
            //if (jury.Round2PanelId != "") lbl.Text = "Y";


            // Categories R1
            lbl = (Label)e.Item.FindControl("lbCategory");
            List <JuryPanelCategory> jcplist = GeneralFunction.GetJuryPanelCategoryFromPanelId(jury.Round1PanelId, "1").Where(m => !String.IsNullOrEmpty(m.CategoryPSDetail)).ToList();
            if (!String.IsNullOrEmpty(round1PanelId))
            {
                foreach (JuryPanelCategory jcp in jcplist)
                {
                    string market       = jcp.CategoryPSDetail.Substring(0, 2);
                    string categoryname = jcp.CategoryPSDetail.Substring(3, jcp.CategoryPSDetail.Length - 3);
                    lbl.Text += Category.GetCategoryCode(market, categoryname) + "<br/>";// +parts[1] + "<br/>";
                }
            }

            // Categories R2
            lbl = (Label)e.Item.FindControl("lbCategory2");
            List <JuryPanelCategory> jcplist2 = GeneralFunction.GetJuryPanelCategoryFromPanelId(jury.Round2PanelId, "2").Where(m => !String.IsNullOrEmpty(m.CategoryPSDetail)).ToList();
            if (!String.IsNullOrEmpty(round2PanelId))
            {
                foreach (JuryPanelCategory jcp in jcplist2)
                {
                    string market       = jcp.CategoryPSDetail.Substring(0, 2);
                    string categoryname = jcp.CategoryPSDetail.Substring(3, jcp.CategoryPSDetail.Length - 3);
                    lbl.Text += Category.GetCategoryCode(market, categoryname) + "<br/>";// +parts[1] + "<br/>";
                }
            }


            // Scoring Completion
            // get all his scoring
            lbl = (Label)e.Item.FindControl("lbScoringCompletion");
            List <Score> scores  = GeneralFunction.GetScoreListFromJuryCache(jury.Id, round);
            List <Score> fscores = scores.Where(p => p.IsSubmitted && !p.IsAdminRecuse && !p.IsRecuse).ToList();
            //List<Score> ascores = GeneralFunction.FilterScoreListFromActivePanels(fscores, round);

            //List<Entry> fentries = GeneralFunction.GetEntryListValidFromJuryPanel(jury, round);
            //List<Entry> aentries = GeneralFunction.FilterEntryListFromActivePanels(fentries, round);

            //lbl.Text = fscores.Count.ToString() + " / " + fentries.Count.ToString();
            lbl.Text = fscores.Count.ToString() + " / " + GeneralFunction.GetEntryCountValidFromJury(jury, round.Equals("1") ? jcplist : jcplist2, scores, round).ToString();

            // Scoring Pending
            // get all his scoring
            lbl = (Label)e.Item.FindControl("lbScoringPending");
            //List<Score> scoresPending = GeneralFunction.GetScoreListFromJuryCache(jury.Id, round);
            //List<Score> fscoresPending = scores.Where(p => !p.IsSubmitted && !p.IsAdminRecuse && !p.IsRecuse).ToList();

            lbl.Text = GeneralFunction.GetPendingEntryCountValidFromJury(jury, round.Equals("1") ? jcplist : jcplist2, scores, round).ToString();



            // chkboxes
            CheckBox chkbox = (CheckBox)e.Item.FindControl("chkbox");
            Security.SecureControlByHiding(chkbox);


            lnk             = (HyperLink)e.Item.FindControl("hlkEmailHistory");
            lnk.CssClass    = "fancybox fancybox.iframe tblLinkRed";
            lnk.NavigateUrl = "./JuryEmailSentHistory.aspx?JuryId=" + jury.Id.ToString();


            lnkBtn         = (LinkButton)e.Item.FindControl("lnkBtnEdit");
            lnkBtn.Visible = !Security.IsReadOnlyAdmin();
            lnkBtn         = (LinkButton)e.Item.FindControl("lnkAssign");
            lnkBtn.Visible = !Security.IsReadOnlyAdmin();
        }
        else if (e.Item.ItemType == GridItemType.Pager)
        {
            RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");

            PageSizeCombo.Items.Clear();
            //PageSizeCombo.Items.Add(new RadComboBoxItem("20", "20"));
            //PageSizeCombo.FindItemByText("20").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID);
            PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50"));
            PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID);
            PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100"));
            PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID);
            PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200"));
            PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID);
            PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999"));
            PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID);
            string PageSize = e.Item.OwnerTableView.PageSize.ToString();
            PageSizeCombo.FindItemByValue(PageSizeDefault.ToString()).Selected = true;
        }
    }
Exemple #16
0
 public static void SetLoginSessionJury(EffieJuryManagementApp.Jury jury)
 {
     HttpContext.Current.Session["Effie.Security.Login.Jury"] = jury;
 }
Exemple #17
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        // Validate the max jury per panel
        lbError.Text = "";
        string        error1  = "";
        string        error2  = "";
        List <string> panels1 = GeneralFunction.GetJuryPanelList("1");

        foreach (string panel in panels1)
        {
            if (/*!GeneralFunction.GetJuryListFromPanel(panel, "1").Contains(jury) &&*/
                GeneralFunction.GetJuryListFromPanel(panel, "1").Count() >= MaxJuryPerPanel &&
                GeneralFunction.GetValueCheckBoxList(cblRound1, "|").Contains(panel))
            {
                error1 += panel + "<br/>";
            }
        }

        List <string> panels2 = GeneralFunction.GetJuryPanelList("2");

        foreach (string panel in panels2)
        {
            if (/*GeneralFunction.GetJuryListFromPanel(panel, "2").Contains(jury) &&*/
                GeneralFunction.GetJuryListFromPanel(panel, "2").Count() >= MaxJuryPerPanel &&
                GeneralFunction.GetValueCheckBoxList(cblRound2, "|").Contains(panel))
            {
                error2 += panel + "<br/>";
            }
        }

        if (error1 != "" || error2 != "")
        {
            if (error1 != "")
            {
                lbError.Text += "Maximum number of judges for the following panels in Round 1:<br/>" + error1;
            }
            if (error2 != "")
            {
                lbError.Text += "Maximum number of judges for the following panels in Round 2:<br/>" + error2;
            }

            return;
        }

        //Save
        string[] ids = ((string)ViewState["idsForPanel"]).Split('|');

        foreach (string id in ids)
        {
            if (id != "")
            {
                EffieJuryManagementApp.Jury jury = EffieJuryManagementApp.Jury.GetJury(new Guid(id));

                EffieJuryManagementApp.InvitationList juryInvList = EffieJuryManagementApp.InvitationList.GetInvitationList(jury.Id, EffieJuryManagementApp.Gen_GeneralUseValueList.GetGen_GeneralUseValueList("EventCode")[0].Value);

                if (juryInvList.Count > 0)
                {
                    juryInvList[0].IsRound1Assigned = !String.IsNullOrEmpty(cblRound1.SelectedValue.Trim());
                    juryInvList[0].IsRound2Assigned = !String.IsNullOrEmpty(cblRound2.SelectedValue.Trim());

                    juryInvList[0].DateModifiedString = DateTime.Now.ToString();
                    juryInvList[0].Save();


                    jury.EffieExpYear = EffieJuryManagementApp.Jury.GetEffieExperienceYears(jury, juryInvList[0]);
                }


                if (!jury.IsNew)
                {
                    // Ok update the panels
                    jury.Round1PanelId = GeneralFunction.GetValueCheckBoxList(cblRound1, "|");
                    jury.Round2PanelId = GeneralFunction.GetValueCheckBoxList(cblRound2, "|");

                    lbError.Text = "Panel assignment updated.";
                }

                jury.Save();
            }
        }

        Response.Redirect(GeneralFunction.GetRedirect("../Admin/JuryList.aspx?r=" + round));
    }
Exemple #18
0
    protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            Score score = (Score)e.Item.DataItem;
            EffieJuryManagementApp.Jury jury = GeneralFunction.GetAllJuryCache(true, round).Where(x => x.Id == score.Juryid).FirstOrDefault();

            LinkButton lnkBtn, lnkBtn2 = null;
            Label      lbl   = null;
            HyperLink  lnk   = null;
            Entry      entry = GeneralFunction.GetEntryFromIDCache(score.EntryId);
            if (entry != null)
            {
                // Entry Id
                lbl      = (Label)e.Item.FindControl("lbSerial");
                lbl.Text = entry.Serial;


                // Title
                lbl      = (Label)e.Item.FindControl("lbTitle");
                lbl.Text = entry.Campaign;

                lbl      = (Label)e.Item.FindControl("lbClient");
                lbl.Text = entry.Client;

                // Categories
                lbl = (Label)e.Item.FindControl("lbCategory");
                //lbl.Text = GeneralFunction.GetEntryMarket(entry.CategoryMarket) + "<br/>" + entry.CategoryPSDetail;
                lbl.Text = entry.CategoryPSDetail;


                // submitted by
                lbl = (Label)e.Item.FindControl("lnkBtnBuSubmittedBy");
                Registration reg = GeneralFunction.GetRegistrationFromEntry(entry);
                lbl.Text = "-";
                if (reg != null)
                {
                    lbl.Text = reg.Company;
                    //lnkBtn.CommandArgument = reg.Id.ToString();
                }

                // Country
                lbl      = (Label)e.Item.FindControl("lbCountry");
                lbl.Text = "-";
                if (reg != null)
                {
                    lbl.Text = reg.Country;
                }
            }

            if (jury != null)
            {
                List <JuryPanelCategory> jcpList = GeneralFunction.GetJuryPanelCategoryFromCategoryPS(entry.CategoryMarketFromRound(round), entry.CategoryPSFromRound(round), entry.CategoryPSDetailFromRound(round), round);
                // Panel
                lbl = (Label)e.Item.FindControl("lbPanel");
                if (jcpList.Count > 0)
                {
                    lbl.Text = jcpList[0].PanelId;
                }

                // Jury
                lbl      = (Label)e.Item.FindControl("lbJuryId");
                lbl.Text = jury.SerialNo;
                lbl      = (Label)e.Item.FindControl("lbJuryName");
                lbl.Text = jury.FirstName + " " + jury.LastName;
                lbl      = (Label)e.Item.FindControl("lbJuryTitle");
                lbl.Text = jury.Designation;
                lbl      = (Label)e.Item.FindControl("lbJuryCompany");
                lbl.Text = jury.Company;
                //lbl = (Label)e.Item.FindControl("lbJuryNetwork");
                //lbl.Text = jury.Network;
                //if (jury.Network == "Others") lbl.Text += "-" + jury.NetworkOthers;
                //lbl = (Label)e.Item.FindControl("lbJuryHoldingCompany");
                //lbl.Text = jury.HoldingCompany;
                if (jury.HoldingCompany == "Others")
                {
                    lbl.Text += "-" + jury.HoldingCompanyOthers;
                }
                lbl      = (Label)e.Item.FindControl("lbJuryCountry");
                lbl.Text = jury.Country;
            }



            //// Flag
            lbl      = (Label)e.Item.FindControl("lbJuryFlag");
            lbl.Text = score.IsRecuse ? "Jury Recusal" : score.Flag;
            lbl      = (Label)e.Item.FindControl("lbJuryFlagReason");
            lbl.Text = score.FlagOthers;
            //lbl = (Label)e.Item.FindControl("lbJuryRecuseFlag");
            //lbl.Text = "Yes";
            //if (!score.IsRecuse) lbl.Text = "No";
            lbl      = (Label)e.Item.FindControl("lbJuryRecuseReason");
            lbl.Text = score.RecuseRemarks;


            lbl      = (Label)e.Item.FindControl("lbDateSubmitted");
            lbl.Text = "";
            if (score.DateSubmitted != DateTime.MinValue)
            {
                lbl.Text = score.DateSubmitted.ToString("dd/MM/yy");
            }

            //Action
            lnkBtn = (LinkButton)e.Item.FindControl("lnkScore");
            if (score != null)
            {
                lnkBtn.CommandArgument = score.Id.ToString();
                lnkBtn.Visible         = true;
            }


            //// chkboxes
            //CheckBox chkbox = (CheckBox)e.Item.FindControl("chkbox");
            //Security.SecureControlByHiding(chkbox);
        }
        else if (e.Item.ItemType == GridItemType.Pager)
        {
            RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");

            PageSizeCombo.Items.Clear();
            //PageSizeCombo.Items.Add(new RadComboBoxItem("20", "20"));
            //PageSizeCombo.FindItemByText("20").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID);
            PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50"));
            PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID);
            PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100"));
            PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID);
            PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200"));
            PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID);
            PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999"));
            PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID);
            string PageSize = e.Item.OwnerTableView.PageSize.ToString();
            PageSizeCombo.FindItemByValue(PageSizeDefault.ToString()).Selected = true;
        }
    }