예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Effie2017.App.Registration registration = (Effie2017.App.Registration)Session["registrationForPdfView"];
        //Effie2017.App.Entry entry = (Effie2017.App.Entry)Session["entryForPdfView"];

        if (Request["id"] == null)
            return;

        Effie2017.App.Entry entry = Effie2017.App.Entry.GetEntry(GeneralFunction.GetValueGuid(Request["id"].ToString(), true));
        Registration registration = GeneralFunction.GetRegistrationFromEntry(entry);

        if (registration == null || entry == null)
            return;

        Session["registrationForPdfView"] = null;
        Session["entryForPdfView"] = null;

        MemoryStream memoryStream = null;

        memoryStream = RegAttachment.GenerateGroupReceipt(registration, entry.PayGroupId);

        Response.ContentType = "application/pdf";
        //Response.AddHeader("Content-Disposition", "attachment; filename=Invoice.pdf");
        memoryStream.WriteTo(Response.OutputStream);
        memoryStream.Close();
    }
예제 #2
0
    protected void RecuseEntry(string Text, Guid EntryId, bool IsRecuse)
    {
        lblError.Text = "";
        Effie2017.App.Entry entry = Effie2017.App.Entry.GetEntry(EntryId);

        Score score = GeneralFunction.GetScoreFromMatchingEntryCache(entry, jury.Id, round);

        if (score == null)
        {
            score                     = Score.NewScore();
            score.EntryId             = entry.Id;
            score.Juryid              = jury.Id;
            score.Round               = round;
            score.DateCreatedString   = DateTime.Now.ToString();
            score.DateSubmittedString = DateTime.Now.ToString();
        }

        if (IsRecuse)
        {
            score.IsRecuse = true;
        }
        else
        {
            score.IsRecuse = false;
        }

        if (score.IsValid)
        {
            score.RecuseRemarks = Text;
            score.Save();
            PopulateForm();
        }
    }
예제 #3
0
    protected void PopulateForm()
    {
        if (Page.Request["id"] != null)
        {
            Effie2017.App.Entry entry = Effie2017.App.Entry.GetEntry(GeneralFunction.GetValueGuid(Request["id"].ToString(), true));

            //-------
            try {
                EntryForm entryForm = EntryForm.GetEntryForm(Guid.Empty, entry.Id);
                //string url = "../Main/" + GeneralFunctionEntryForm.GetEntryCategory(entry) + ".aspx?Id=" + GeneralFunction.StringEncryption(entry.Id.ToString());
                string url = "../Main/" + GeneralFunctionEntryForm.GetEntryCategory(entry) + "PDF.aspx?Id=" + entry.Id;
                lnkFileDownload0.NavigateUrl = url;
            }
            catch { }

            //-------
            if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Authorisation\\" + entry.Id.ToString() + "\\" + entry.Serial + "_AuthorizationForm_PDF.pdf"))
            {
                lnkFileDownload2.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Authorisation/" + entry.Id.ToString() + "/" + entry.Serial + "_AuthorizationForm_PDF.pdf";
            }

            //-------
            if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Case\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CaseImage.jpg"))
            {
                lnkFileDownload3.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Case/" + entry.Id.ToString() + "/" + entry.Serial + "_CaseImage.jpg";
            }
            else if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Case\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CaseImage.jpeg"))
            {
                lnkFileDownload3.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Case/" + entry.Id.ToString() + "/" + entry.Serial + "_CaseImage.jpeg";
            }

            //-------
            if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Creative\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CreativeMaterials_PDF.pdf"))
            {
                tblFile4.Visible             = true;
                lnkFileDownload4.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Creative/" + entry.Id.ToString() + "/" + entry.Serial + "_CreativeMaterials_PDF.pdf";
            }

            if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\CreativeVideo\\" + entry.Serial + "_CreativeMaterials_Video.mp4"))
            {
                tblFile5.Visible = true;
                //lnkFileDownload5.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/CreativeVideo/" + entry.Id.ToString() + "/" + entry.Serial + "_CreativeMaterials_Video.mp4";

                lnkFileDownload5.NavigateUrl = "../Video/DownloadMedia.aspx?filePath=" + System.Configuration.ConfigurationManager.AppSettings["storagePhysicalPath"] + "EntryUpload\\CreativeVideo\\" + "&MediaID=" + entry.Serial + "_CreativeMaterials_Video.mp4";
            }
            //if (GeneralFunction.FileExistsInAmazonS3(System.Configuration.ConfigurationManager.AppSettings["AWSBucket_Small"], entry.Serial + "_CreativeMaterials_Video.mp4"))
            //{
            //    tblFile5.Visible = true;
            //    lnkFileDownload5.NavigateUrl = "../Video/DownloadMedia.aspx?BucketID=" + System.Configuration.ConfigurationManager.AppSettings["AWSBucket_Small"] + "&MediaID=" + entry.Serial + "_CreativeMaterials_Video.mp4";
            //}
        }
    }
예제 #4
0
    protected void BindEntry()
    {
        Effie2017.App.Registration registration = Security.GetLoginSessionUser();

        Effie2017.App.EntryList entryList = Effie2017.App.EntryList.GetEntryList(Guid.Empty, registration.Id, "", StatusEntry.PaymentPending + "|" + StatusEntry.UploadPending + "|" + StatusEntry.UploadCompleted + "|" + StatusEntry.Completed + "|");

        bool neeReminder = false;

        foreach (Effie2017.App.Entry entry in entryList)
        {
            if (entry.Status == StatusEntry.UploadCompleted && entry.IsReminded == 0)
            {
                Effie2017.App.Entry entryUpdate = Effie2017.App.Entry.GetEntry(entry.Id);

                entryUpdate.IsReminded = 1;
                entryUpdate.Save();

                neeReminder = true;
            }
        }

        if (neeReminder)
        {
            ltrJs.Text = "<script type=\"text/javascript\"> $( document ).ready(function() { alert('You have successfully uploaded all the files. Please click confirm to complete your submission.'); }); </script>";
        }
        //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "none", "<script type=\"text/javascript\"> alert('You have successfully uploaded all the files. Please click confirm to complete your submission.'); </script>", false);

        radGridEntry.DataSource = entryList;
        radGridEntry.DataBind();

        #region radGridEntryPending
        entryList = Effie2017.App.EntryList.GetEntryList(Guid.Empty, registration.Id, "", StatusEntry.Draft + "|" + StatusEntry.Ready + "|");
        var          GroupIds   = entryList.GroupBy(x => x.Id);
        List <Entry> entryTeamp = new List <Entry>();
        foreach (var id in GroupIds)
        {
            try
            {
                entryTeamp.Add(entryList.FirstOrDefault(x => x.Id == id.Key));
            }
            catch { }
        }
        radGridEntryPending.DataSource = entryTeamp.OrderByDescending(x => x.DateModified);
        #endregion

        if (Security.IsUserLogin())
        {
            Registration reg          = Security.GetLoginSessionUser();
            var          LogHostories = LoginHistoryList.GetLoginHistoryList().Where(x => x.UserId == reg.Id);
            radLoginHistories.DataSource = LogHostories.OrderByDescending(x => x.DateModified);
        }
    }
예제 #5
0
    protected void radGridEntry_ItemCommand(object sender, GridCommandEventArgs e)
    {
        lblError.Text = "";

        if (e.CommandName == "Edit")
        {
            Security.SetLoginSessionUser(GeneralFunction.GetDummyRegistrationForAdminSpoof());
            GeneralFunction.SetRedirect("../Admin/EntryList.aspx");  // to return from whereever
            Response.Redirect("../Main/Entry.aspx?db=1&Id=" + ((GridDataItem)e.Item)["Id"].Text);
        }
        else if (e.CommandName == "Open")
        {
            Effie2017.App.Entry entry = Effie2017.App.Entry.GetEntry(new Guid(e.CommandArgument.ToString()));
            if (entry.Status == StatusEntry.Completed)
            {
                entry.Status = StatusEntry.UploadCompleted;
                entry.Save();
            }

            if (radGridEntry.MasterTableView.SortExpressions.Count > 0)
            {
                foreach (GridSortExpression expr in radGridEntry.MasterTableView.SortExpressions)
                {
                    BindGrid(true, expr.FieldName, expr.SortOrder, true);
                }
            }
            else
            {
                BindGrid(false, string.Empty, GridSortOrder.None, true);
            }
        }
        else if (e.CommandName == "View")
        {
            //GeneralFunction.SetRedirect("../Admin/EntryList.aspx");  // to return from whereever
            Response.Redirect("../Admin/JuryEntryList.aspx?juryId=" + ((GridDataItem)e.Item)["Id"].Text);
        }
        else if (e.CommandName == "Score")
        {
            GeneralFunction.SetRedirect("../Admin/JuryScoreList.aspx?r=" + round + "&juryId=" + jury.Id.ToString());  // to return from whereever
            Security.SetLoginSessionJury(jury);
            Response.Redirect("../Jury/EntryScore.aspx?eId=" + ((GridDataItem)e.Item)["Id"].Text + "&r=" + round + "&a=1");
        }
        else if (e.CommandName == "Reset")
        {
            Score score = Score.GetScore(new Guid(e.CommandArgument.ToString()));
            score.IsSubmitted = false;
            score.Save();

            PopulateForm();
        }
    }
예제 #6
0
    protected void radGridEntry_ItemCommand(object sender, GridCommandEventArgs e)
    {
        lblError.Text = "";

        if (e.CommandName == "Edit")
        {
            //Response.Redirect("./Entry.aspx?id=" + GeneralFunction.StringEncryption(((GridDataItem)e.Item)["Id"].Text));
            Response.Redirect("./Entry.aspx?db=1&Id=" + ((GridDataItem)e.Item)["Id"].Text);
        }
        else if (e.CommandName == "Delete")
        {
            Effie2017.App.Entry.CleanDeleteEntry(new Guid(((GridDataItem)e.Item)["Id"].Text));

            //lblError.Text += ((GridDataItem)e.Item)["Serial"].Text + " has been deleted.<br>";
            lblError.Text += "Entry has been deleted.<br>";
            BindEntry();
        }
        else if (e.CommandName == "Cloning")
        {
            string Id        = ((GridDataItem)e.Item)["Id"].Text;
            bool   isSuccess = OnCloningData(Id);
            if (isSuccess)
            {
                BindEntry();
                radGridEntryPending.Rebind();
            }
        }
        else if (e.CommandName == "View")
        {
            Response.Redirect("./Entry.aspx?db=1&v=1&Id=" + ((GridDataItem)e.Item)["Id"].Text);
        }
        else if (e.CommandName == "Confirm")
        {
            Effie2017.App.Entry entry = Effie2017.App.Entry.GetEntry(new Guid(((GridDataItem)e.Item)["Id"].Text));

            entry.Status             = StatusEntry.Completed;
            entry.DateModifiedString = DateTime.Now.ToString();
            entry.Save();

            lblError.Text += "Entry has been confirmed.<br>";
            BindEntry();
        }
        else if (e.CommandName == "lnkBtnCreative2")
        {
            Session["DownloadFile"] = e.CommandArgument.ToString();
            //ltrJs.Text = "<script type=\"text/javascript\"> window.open(\"./DownloadFile.aspx\"); </script>";
            //Response.Redirect("./DownloadFile.aspx");
            Response.Redirect(e.CommandArgument.ToString());
        }
    }
예제 #7
0
    protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            Effie2017.App.Entry entry = (Effie2017.App.Entry)e.Item.DataItem;

            LinkButton lnkBtn = null;

            lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnDelete");
            //lnkBtn.Attributes.Add("onclick", "return DeleteConfirmation('" + ((GridDataItem)e.Item)["Serial"].Text + "');");
            lnkBtn.Attributes.Add("onclick", "return DeleteConfirmation('Entry');");

            ((GridDataItem)e.Item)["GrandAmount"].Text   = (Convert.ToDecimal(((GridDataItem)e.Item)["GrandAmount"].Text)).ToString("0.00");
            ((GridDataItem)e.Item)["DateSubmitted"].Text = entry.DateSubmitted.ToString("dd/MM/yy");

            //if (entry.PayStatus == StatusPaymentEntry.Paid)
            //    ((GridDataItem)e.Item)["AmountPaid"].Text = (Convert.ToDecimal(((GridDataItem)e.Item)["AmountPlusFee"].Text)).ToString("0.00");
            //else
            //    ((GridDataItem)e.Item)["AmountPaid"].Text = "0.00";
            ((GridDataItem)e.Item)["AmountPaid"].Text = entry.AmountReceived.ToString("0.00");

            ((GridDataItem)e.Item)["BalanceDue"].Text    = (Convert.ToDecimal(((GridDataItem)e.Item)["GrandAmount"].Text) - Convert.ToDecimal(((GridDataItem)e.Item)["AmountPaid"].Text)).ToString("0.00");
            ((GridDataItem)e.Item)["PaymentMethod"].Text = GeneralFunction.GetPaymentType(entry.PaymentMethod);

            amountInvoiced += Convert.ToDecimal(((GridDataItem)e.Item)["GrandAmount"].Text);
            amountPaid     += Convert.ToDecimal(((GridDataItem)e.Item)["AmountPaid"].Text);
            balanceDue     += Convert.ToDecimal(((GridDataItem)e.Item)["BalanceDue"].Text);

            HyperLink lnk = (HyperLink)e.Item.FindControl("lnkInvoice");
            lnk.NavigateUrl = "./PaymentPdfView.aspx?id=" + GeneralFunction.StringEncryption(entry.Id.ToString());

            lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnEdit");
            lnkBtn.CommandArgument = entry.PayGroupId.ToString();
            Security.SecureControlByHiding(lnkBtn);


            if (entry.AmountReceived > 0)
            {
                lnkBtn.Visible = false;
            }
            else
            {
                lnkBtn.Visible = true;
            }
        }
    }
예제 #8
0
    protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            Effie2017.App.Entry entry = (Effie2017.App.Entry)e.Item.DataItem;

            Label lbl = null;

            // submitted by
            lbl = (Label)e.Item.FindControl("lblSubmittedBy");
            Registration reg = GeneralFunction.GetRegistrationFromEntry(entry);
            lbl.Text = "-";
            if (reg != null)
            {
                lbl.Text = GeneralFunction.GetRegistrationFromEntry(entry).Company;
            }
        }
    }
예제 #9
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        lblError.Text = "";

        if (!chkFileViewed0.Checked || !chkFileViewed2.Checked || !chkFileViewed3.Checked)
        {
            lblError.Text = "Please preview the files before confirm.<br>";
        }

        if (lblError.Text == "")
        {
            if ((tblFile4.Visible && !chkFileViewed4.Checked) || (tblFile5.Visible && !chkFileViewed5.Checked))
            {
                lblError.Text = "Please preview the files before confirm.<br>";
            }
        }

        if (Page.Request["id"] == null)
        {
        }

        if (lblError.Text == "")
        {
            Effie2017.App.Entry entry = Effie2017.App.Entry.GetEntry(GeneralFunction.GetValueGuid(Request["id"].ToString(), true));

            if (string.IsNullOrEmpty(entry.ProcessingStatus))
            {
                entry.ProcessingStatus = StatusEntry.PendingVerification;
            }
            //else if (entry.ProcessingStatus == StatusEntry.Reopened)
            //    entry.ProcessingStatus = StatusEntry.Completed;

            entry.Status             = StatusEntry.Completed;
            entry.DateModifiedString = DateTime.Now.ToString();
            entry.MaterialsSubmitted = DateTime.Now.ToString();
            entry.Save();

            ltrJs.Text = "<script type=\"text/javascript\"> FancyClose(); </script>";
        }
    }
예제 #10
0
    protected void radGridEntry_ItemCommand(object sender, GridCommandEventArgs e)
    {
        lblError.Text = "";

        if (e.CommandName == "Edit")
        {
            //Response.Redirect("./Entry.aspx?id=" + GeneralFunction.StringEncryption(((GridDataItem)e.Item)["Id"].Text));
            //Response.Redirect("./Summary.aspx?Id=" + ((GridDataItem)e.Item)["Id"].Text);

            EntryList entryList = EntryList.GetEntryList(new Guid(e.CommandArgument.ToString()), Guid.Empty, "");
            foreach (Entry entry in entryList)
            {
                GeneralFunction.AddIdToGroupPaymentCache(entry.Id);
            }
            //Response.Redirect("./Summary.aspx");
            Response.Redirect("./Summary.aspx?pgId=" + GeneralFunction.StringEncryption(e.CommandArgument.ToString()));
        }
        else if (e.CommandName == "Delete")
        {
            Effie2017.App.Entry.CleanDeleteEntry(new Guid(((GridDataItem)e.Item)["Id"].Text));

            //lblError.Text += ((GridDataItem)e.Item)["Serial"].Text + " has been deleted.<br>";
            lblError.Text += "Entry has been deleted.<br>";
            BindEntry();
        }
        else if (e.CommandName == "Invoice")
        {
            Effie2017.App.Registration registration = Security.GetLoginSessionUser();
            Effie2017.App.Entry        entry        = Effie2017.App.Entry.GetEntry(new Guid(((GridDataItem)e.Item)["Id"].Text));

            Session["registrationForPdfView"] = registration;
            Session["entryForPdfView"]        = entry;

            ltrJs.Text = "<script type=\"text/javascript\"> window.open('PaymentPdfView.aspx'); </script>";
        }
    }
예제 #11
0
    protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            Effie2017.App.Entry entry = (Effie2017.App.Entry)e.Item.DataItem;
            ScoreList           slist = GeneralFunction.GetAllScoreCache(false);
            Score score = GeneralFunction.GetScoreFromMatchingEntryCache(entry, jury.Id, round);
            if (entry == null)
            {
                return;
            }

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

            //// Edit button
            //lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnEdit");
            //Security.SecureControlByHiding(lnkBtn);

            // Entry Id
            lbl      = (Label)e.Item.FindControl("lbSerial");
            lbl.Text = entry.Serial;


            // Campaign title
            lbl      = (Label)e.Item.FindControl("lbCampaign");
            lbl.Text = entry.Campaign;


            // Category
            lbl = (Label)e.Item.FindControl("lbCategory");
            //lbl.Text = GeneralFunction.GetEntryMarket(entry.CategoryMarketFromRound(round)) + "<br/>" + entry.CategoryPSDetailFromRound(round);
            lbl.Text = entry.CategoryPSDetailFromRound(round);


            // 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();
            }

            // client and agency
            CompanyCreditList cclist = CompanyCreditList.GetCompanyCreditList(entry.Id);
            try
            {
                lbl      = (Label)e.Item.FindControl("lbClient");
                lbl.Text = cclist[0].Company;

                //lbl = (Label)e.Item.FindControl("lbAgency1");
                //lbl.Text = cclist[1].Company;

                //lbl = (Label)e.Item.FindControl("lbAgency2");
                //lbl.Text = cclist[2].Company;

                //lbl = (Label)e.Item.FindControl("lbAgency3");
                //lbl.Text = cclist[3].Company;

                //lbl = (Label)e.Item.FindControl("lbAgency4");
                //lbl.Text = cclist[4].Company;

                //lbl = (Label)e.Item.FindControl("lbAgency5");
                //lbl.Text = cclist[5].Company;
            }
            catch { }

            // Brand
            lbl      = (Label)e.Item.FindControl("lbBrand");
            lbl.Text = entry.Brand;

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


            if (score != null)
            {
                // Raw score
                lbl      = (Label)e.Item.FindControl("lbScoreSCRaw");
                lbl.Text = score.ScoreSC.ToString();
                if (score.IsAdminRecuse || score.IsRecuse)
                {
                    lbl.Text = "X";
                }

                // ID
                lbl      = (Label)e.Item.FindControl("lbScoreIDRaw");
                lbl.Text = score.ScoreID.ToString();
                if (score.IsAdminRecuse || score.IsRecuse)
                {
                    lbl.Text = "X";
                }

                // IL
                lbl      = (Label)e.Item.FindControl("lbScoreILRaw");
                lbl.Text = score.ScoreIL.ToString();
                if (score.IsAdminRecuse || score.IsRecuse)
                {
                    lbl.Text = "X";
                }

                // RE
                lbl      = (Label)e.Item.FindControl("lbScoreRERaw");
                lbl.Text = score.ScoreRE.ToString();
                if (score.IsAdminRecuse || score.IsRecuse)
                {
                    lbl.Text = "X";
                }



                // Weighted scores
                // SC
                lbl      = (Label)e.Item.FindControl("lbScoreSC");
                lbl.Text = GeneralFunction.CalculateSC(score.ScoreSC).ToString("N");
                if (score.IsAdminRecuse || score.IsRecuse)
                {
                    lbl.Text = "X";
                }

                // ID
                lbl      = (Label)e.Item.FindControl("lbScoreID");
                lbl.Text = GeneralFunction.CalculateID(score.ScoreID).ToString("N");
                if (score.IsAdminRecuse || score.IsRecuse)
                {
                    lbl.Text = "X";
                }

                // IL
                lbl      = (Label)e.Item.FindControl("lbScoreIL");
                lbl.Text = GeneralFunction.CalculateIL(score.ScoreIL).ToString("N");
                if (score.IsAdminRecuse || score.IsRecuse)
                {
                    lbl.Text = "X";
                }

                // RE
                lbl      = (Label)e.Item.FindControl("lbScoreRE");
                lbl.Text = GeneralFunction.CalculateRE(score.ScoreRE).ToString("N");
                if (score.IsAdminRecuse || score.IsRecuse)
                {
                    lbl.Text = "X";
                }


                // composite score
                lbl      = (Label)e.Item.FindControl("lbScoreComposite");
                lbl.Text = score.ScoreComposite.ToString("N");
                if (score.IsAdminRecuse || score.IsRecuse)
                {
                    lbl.Text = "X";
                }



                // Status
                lbl           = (Label)e.Item.FindControl("lbScoreStatus");
                lbl.Text      = "Pending";
                lbl.ForeColor = System.Drawing.Color.Gray;
                if (score.IsSubmitted)
                {
                    lbl.Text      = "Completed";
                    lbl.ForeColor = System.Drawing.Color.Green;
                }
                if (score.IsAdminRecuse || score.IsRecuse)
                {
                    lbl.Text      = "Recused";
                    lbl.ForeColor = System.Drawing.Color.Gray;
                }


                // Flag
                lbl      = (Label)e.Item.FindControl("lbJuryFlag");
                lbl.Text = "-";
                if (score.Flag != "")
                {
                    lbl.Text = score.Flag;
                }


                // Jury Recuse Flag
                lbl      = (Label)e.Item.FindControl("lbJuryRecuse");
                lbl.Text = "";
                if (score.IsRecuse)
                {
                    lbl.Text = "Y";
                }


                // Recuse
                lbl      = (Label)e.Item.FindControl("lbRecuse");
                lbl.Text = "";
                if (score.IsAdminRecuse)
                {
                    lbl.Text = "Y";
                }


                // Advancement
                lbl      = (Label)e.Item.FindControl("lbAdvancement");
                lbl.Text = "-";
                lbl.Text = ((score.IsRecuse || score.IsAdminRecuse) ? "-" : ((score.IsAdvancement) ? "Y" : "N"));
            }


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

            // Reset
            lnkBtn = (LinkButton)e.Item.FindControl("lnkReset");
            if (score != null && score.IsSubmitted)
            {
                lnkBtn.CommandArgument = score.Id.ToString();
                lnkBtn.Visible         = true;
            }

            if (Security.IsReadOnlyAdmin())
            {
                lnkBtn.Visible = false;
            }

            // chkboxes
            //CheckBox chkbox = (CheckBox)e.Item.FindControl("chkbox");
            //Security.SecureControlByHiding(chkbox);
        }
    }
예제 #12
0
    protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            Effie2017.App.Entry entry = (Effie2017.App.Entry)e.Item.DataItem;


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


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


            // 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;
            }

            // client and agency
            CompanyCreditList cclist = CompanyCreditList.GetCompanyCreditList(entry.Id);
            try
            {
                lbl      = (Label)e.Item.FindControl("lbClient");
                lbl.Text = cclist[0].Company;

                lbl      = (Label)e.Item.FindControl("lbAgency1");
                lbl.Text = cclist[1].Company;

                lbl      = (Label)e.Item.FindControl("lbAgency2");
                lbl.Text = cclist[2].Company;

                lbl      = (Label)e.Item.FindControl("lbAgency3");
                lbl.Text = cclist[3].Company;

                lbl      = (Label)e.Item.FindControl("lbAgency4");
                lbl.Text = cclist[4].Company;

                lbl      = (Label)e.Item.FindControl("lbAgency5");
                lbl.Text = cclist[5].Company;
            }
            catch { }


            //// submitted details
            //lbl = (Label)e.Item.FindControl("lblSubmittedDetails");
            //lbl.Text = reg.Firstname + " " + reg.Lastname + "<br/>" + reg.Job + "<br/>" + GeneralFunction.ShowFriendlyContact(reg.Contact) + "<br/>" + reg.Email;


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


            // Jury panel round2



            // Jury
            List <EffieJuryManagementApp.Jury> jlist = GeneralFunction.GetJuryListFromEntryCategory(entry.CategoryMarketFromRound(round), entry.CategoryPSFromRound(round), entry.CategoryPSDetailFromRound(round), round);

            DisplayJury(e, "lbJury1", jlist, 0);
            DisplayJury(e, "lbJury2", jlist, 1);
            DisplayJury(e, "lbJury3", jlist, 2);
            DisplayJury(e, "lbJury4", jlist, 3);
            DisplayJury(e, "lbJury5", jlist, 4);
            DisplayJury(e, "lbJury6", jlist, 5);
            DisplayJury(e, "lbJury7", jlist, 6);
            DisplayJury(e, "lbJury8", jlist, 7);
            DisplayJury(e, "lbJury9", jlist, 8);
            DisplayJury(e, "lbJury10", jlist, 9);
            DisplayJury(e, "lbJury11", jlist, 10);
            DisplayJury(e, "lbJury12", jlist, 11);
            DisplayJury(e, "lbJury13", jlist, 12);
            DisplayJury(e, "lbJury14", jlist, 13);
            DisplayJury(e, "lbJury15", jlist, 14);
            DisplayJury(e, "lbJury16", jlist, 15);
            DisplayJury(e, "lbJury17", jlist, 16);
            DisplayJury(e, "lbJury18", jlist, 17);
            DisplayJury(e, "lbJury19", jlist, 18);
            DisplayJury(e, "lbJury20", jlist, 19);

            //// 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;
        }
    }
예제 #13
0
    protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            Effie2017.App.Entry entry = (Effie2017.App.Entry)e.Item.DataItem;

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

            //((GridDataItem)e.Item)["DateSubmitted"].Text = entry.DateSubmitted.ToString("MM/dd/yy hh:mm:ss tt");

            if (entry.CategoryMarket == "SM")
            {
                ((GridDataItem)e.Item)["CategoryMarket"].Text = "Single Market";
            }
            else if (entry.CategoryMarket == "MM")
            {
                ((GridDataItem)e.Item)["CategoryMarket"].Text = "Multi Market";
            }
            ((GridDataItem)e.Item)["CategoryMarket"].Text = entry.CategoryPSDetail;

            ((GridDataItem)e.Item)["Status"].Text   = GeneralFunction.GetEntryStatusForAdmin(entry.Status);
            ((GridDataItem)e.Item)["Deadline"].Text = entry.Deadline;

            // Status
            if (entry.Status == StatusEntry.Completed)
            {
                ((GridDataItem)e.Item)["Status"].Text = "<span style=\"font-weight:bold\">" + GeneralFunction.GetEntryStatus(entry.Status) + "</span>";
            }
            if (entry.WithdrawnStatus != "")
            {
                ((GridDataItem)e.Item)["Status"].Text += "<br/><span style=\"color:Red;\">" + GeneralFunction.GetWithdrawnStatus(entry.WithdrawnStatus) + "</span>";
            }

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


            // submitted details
            lbl      = (Label)e.Item.FindControl("lblSubmittedDetails");
            lbl.Text = reg.Firstname + " " + reg.Lastname + "<br/>" + reg.Job + "<br/>" + GeneralFunction.ShowFriendlyContact(reg.Contact) + "<br/>" + reg.Email;

            if (reg != null)
            {
                lnkBtn.Text            = GeneralFunction.GetRegistrationFromEntry(entry).Company;
                lnkBtn.CommandArgument = reg.Id.ToString();

                // Changes by Shaik for adding new columns on 19 Oct 2015
                ((GridDataItem)e.Item)["Firstname"].Text = reg.Firstname;
                ((GridDataItem)e.Item)["Lastname"].Text  = reg.Lastname;
                ((GridDataItem)e.Item)["Country"].Text   = reg.Country;
            }

            if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\CreativeVideo\\" + entry.Serial + "_CreativeMaterials_Video.mp4"))
            {
                lnkBtn                 = (LinkButton)e.Item.FindControl("lnkDownloadVideo");
                lnkBtn.Visible         = true;
                lnkBtn.CommandArgument = entry.Id.ToString();
            }


            ((GridDataItem)e.Item)["IsVideoDownloaded"].Text = entry.IsVideoDownloaded ? "Yes" : "No";
        }
        else if (e.Item.ItemType == GridItemType.Pager)
        {
            RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");

            PageSizeCombo.Items.Clear();
            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);
            PageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;
        }
    }
예제 #14
0
    protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            Effie2017.App.Entry entry = (Effie2017.App.Entry)e.Item.DataItem;

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

            // Edit button
            lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnEdit");
            Security.SecureControlByHiding(lnkBtn);

            //((GridDataItem)e.Item)["Id"].Text = entry.Id.ToString();

            HiddenField hdfId = (HiddenField)e.Item.FindControl("hdfId");
            hdfId.Value = entry.Id.ToString();

            // market
            if (entry.CategoryMarket == "SM")
            {
                ((GridDataItem)e.Item)["CategoryMarket"].Text = "Single Market";
            }
            else if (entry.CategoryMarket == "MM")
            {
                ((GridDataItem)e.Item)["CategoryMarket"].Text = "Multi Market";
            }
            ((GridDataItem)e.Item)["CategoryMarket"].Text = entry.CategoryPSDetail;


            ((GridDataItem)e.Item)["Status"].Text = GeneralFunction.GetEntryStatusForAdmin(entry.Status);

            string ProcessingStatus = entry.ProcessingStatus;
            if (entry.ProcessingStatus == StatusEntry.Completed)
            {
                ProcessingStatus = "Completed";
            }
            else
            {
                ProcessingStatus = GeneralFunction.GetEntryStatusForAdmin(entry.ProcessingStatus);
            }

            ((GridDataItem)e.Item)["ProcessingStatus"].Text = "<span style='font-weight: bold;'>" + ProcessingStatus + "</span>";


            // Status
            if (entry.Status == StatusEntry.Completed)
            {
                ((GridDataItem)e.Item)["Status"].Text = "<span style=\"font-weight:bold\">" + GeneralFunction.GetEntryStatus(entry.Status) + "</span>";
            }
            if (entry.WithdrawnStatus != "")
            {
                ((GridDataItem)e.Item)["Status"].Text += "<br/><span style=\"color:Red;\">" + GeneralFunction.GetWithdrawnStatus(entry.WithdrawnStatus) + "</span>";
            }

            Administrator administrator = AdministratorList.GetAdministratorList().Where(x => x.Id == entry.AdminidAssignedto).FirstOrDefault();
            try
            {
                ((GridDataItem)e.Item)["AdminidAssignedto"].Text = administrator.LoginId;;
            }
            catch
            {
                ((GridDataItem)e.Item)["AdminidAssignedto"].Text = "";
            }


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

                // Changes by Shaik for adding new columns on 19 Oct 2015
                ((GridDataItem)e.Item)["Firstname"].Text = reg.Firstname;
                ((GridDataItem)e.Item)["Lastname"].Text  = reg.Lastname;
            }


            // submitted details
            lbl      = (Label)e.Item.FindControl("lblSubmittedDetails");
            lbl.Text = reg.Firstname + " " + reg.Lastname + "<br/>" + reg.Job + "<br/>" + GeneralFunction.ShowFriendlyContact(reg.Contact) + "<br/>" + reg.Email;

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

            //Edit By Rico, Nov 28 2013, Extra Collumn for Countr and Date Reminder
            ((GridDataItem)e.Item)["Country"].Text = reg.Country;


            CheckBox checkbox = (CheckBox)e.Item.FindControl("chkbox");
            if (checkbox != null)
            {
                checkbox.Visible = true;
            }
        }
        else if (e.Item.ItemType == GridItemType.Pager)
        {
            RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");

            PageSizeCombo.Items.Clear();
            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);
            PageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;
        }
    }
예제 #15
0
    protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            Effie2017.App.Entry entry = (Effie2017.App.Entry)e.Item.DataItem;

            LinkButton lnkBtn = null;

            lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnDelete");
            //lnkBtn.Attributes.Add("onclick", "return DeleteConfirmation('" + ((GridDataItem)e.Item)["Serial"].Text + "');");
            lnkBtn.Attributes.Add("onclick", "return DeleteConfirmation('Entry');");

            try {
                Label lblno = (Label)e.Item.FindControl("lblno");
                //lblno.Text = Number.ToString();
                lblno.Text = (e.Item.ItemIndex + 1).ToString();
                Number++;
            }
            catch {
            }

            CheckBox  chk = null;
            HyperLink lnk = null;

            ((GridDataItem)e.Item)["DateSubmitted"].Text = entry.DateSubmitted.ToString("dd/MM/yy");
            ((GridDataItem)e.Item)["DateModified"].Text  = entry.DateModified.ToString("dd/MM/yy");

            if (entry.CategoryMarket == "SM")
            {
                ((GridDataItem)e.Item)["CategoryMarket"].Text = "Single Market";
            }
            else if (entry.CategoryMarket == "MM")
            {
                ((GridDataItem)e.Item)["CategoryMarket"].Text = "Multi Market";
            }
            ((GridDataItem)e.Item)["CategoryMarket"].Text = entry.CategoryPSDetail; //+= "<br>" +

            if (entry.PayStatus == "NOT")
            {
                ((GridDataItem)e.Item)["PayStatus"].Text = "<a href='../Admin/PaymentPdfView.aspx?id=" + GeneralFunction.StringEncryption(entry.Id.ToString()) + "' target='_blank' class='fontRed'>" + GeneralFunction.GetPaymentEntryStatus(entry.PayStatus) + "</a>";
            }
            else
            {
                ((GridDataItem)e.Item)["PayStatus"].Text = "<a href='../Admin/PaymentPdfView.aspx?id=" + GeneralFunction.StringEncryption(entry.Id.ToString()) + "' target='_blank'>" + GeneralFunction.GetPaymentEntryStatus(entry.PayStatus) + "</a>";
            }

            ((GridDataItem)e.Item)["Status"].Text = GeneralFunction.GetEntryStatus(entry.Status);

            if (entry.Status == StatusEntry.Draft || GeneralFunction.IsEntrantSubmissionCutOff())
            {
                try
                {
                    lnkBtn         = (LinkButton)e.Item.FindControl("LinkCloning");
                    lnkBtn.Visible = false;
                }
                catch { }
            }

            if (GeneralFunction.IsEntrantSubmissionCutOff() || !GeneralFunction.IsAllowClone())
            {
                try
                {
                    lnkBtn         = (LinkButton)e.Item.FindControl("lnkBtnCloning");
                    lnkBtn.Visible = false;
                }
                catch { }
            }

            if (entry.Status == StatusEntry.Completed)
            {
                ((GridDataItem)e.Item)["Status"].Text = "<span style=\"font-weight:bold\">" + GeneralFunction.GetEntryStatus(entry.Status) + "</span>";
            }

            if (entry.WithdrawnStatus != "")
            {
                ((GridDataItem)e.Item)["Status"].Text += "<br/><span style=\"color:Red;\">" + GeneralFunction.GetWithdrawnStatus(entry.WithdrawnStatus) + "</span>";
            }

            lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnViewCampaign");
            if (lnkBtn.Text == "")
            {
                lnkBtn.Text = entry.Campaign;
            }

            #region Condition for radGridEntry
            //if (entry.PayStatus == StatusPaymentEntry.Paid)
            if (true)
            {
                if (entry.WithdrawnStatus == "" && (entry.Status == StatusEntry.UploadPending || entry.Status == StatusEntry.UploadCompleted || entry.Status == StatusEntry.Completed))
                {
                    //Guid EntryId = new Guid(((GridDataItem)e.Item)["Id"].Text);
                    if (entry != null)
                    {
                        string    url             = "./" + GeneralFunctionEntryForm.GetEntryCategory(entry) + ".aspx?Id=" + entry.Id;
                        string    urlPdf          = "./" + GeneralFunctionEntryForm.GetEntryCategory(entry) + "PDF.aspx?Id=" + entry.Id;
                        string    StatusEntryForm = "";
                        HyperLink Edit            = (HyperLink)e.Item.FindControl("lnkEntry1");
                        HyperLink ViewPDF         = (HyperLink)e.Item.FindControl("lnkEntry2");
                        HyperLink hlEntryForm     = (HyperLink)e.Item.FindControl("lnkEntryForm");
                        hlEntryForm.Enabled     = true;
                        hlEntryForm.Visible     = true;
                        hlEntryForm.NavigateUrl = url;
                        hlEntryForm.CssClass    = "tblLinkRed";
                        try
                        {
                            EntryForm entryForm = EntryForm.GetEntryForm(Guid.Empty, entry.Id);
                            if (entry.Status == StatusEntry.Completed || entryForm.Status == StatusEntry.Completed)
                            {
                                StatusEntryForm     = "Completed";
                                hlEntryForm.Visible = false;

                                Edit.Enabled     = true;
                                Edit.Visible     = true;
                                Edit.NavigateUrl = url;
                                Edit.Text        = "Edit";
                                Edit.CssClass    = "tblLinkBlack";

                                ViewPDF.Enabled     = true;
                                ViewPDF.Visible     = true;
                                ViewPDF.NavigateUrl = urlPdf;
                                ViewPDF.Text        = "<br>View PDF";
                                ViewPDF.CssClass    = "tblLinkBlack";
                            }
                            else
                            {
                                StatusEntryForm = "Draft";
                            }

                            if (entry.Status == StatusEntry.Completed)
                            {
                                Edit.Visible        = false;
                                hlEntryForm.Visible = false;
                            }

                            hlEntryForm.Text = "Entry Form (" + StatusEntryForm + ")";
                        }
                        catch { }
                    }

                    //////lnk = (HyperLink)e.Item.FindControl("lnkUploadEntry");
                    //////lnk.CssClass = "fancybox fancybox.iframe tblLinkRed";
                    //////lnk.NavigateUrl = "./UploadForAll.aspx?md=UE&id=" + GeneralFunction.StringEncryption(((GridDataItem)e.Item)["Id"].Text);
                    //////lnk.Enabled = true;
                    //////lnk.Visible = true;
                    lnk             = (HyperLink)e.Item.FindControl("lnkUploadAuthorisation");
                    lnk.CssClass    = "fancybox fancybox.iframe tblLinkRed";
                    lnk.NavigateUrl = "./UploadForAll.aspx?md=UA&id=" + GeneralFunction.StringEncryption(((GridDataItem)e.Item)["Id"].Text);
                    lnk.Enabled     = true;
                    lnk.Visible     = true;
                    lnk             = (HyperLink)e.Item.FindControl("lnkUploadCase");
                    lnk.CssClass    = "fancybox fancybox.iframe tblLinkRed";
                    lnk.NavigateUrl = "./UploadForAll.aspx?md=UC&id=" + GeneralFunction.StringEncryption(((GridDataItem)e.Item)["Id"].Text);
                    lnk.Enabled     = true;
                    lnk.Visible     = true;
                    lnk             = (HyperLink)e.Item.FindControl("lnkUploadCreative");
                    lnk.CssClass    = "fancybox2 fancybox.iframe tblLinkRed";
                    lnk.NavigateUrl = "./UploadForCr.aspx?md=UCr&id=" + GeneralFunction.StringEncryption(((GridDataItem)e.Item)["Id"].Text);
                    lnk.Enabled     = true;
                    lnk.Visible     = true;

                    if (entry.Status == StatusEntry.Completed)
                    {
                        lnk         = (HyperLink)e.Item.FindControl("lnkEntryForm");
                        lnk.Visible = false;
                        //////lnk = (HyperLink)e.Item.FindControl("lnkUploadEntry");
                        //////lnk.Visible = false;
                        lnk         = (HyperLink)e.Item.FindControl("lnkUploadAuthorisation");
                        lnk.Visible = false;
                        lnk         = (HyperLink)e.Item.FindControl("lnkUploadCase");
                        lnk.Visible = false;
                        lnk         = (HyperLink)e.Item.FindControl("lnkUploadCreative");
                        lnk.Visible = false;
                    }

                    //-------
                    //if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Entry\\" + entry.Id.ToString() + "\\" + entry.Serial + "_EntryForm_PDF.pdf"))
                    //{
                    //    lnk = (HyperLink)e.Item.FindControl("lnkEntry1");
                    //    lnk.Visible = true;
                    //    lnk.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Entry/" + entry.Id.ToString() + "/" + entry.Serial + "_EntryForm_PDF.pdf?" + DateTime.Now.Ticks.ToString();

                    //    //////lnk = (HyperLink)e.Item.FindControl("lnkUploadEntry");
                    //    //////lnk.Text = "Edit";
                    //    //////lnk.CssClass = "fancybox fancybox.iframe tblLinkBlack";

                    //    lnk = (HyperLink)e.Item.FindControl("lnkEntryForm");
                    //    lnk.Text = "Edit";
                    //    lnk.CssClass = "tblLinkBlack"; //fancybox fancybox.iframe
                    //}

                    //if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Entry\\" + entry.Id.ToString() + "\\" + entry.Serial + "_EntryForm_Word.doc"))
                    //{
                    //    lnk = (HyperLink)e.Item.FindControl("lnkEntry2");
                    //    lnk.Visible = true;
                    //    lnk.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Entry/" + entry.Id.ToString() + "/" + entry.Serial + "_EntryForm_Word.doc?" + DateTime.Now.Ticks.ToString();
                    //}
                    //else if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Entry\\" + entry.Id.ToString() + "\\" + entry.Serial + "_EntryForm_Word.docx"))
                    //{
                    //    lnk = (HyperLink)e.Item.FindControl("lnkEntry2");
                    //    lnk.Visible = true;
                    //    lnk.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Entry/" + entry.Id.ToString() + "/" + entry.Serial + "_EntryForm_Word.docx?" + DateTime.Now.Ticks.ToString();
                    //}

                    //-------
                    if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Authorisation\\" + entry.Id.ToString() + "\\" + entry.Serial + "_AuthorizationForm_PDF.pdf"))
                    {
                        lnk             = (HyperLink)e.Item.FindControl("lnkAuthorisation1");
                        lnk.Visible     = true;
                        lnk.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Authorisation/" + entry.Id.ToString() + "/" + entry.Serial + "_AuthorizationForm_PDF.pdf?" + DateTime.Now.Ticks.ToString();

                        lnk          = (HyperLink)e.Item.FindControl("lnkUploadAuthorisation");
                        lnk.Text     = "Edit";
                        lnk.CssClass = "fancybox fancybox.iframe tblLinkBlack";
                    }

                    //-------
                    if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Case\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CaseImage.jpg"))
                    {
                        lnk             = (HyperLink)e.Item.FindControl("lnkCase1");
                        lnk.Visible     = true;
                        lnk.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Case/" + entry.Id.ToString() + "/" + entry.Serial + "_CaseImage.jpg?" + DateTime.Now.Ticks.ToString();

                        lnk          = (HyperLink)e.Item.FindControl("lnkUploadCase");
                        lnk.Text     = "Edit";
                        lnk.CssClass = "fancybox fancybox.iframe tblLinkBlack";
                    }
                    else if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Case\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CaseImage.jpeg"))
                    {
                        lnk             = (HyperLink)e.Item.FindControl("lnkCase1");
                        lnk.Visible     = true;
                        lnk.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Case/" + entry.Id.ToString() + "/" + entry.Serial + "_CaseImage.jpeg?" + DateTime.Now.Ticks.ToString();

                        lnk          = (HyperLink)e.Item.FindControl("lnkUploadCase");
                        lnk.Text     = "Edit";
                        lnk.CssClass = "fancybox fancybox.iframe tblLinkBlack";
                    }

                    //-------
                    if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Creative\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CreativeMaterials_PDF.pdf"))
                    {
                        lnk             = (HyperLink)e.Item.FindControl("lnkCreative1");
                        lnk.Visible     = true;
                        lnk.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Creative/" + entry.Id.ToString() + "/" + entry.Serial + "_CreativeMaterials_PDF.pdf?" + DateTime.Now.Ticks.ToString();

                        lnk          = (HyperLink)e.Item.FindControl("lnkUploadCreative");
                        lnk.Text     = "Edit";
                        lnk.CssClass = "fancybox2 fancybox.iframe tblLinkBlack";
                    }

                    if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\CreativeVideo\\" + entry.Serial + "_CreativeMaterials_Video.mp4"))
                    {
                        lnkBtn         = (LinkButton)e.Item.FindControl("lnkBtnCreative2");
                        lnkBtn.Visible = true;
                        //lnkBtn.CommandArgument = "EntryUpload\\CreativeVideo\\" + entry.Serial + "_CreativeMaterials_Video.mp4";
                        lnkBtn.CommandArgument = "../Video/DownloadMedia.aspx?filePath=" + ConfigurationManager.AppSettings["storagePhysicalPath"] + "EntryUpload\\CreativeVideo\\" + "&MediaID=" + entry.Serial + "_CreativeMaterials_Video.mp4&t" + DateTime.Now.Ticks.ToString();

                        lnk          = (HyperLink)e.Item.FindControl("lnkUploadCreative");
                        lnk.Text     = "Edit";
                        lnk.CssClass = "fancybox2 fancybox.iframe tblLinkBlack";
                    }
                    if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Creative\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CreativeMaterialsTranslate_PDF.pdf"))
                    {
                        lnk             = (HyperLink)e.Item.FindControl("lnkCreative3");
                        lnk.Visible     = true;
                        lnk.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Creative/" + entry.Id.ToString() + "/" + entry.Serial + "_CreativeMaterialsTranslate_PDF.pdf?" + DateTime.Now.Ticks.ToString();

                        lnk          = (HyperLink)e.Item.FindControl("lnkUploadCreative");
                        lnk.Text     = "Edit";
                        lnk.CssClass = "fancybox2 fancybox.iframe tblLinkBlack";
                    }
                    //if (GeneralFunction.FileExistsInAmazonS3(ConfigurationManager.AppSettings["AWSBucket_Original"], entry.Serial + "_CreativeMaterials_Video.mp4"))
                    //{
                    //    if (GeneralFunction.FileExistsInAmazonS3(ConfigurationManager.AppSettings["AWSBucket_Small"], entry.Serial + "_CreativeMaterials_Video.mp4"))
                    //    {
                    //        lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnCreative2");
                    //        lnkBtn.Visible = true;
                    //        lnkBtn.CommandArgument = "../Video/DownloadMedia.aspx?BucketID=" + ConfigurationManager.AppSettings["AWSBucket_Small"] + "&MediaID=" + entry.Serial + "_CreativeMaterials_Video.mp4";

                    //        lnk = (HyperLink)e.Item.FindControl("lnkUploadCreative");
                    //        lnk.Text = "Edit";
                    //        lnk.CssClass = "fancybox2 fancybox.iframe tblLinkBlack";
                    //    }
                    //    else
                    //    {
                    //        lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnCreative2");
                    //        lnkBtn.Visible = true;
                    //        lnkBtn.Text = "Processing";
                    //        lnkBtn.Enabled = false;
                    //        lnk = (HyperLink)e.Item.FindControl("lnkUploadCreative");
                    //        lnk.Text = "Edit";
                    //        lnk.CssClass = "fancybox2 fancybox.iframe tblLinkBlack";
                    //        lnk.Visible = false;
                    //    }
                    //}
                }
            }

            if (entry.Status == StatusEntry.PaymentPending || entry.WithdrawnStatus != "")
            {
                lnk         = (HyperLink)e.Item.FindControl("lnkEntryForm");
                lnk.Enabled = false;
                lnk.Visible = true;

                //////lnk = (HyperLink)e.Item.FindControl("lnkUploadEntry");
                //////lnk.Enabled = false;
                //////lnk.Visible = true;

                lnk         = (HyperLink)e.Item.FindControl("lnkUploadAuthorisation");
                lnk.Enabled = false;
                lnk.Visible = true;
                lnk         = (HyperLink)e.Item.FindControl("lnkUploadCase");
                lnk.Enabled = false;
                lnk.Visible = true;
                lnk         = (HyperLink)e.Item.FindControl("lnkUploadCreative");
                lnk.Enabled = false;
                lnk.Visible = true;
            }

            lnk = (HyperLink)e.Item.FindControl("lnkConfirm");
            if (lnk != null)
            {
                //if (entry.PayStatus == StatusPaymentEntry.Paid && entry.Status == StatusEntry.UploadCompleted)
                if (entry.Status == StatusEntry.UploadCompleted)
                {
                    lnk.CssClass    = "fancybox3 fancybox.iframe tblLinkBlack";
                    lnk.ForeColor   = System.Drawing.Color.Red;
                    lnk.NavigateUrl = "./UploadConfirm.aspx?md=UCr&id=" + GeneralFunction.StringEncryption(((GridDataItem)e.Item)["Id"].Text);
                    lnk.Visible     = true;
                }
                else if (entry.Status == StatusEntry.Completed)
                {
                    lnk.Visible = false;
                }
                else
                {
                    lnk.CssClass = "tblLinkDisable";
                    lnk.Enabled  = false;
                }
            }
            #endregion

            #region Condition for radGridEntryPending
            if (entry.Status == StatusEntry.Ready)
            {
                chk            = (CheckBox)e.Item.FindControl("chkSubmit");
                chk.Enabled    = true;
                lnkBtn         = (LinkButton)e.Item.FindControl("lnkBtnView");
                lnkBtn.Visible = true;
            }
            //else
            //{
            //    lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnEdit");
            //    if (lnkBtn != null)
            //        lnkBtn.Visible = true;
            //}
            #endregion


            //if (GeneralFunction.IsEntrantSubmissionCutOff())
            //{
            //    lnk = (HyperLink)e.Item.FindControl("lnkConfirm");
            //    if (lnk != null) lnk.Visible = false;
            //}



            #region Allow Upload Files
            if (GeneralFunction.IsAllowUploadFiles())
            {
                try
                {
                    lnk = (HyperLink)e.Item.FindControl("lnkUploadAuthorisation");
                    //lnk.CssClass = "fancybox fancybox.iframe tblLinkRed";
                    lnk.NavigateUrl = "./UploadForAll.aspx?md=UA&id=" + GeneralFunction.StringEncryption(((GridDataItem)e.Item)["Id"].Text);
                    lnk.Enabled     = true;
                    lnk.Visible     = true;
                    lnk             = (HyperLink)e.Item.FindControl("lnkUploadCase");
                    //lnk.CssClass = "fancybox fancybox.iframe tblLinkRed";
                    lnk.NavigateUrl = "./UploadForAll.aspx?md=UC&id=" + GeneralFunction.StringEncryption(((GridDataItem)e.Item)["Id"].Text);
                    lnk.Enabled     = true;
                    lnk.Visible     = true;

                    if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Authorisation\\" + entry.Id.ToString() + "\\" + entry.Serial + "_AuthorizationForm_PDF.pdf"))
                    {
                        lnk             = (HyperLink)e.Item.FindControl("lnkAuthorisation1");
                        lnk.Visible     = true;
                        lnk.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Authorisation/" + entry.Id.ToString() + "/" + entry.Serial + "_AuthorizationForm_PDF.pdf?" + DateTime.Now.Ticks.ToString();

                        lnk          = (HyperLink)e.Item.FindControl("lnkUploadAuthorisation");
                        lnk.Text     = "Edit";
                        lnk.CssClass = "fancybox fancybox.iframe tblLinkBlack";
                    }

                    //-------
                    if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Case\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CaseImage.jpg"))
                    {
                        lnk             = (HyperLink)e.Item.FindControl("lnkCase1");
                        lnk.Visible     = true;
                        lnk.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Case/" + entry.Id.ToString() + "/" + entry.Serial + "_CaseImage.jpg?" + DateTime.Now.Ticks.ToString();

                        lnk          = (HyperLink)e.Item.FindControl("lnkUploadCase");
                        lnk.Text     = "Edit";
                        lnk.CssClass = "fancybox fancybox.iframe tblLinkBlack";
                    }
                    else if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Case\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CaseImage.jpeg"))
                    {
                        lnk             = (HyperLink)e.Item.FindControl("lnkCase1");
                        lnk.Visible     = true;
                        lnk.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Case/" + entry.Id.ToString() + "/" + entry.Serial + "_CaseImage.jpeg?" + DateTime.Now.Ticks.ToString();

                        lnk          = (HyperLink)e.Item.FindControl("lnkUploadCase");
                        lnk.Text     = "Edit";
                        lnk.CssClass = "fancybox fancybox.iframe tblLinkBlack";
                    }
                }
                catch { }
            }
            #endregion
        }
    }