Beispiel #1
0
    private void PopulateForm()
    {
        SystemData sys = GeneralFunction.GetSystemData();

        GeneralFunction.AssignValueCheckBoxList(cblRound1, sys.ActivePanelsRound1, "|");
        GeneralFunction.AssignValueCheckBoxList(cblRound2, sys.ActivePanelsRound2, "|");

        if (sys.ActiveRound == "1")
        {
            rbRound1.Checked = true;
            rbRound1_CheckedChanged(null, null);
        }
        if (sys.ActiveRound == "2")
        {
            rbRound2.Checked = true;
            rbRound2_CheckedChanged(null, null);
        }


        if (Security.IsReadOnlyAdmin())
        {
            GeneralFunctionEntryForm.DisableAllAction(this, false);
            btnSubmit.Visible = !Security.IsReadOnlyAdmin();
        }
    }
Beispiel #2
0
 protected void Preview(bool isDraft)
 {
     PopupUploadImage.Visible = false;
     Session["Entry-" + EntryId.ToString() + (string)ViewState["SessionKey"]] = SetEntryFormValue();
     ViewState["SessionKey"] = DateTime.Now.ToString("HHmmss");
     PDFURL = "../Main/" + GeneralFunctionEntryForm.GetEntryCategory(entry) + "PDF.aspx?temp=Preview&Id=" + entry.Id + "&skey=" + (string)ViewState["SessionKey"];
 }
Beispiel #3
0
    protected void initJavascript()
    {
        List <TextBoxKeyup> textBoxKeyup = new List <TextBoxKeyup>();

        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtExecutiveSummary, LimitText = 100, isLimitActive = true
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtStrategicChallengeObjectivesA, LimitText = 125, isLimitActive = true
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtStrategicChallengeObjectivesB, LimitText = 275, isLimitActive = true
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtStrategicChallengeObjectivesC, LimitText = 175, isLimitActive = true
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtStrategicChallengeObjectivesD, LimitText = 175, isLimitActive = true
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtIdeasA, LimitText = 225, isLimitActive = true
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtIdeasB, LimitText = 25, isLimitActive = true
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtExplainListOtherMarketing, LimitText = 100, isLimitActive = true
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtExplainWorkedA, LimitText = 400, isLimitActive = true
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtExplainWorkedB, LimitText = 150, isLimitActive = true
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtAnything, LimitText = 475, isLimitActive = true
        });

        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtOwnedMedia, LimitText = 0, isLimitActive = false
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtSponsorship, LimitText = 0, isLimitActive = false
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtListAndExplainOtherMarketingText, LimitText = 0, isLimitActive = false
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtBringingIdea, LimitText = 0, isLimitActive = false
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtIdeasC, LimitText = 0, isLimitActive = false
        });
        textBoxKeyup.Add(new TextBoxKeyup {
            textbox = txtStrategicChallengeObjectivesE, LimitText = 0, isLimitActive = false
        });

        GeneralFunctionEntryForm.InitTextbox(textBoxKeyup, this, entry, ViewState["IsPreview"].ToString());
    }
Beispiel #4
0
    public static MemoryStream memStream(EntryForm entf, Entry ent)
    {
        entryForm = entf;
        entry     = ent;

        MemoryStream memoryStream = new System.IO.MemoryStream();

        memoryStream = GeneralFunctionEntryForm.memStream(GetDocument());

        return(memoryStream);
    }
Beispiel #5
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";
            //}
        }
    }
Beispiel #6
0
    protected void btnGenerate_Click(object sender, EventArgs e)
    {
        string           storagePhysicalPath = System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"];
        List <Entry>     dbentryList         = EntryList.GetEntryList(Guid.Empty, Guid.Empty, "").ToList();
        List <EntryForm> dbentryFormList     = EntryFormList.GetEntryFormList().Where(x => x.Status == StatusEntry.Completed).ToList();

        foreach (EntryForm entryForm in dbentryFormList)
        {
            Entry        entry        = dbentryList.FirstOrDefault(x => x.Id == entryForm.IdEntry);
            MemoryStream memoryStream = new System.IO.MemoryStream();
            string       path         = storagePhysicalPath + "EntryUpload/EntryForm";
            string       Filename     = entry.Serial + "_" + GeneralFunctionEntryForm.GetEntryCategory(entry) + ".pdf";
            string       Fullpath     = Path.Combine(path, Filename);
            try
            {
                using (memoryStream = GeneralFunctionEntryForm.Classification(entryForm, entry))
                {
                    Document  myDocument  = new Document();
                    PdfWriter myPDFWriter = PdfWriter.GetInstance(myDocument, memoryStream);
                    myDocument.Open();

                    byte[] content = memoryStream.ToArray();

                    var exists = Directory.Exists(path);
                    if (!exists)
                    {
                        System.IO.Directory.CreateDirectory(path);
                    }

                    // Write out PDF from memory stream.
                    using (FileStream fs = File.Create(Fullpath))
                    {
                        fs.Write(content, 0, (int)content.Length);
                    }
                }
            }
            catch
            {
                Response.Write("ERROR ==>  (entryForm.Id:" + entryForm.Id + ") - " + Fullpath + "<br>");
            }
        }
    }
Beispiel #7
0
    protected void GenerateEF(Entry entry)
    {
        string    storagePhysicalPath = System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"];
        EntryForm entryForm           = EntryFormList.GetEntryFormList().FirstOrDefault(x => x.IdEntry == entry.Id);

        if (entryForm != null)
        {
            MemoryStream memoryStream = new System.IO.MemoryStream();
            string       path         = storagePhysicalPath + "EntryUpload/EntryForm/" + entry.Id;
            string       Filename     = entry.Serial + "_" + GeneralFunctionEntryForm.GetEntryCategory(entry) + ".pdf";
            string       Fullpath     = Path.Combine(path, Filename);
            try
            {
                using (memoryStream = GeneralFunctionEntryForm.Classification(entryForm, entry))
                {
                    Document  myDocument  = new Document();
                    PdfWriter myPDFWriter = PdfWriter.GetInstance(myDocument, memoryStream);
                    myDocument.Open();

                    byte[] content = memoryStream.ToArray();

                    var exists = Directory.Exists(path);
                    if (!exists)
                    {
                        System.IO.Directory.CreateDirectory(path);
                    }

                    // Write out PDF from memory stream.
                    using (FileStream fs = File.Create(Fullpath))
                    {
                        fs.Write(content, 0, (int)content.Length);
                    }
                }
            }
            catch
            {
                Response.Write("ERROR ==>  (entryForm.Id:" + entryForm.Id + ") - " + Fullpath + "<br>");
            }
        }
    }
Beispiel #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
        {
            EntryId = new Guid(Request.QueryString["Id"]);
            //EntryId = new Guid(GeneralFunction.StringDecryption(Request.QueryString["Id"]));
            entry = Entry.GetEntry(EntryId);

            //Check if entry is closed
            if (entry.Status == StatusEntry.Completed)
            {
                Response.Redirect("./Dashboard.aspx");
            }

            PDFURL = "../Main/" + GeneralFunctionEntryForm.GetEntryCategory(entry) + "PDF.aspx?temp=Preview&Id=" + entry.Id;
            PopulateHeaderForm();
            try
            {
                entryForm = EntryForm.GetEntryForm(Guid.Empty, EntryId);
            }
            catch
            {
                entryForm = EntryForm.NewEntryForm();
            }
        }

        if (!IsPostBack)
        {
            LoadForm();
            PopulateForm();
            ViewState["IsPreview"]  = false;
            ViewState["SessionKey"] = DateTime.Now.ToString("HHmmss");
        }

        initJavascript();

        PDFURL = "../Main/" + GeneralFunctionEntryForm.GetEntryCategory(entry) + "PDF.aspx?temp=Preview&Id=" + entry.Id + "&skey=" + (string)ViewState["SessionKey"];

        doPostBack(sender, e);
    }
Beispiel #9
0
    public static string PopulateRow(string body)
    {
        body = body.Replace("###Title###", "Entry Form");
        body = body.Replace("###Logo###", WebURL + "images/logo-apaceffie-high.png");
        body = body.Replace("###HeaderLogo###", WebURL + "images/Header-logo-pdf.png");
        body = body.Replace("###IconList###", WebURL + "images/icon-list.png");
        body = body.Replace("###DesTotalOfCountries###", entryForm.DesTotalOfCountries);

        body = body.Replace("###Product###", entry.ProductClassification);
        body = body.Replace("###BrandName###", entry.Brand);
        body = body.Replace("###ProductServiceClassification###", entry.Client);
        body = body.Replace("###EntryTitle###", entry.Campaign);

        /////////////////////////////////
        body = body.Replace("###ComparedOtherCompetitorsCheck###", GetMoreLess(entryForm.ComparedOtherCompetitorsCheck));
        body = body.Replace("###ComparedOverallSpendCheck###", GetMoreLess(entryForm.ComparedOverallSpendCheck));
        /////////////////////////////////

        body = body.Replace("###SectionD###", GeneralFunctionEntryForm.CheckTextfield(entryForm.ListAndExplainOtherMarketingText));

        if (entryForm.ComparedOtherCompetitorsCheck != "" && entryForm.ComparedOtherCompetitorsCheck != null)
        {
            string[] ComparedOtherCompetitorsCheck = entryForm.ComparedOtherCompetitorsCheck.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (ComparedOtherCompetitorsCheck.Length != 0)
            {
                try
                {
                    body = body.Replace("###CompareATitleA###", ((ComparedOtherCompetitorsCheck[0].Replace(" ", "") == "True") ? check() : "" + " "));
                    body = body.Replace("###CompareATitleB###", ((ComparedOtherCompetitorsCheck[1].Replace(" ", "") == "True") ? check() : "" + " "));
                    body = body.Replace("###CompareATitleC###", ((ComparedOtherCompetitorsCheck[2].Replace(" ", "") == "True") ? check("center") : "" + " "));
                    body = body.Replace("###CompareATitleD###", ((ComparedOtherCompetitorsCheck[3].Replace(" ", "") == "True") ? check("center") : "" + " "));
                }
                catch { }
            }
        }


        if (entryForm.PaidMediaExpendituresCheck != "" && entryForm.PaidMediaExpendituresCheck != null)
        {
            string[] PME = entryForm.PaidMediaExpendituresCheck.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (PME.Length != 0)
            {
                //body = body.Replace("###PaidMediaExpendituresCurrent###", "<p style=\"color: #fff;\">-</p>");
                //body = body.Replace("###PaidMediaExpendituresPrior###", "<p style=\"color: #fff;\">-</p>");
                try
                {
                    body = body.Replace("###CurrentYear###", PME[0].Replace("  ", ""));
                    body = body.Replace("###YearPrior###", PME[1].Replace("  ", ""));

                    body = body.Replace("###PaidMediaExpendituresCurrent###", PME[2].Replace("  ", ""));
                    body = body.Replace("###PaidMediaExpendituresPrior###", PME[3].Replace("  ", ""));
                }
                catch
                {
                }
            }
        }

        if (entryForm.ComparedOverallSpendCheck != "" && entryForm.ComparedOverallSpendCheck != null)
        {
            string[] ComparedOverallSpendCheck = entryForm.ComparedOverallSpendCheck.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (ComparedOverallSpendCheck.Length != 0)
            {
                try
                {
                    body = body.Replace("###CompareBTitleA###", ((ComparedOverallSpendCheck[0].Replace(" ", "") == "True") ? check("center") : "" + " "));
                    body = body.Replace("###CompareBTitleB###", ((ComparedOverallSpendCheck[1].Replace(" ", "") == "True") ? check("center") : "" + " "));
                    body = body.Replace("###CompareBTitleC###", ((ComparedOverallSpendCheck[2].Replace(" ", "") == "True") ? check("center") : "" + " "));
                    body = body.Replace("###CompareBTitleD###", ((ComparedOverallSpendCheck[3].Replace(" ", "") == "True") ? check("center") : "" + " "));
                }
                catch { }
            }
        }

        body = body.Replace("###EntryTitle###", entry.Brand);
        body = body.Replace("###EntryID###", entry.Serial);

        body = body.Replace("###YouEnteringInto###", Data.GetCategoryMarket(entry.CategoryMarket));
        body = body.Replace("###EntryCategory###", entry.CategoryPSDetail);
        body = body.Replace("###CountryHeader###", entry.Effectiveness);
        body = body.Replace("###StartDate###", entry.DateCampaignStart.ToString("dd MMM yyyy"));
        body = body.Replace("###EndDate###", entry.DateCampaignEnd.ToString("dd MMM yyyy"));

        try
        {
            string countries = "";
            foreach (string country in entry.CaseData.Split('|'))
            {
                countries += country + ", ";
            }

            body = body.Replace("###Totalnumber###", (entry.CaseData.Split('|').Count() - 1).ToString());
            body = body.Replace("###CountriesList###", countries.Substring(0, countries.Length - 4) + ".");
        }
        catch
        {
            body = body.Replace("###Totalnumber###", "0");
            body = body.Replace("###CountriesList###", "No Country Selected.");
        }

        body = body.Replace("###ExecutiveSummary###", GeneralFunctionEntryForm.CheckTextfield(entryForm.ExecutiveSummary));
        body = body.Replace("###DescribeMarketBackground###", GeneralFunctionEntryForm.CheckTextfield(entryForm.DescribeMarket));

        if (entryForm.StrategicChallengeObjectives != "" && entryForm.StrategicChallengeObjectives != null)
        {
            string[] StrategicChallengeObjectivesList = entryForm.StrategicChallengeObjectives.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (StrategicChallengeObjectivesList.Length != 0)
            {
                try
                {
                    body = body.Replace("###StrategicChallengeObjectivesA###", GeneralFunctionEntryForm.CheckTextfield(StrategicChallengeObjectivesList[0]));
                    body = body.Replace("###StrategicChallengeObjectivesB###", GeneralFunctionEntryForm.CheckTextfield(StrategicChallengeObjectivesList[1]));
                    body = body.Replace("###StrategicChallengeObjectivesC###", GeneralFunctionEntryForm.CheckTextfield(StrategicChallengeObjectivesList[2]));
                    body = body.Replace("###StrategicChallengeObjectivesD###", GeneralFunctionEntryForm.CheckTextfield(StrategicChallengeObjectivesList[3]));
                    body = body.Replace("###StrategicChallengeObjectivesE###", GeneralFunctionEntryForm.CheckTextfield(StrategicChallengeObjectivesList[4]));
                    body = body.Replace("###StrategicChallengeObjectivesF###", GeneralFunctionEntryForm.CheckTextfield(StrategicChallengeObjectivesList[5]));
                }
                catch { }
            }
        }

        if (entryForm.Ideas != "" && entryForm.Ideas != null)
        {
            string[] IdeasList = entryForm.Ideas.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (IdeasList.Length != 0)
            {
                try {
                    body = body.Replace("###IdeaA###", GeneralFunctionEntryForm.CheckTextfield(IdeasList[0]));
                    body = body.Replace("###IdeaB###", GeneralFunctionEntryForm.CheckTextfield(IdeasList[1]));
                    body = body.Replace("###IdeaC###", GeneralFunctionEntryForm.CheckTextfield(IdeasList[2]));
                }
                catch { }
            }
        }

        body = body.Replace("###BringIdeaA###", GeneralFunctionEntryForm.CheckTextfield(entryForm.BringingIdea));

        body = body.Replace("###ExplainSelected###", GeneralFunctionEntryForm.CheckTextfield(entryForm.Other));
        body = body.Replace("###Elaborate###", GeneralFunctionEntryForm.CheckTextfield(entryForm.PaidMediaExpendituresText));
        body = body.Replace("###OwnedMedia###", GeneralFunctionEntryForm.CheckTextfield(entryForm.OwnedMedia));
        body = body.Replace("###Sponsorship###", GeneralFunctionEntryForm.CheckTextfield(entryForm.Sponsorship));

        if (entryForm.ExplainWorked != "" && entryForm.ExplainWorked != null)
        {
            string[] ExplainWorked = entryForm.ExplainWorked.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (ExplainWorked.Length != 0)
            {
                try
                {
                    body = body.Replace("###HowWorkedA###", GeneralFunctionEntryForm.CheckTextfield(ExplainWorked[0]));
                    body = body.Replace("###HowWorkedB###", GeneralFunctionEntryForm.CheckTextfield(ExplainWorked[1]));
                    body = body.Replace("###HowWorkedC###", GeneralFunctionEntryForm.CheckTextfield(ExplainWorked[2]));
                }
                catch { }
            }
        }

        body = body.Replace("###Anything###", GeneralFunctionEntryForm.CheckTextfield(entryForm.Anything));

        body = PopulateRowPTC(body);
        body = PopulateRowEOM(body);
        body = PopulateImages(body);

        return(body);
    }
Beispiel #10
0
    public static string PopulateRow(string body)
    {
        body = body.Replace("###Title###", "Entry Form");
        body = body.Replace("###Logo###", WebURL + "images/logo-apaceffie-high.png");
        body = body.Replace("###HeaderLogo###", WebURL + "images/Header-logo-pdf.png");
        body = body.Replace("###IconList###", WebURL + "images/icon-list.png");
        body = body.Replace("###DesTotalOfCountries###", entryForm.DesTotalOfCountries);

        body = body.Replace("###Product###", entry.ProductClassification);
        body = body.Replace("###BrandName###", entry.Brand);
        body = body.Replace("###ProductServiceClassification###", entry.Client);
        body = body.Replace("###EntryTitle###", entry.Campaign);

        body = body.Replace("###EntryID###", entry.Serial);
        body = body.Replace("###ExecutiveSummary###", GeneralFunctionEntryForm.CheckTextfield(entryForm.ExecutiveSummary));
        body = body.Replace("###DescribeMarket###", GeneralFunctionEntryForm.CheckTextfield(entryForm.DescribeMarket));
        body = body.Replace("###ExplainListOtherMarketing###", GeneralFunctionEntryForm.CheckTextfield(entryForm.Other));
        body = body.Replace("###PaidMediaExpendituresText###", GeneralFunctionEntryForm.CheckTextfield(entryForm.PaidMediaExpendituresText));

        body = body.Replace("###ExplainCriteria###", GeneralFunctionEntryForm.CheckTextfield(entryForm.ExplainCriteria));
        body = body.Replace("###BrandName###", entry.Campaign);
        body = body.Replace("###ProductServiceClassification###", entry.Client);
        body = body.Replace("###EntryTitle###", entry.Brand);

        body = body.Replace("###YouEnteringInto###", Data.GetCategoryMarket(entry.CategoryMarket));
        body = body.Replace("###EntryCategory###", entry.CategoryPSDetail);
        try
        {
            string countries = "";
            foreach (string country in entry.Effectiveness.Split('|'))
            {
                countries += country + ", ";
            }

            body = body.Replace("###CountryHeader###", countries.Substring(0, countries.Length - 4) + ".");

            body = body.Replace("###PMECountryA###", entry.Effectiveness.Split('|')[0].ToString());
            body = body.Replace("###PMECountryB###", entry.Effectiveness.Split('|')[1].ToString());
            body = body.Replace("###PMECountryC###", entry.Effectiveness.Split('|')[2].ToString());

            body = body.Replace("###MCCountryA###", entry.Effectiveness.Split('|')[0].ToString());
            body = body.Replace("###MCCountryB###", entry.Effectiveness.Split('|')[1].ToString());
            body = body.Replace("###MCCountryC###", entry.Effectiveness.Split('|')[2].ToString());

            body = body.Replace("###Country1###", entry.Effectiveness.Split('|')[0].ToString());
            body = body.Replace("###Country2###", entry.Effectiveness.Split('|')[1].ToString());
            body = body.Replace("###Country3###", entry.Effectiveness.Split('|')[2].ToString());
        }
        catch
        {
            body = body.Replace("###CountryHeader###", "No Country Selected.");
        }

        body = body.Replace("###StartDate###", entry.DateCampaignStart.ToString("dd MMM yyyy"));
        body = body.Replace("###EndDate###", entry.DateCampaignEnd.ToString("dd MMM yyyy"));

        body = body.Replace("###Elaborate###", GeneralFunctionEntryForm.CheckTextfield(entryForm.PaidMediaExpendituresText));
        body = body.Replace("###OwnedMedia###", GeneralFunctionEntryForm.CheckTextfield(entryForm.OwnedMedia));
        body = body.Replace("###Sponsorship###", GeneralFunctionEntryForm.CheckTextfield(entryForm.Sponsorship));

        if (entryForm.BringingIdea != "" && entryForm.BringingIdea != null)
        {
            string[] BringingIdea = entryForm.BringingIdea.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (BringingIdea.Length != 0)
            {
                try {
                    body = body.Replace("###BringingIdeaA###", GeneralFunctionEntryForm.CheckTextfield(BringingIdea[0]));
                    body = body.Replace("###BringingIdeaB###", GeneralFunctionEntryForm.CheckTextfield(BringingIdea[1]));
                }
                catch { }
            }
        }

        body = body.Replace("###BudgetElaboration###", GeneralFunctionEntryForm.CheckTextfield(entryForm.PaidMediaExpendituresIndicate));

        if (entryForm.PaidMediaExpendituresAstimates != "" && entryForm.PaidMediaExpendituresAstimates != null)
        {
            string[] PaidMediaExpendituresAstimates = entryForm.PaidMediaExpendituresAstimates.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (PaidMediaExpendituresAstimates.Length != 0)
            {
                try {
                    body = body.Replace("###MediaBudgetA###", GeneralFunctionEntryForm.CheckTextfield(PaidMediaExpendituresAstimates[0]));
                    body = body.Replace("###MediaBudgetB###", GeneralFunctionEntryForm.CheckTextfield(PaidMediaExpendituresAstimates[1]));
                    body = body.Replace("###MediaBudgetC###", GeneralFunctionEntryForm.CheckTextfield(PaidMediaExpendituresAstimates[2]));
                }
                catch { }
            }
        }

        if (entryForm.PaidMediaExpendituresAveregeAnnual != "" && entryForm.PaidMediaExpendituresAveregeAnnual != null)
        {
            string[] PaidMediaExpendituresAveregeAnnual = entryForm.PaidMediaExpendituresAveregeAnnual.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (PaidMediaExpendituresAveregeAnnual.Length != 0)
            {
                try {
                    body = body.Replace("###AnualBadgeA###", string.IsNullOrEmpty(PaidMediaExpendituresAveregeAnnual[0]) ? "" : PaidMediaExpendituresAveregeAnnual[0]);
                    body = body.Replace("###AnualBadgeB###", string.IsNullOrEmpty(PaidMediaExpendituresAveregeAnnual[1]) ? "" : PaidMediaExpendituresAveregeAnnual[1]);
                    body = body.Replace("###AnualBadgeC###", string.IsNullOrEmpty(PaidMediaExpendituresAveregeAnnual[2]) ? "" : PaidMediaExpendituresAveregeAnnual[2]);
                }
                catch { }
            }
        }

        if (entryForm.PaidMediaExpendituresTotalBudget != "" && entryForm.PaidMediaExpendituresTotalBudget != null)
        {
            string[] PaidMediaExpendituresTotalBudget = entryForm.PaidMediaExpendituresTotalBudget.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (PaidMediaExpendituresTotalBudget.Length != 0)
            {
                try {
                    body = body.Replace("###ApproximateBudgetA###", GeneralFunctionEntryForm.CheckTextfield(PaidMediaExpendituresTotalBudget[0]));
                    body = body.Replace("###ApproximateBudgetB###", GeneralFunctionEntryForm.CheckTextfield(PaidMediaExpendituresTotalBudget[1]));
                    body = body.Replace("###ApproximateBudgetC###", GeneralFunctionEntryForm.CheckTextfield(PaidMediaExpendituresTotalBudget[2]));
                }
                catch { }
            }
        }

        try
        {
            string countries = "";
            foreach (string country in entry.CaseData.Split('|'))
            {
                countries += country + ", ";
            }

            body = body.Replace("###Totalnumber###", (entry.CaseData.Split('|').Count() - 1).ToString());
            body = body.Replace("###CountriesList###", countries.Substring(0, countries.Length - 4) + ".");
        }
        catch
        {
            body = body.Replace("###Totalnumber###", "0");
            body = body.Replace("###CountriesList###", "No Country Selected.");
        }

        if (entryForm.StrategicChallengeObjectives != "" && entryForm.StrategicChallengeObjectives != null)
        {
            string[] StrategicChallengeObjectivesList = entryForm.StrategicChallengeObjectives.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (StrategicChallengeObjectivesList.Length != 0)
            {
                try
                {
                    body = body.Replace("###StrategicChallengeObjectivesA###", GeneralFunctionEntryForm.CheckTextfield(StrategicChallengeObjectivesList[0]));
                    body = body.Replace("###StrategicChallengeObjectivesB###", GeneralFunctionEntryForm.CheckTextfield(StrategicChallengeObjectivesList[1]));
                    body = body.Replace("###StrategicChallengeObjectivesC###", GeneralFunctionEntryForm.CheckTextfield(StrategicChallengeObjectivesList[2]));
                    body = body.Replace("###StrategicChallengeObjectivesD###", GeneralFunctionEntryForm.CheckTextfield(StrategicChallengeObjectivesList[3]));
                }
                catch { }
            }
        }

        if (entryForm.Ideas != "" && entryForm.Ideas != null)
        {
            string[] IdeasList = entryForm.Ideas.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (IdeasList.Length != 0)
            {
                try
                {
                    body = body.Replace("###IdeasA###", GeneralFunctionEntryForm.CheckTextfield(IdeasList[0]));
                    body = body.Replace("###IdeasB###", GeneralFunctionEntryForm.CheckTextfield(IdeasList[1]));
                    body = body.Replace("###IdeasC###", GeneralFunctionEntryForm.CheckTextfield(IdeasList[2]));
                    body = body.Replace("###IdeasD###", GeneralFunctionEntryForm.CheckTextfield(IdeasList[3]));
                }
                catch { }
            }
        }


        if (entryForm.ComparedOtherCompetitorsCheck != "" && entryForm.ComparedOtherCompetitorsCheck != null)
        {
            string[] ComparedOtherCompetitorsCheck = entryForm.ComparedOtherCompetitorsCheck.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (ComparedOtherCompetitorsCheck.Length != 0)
            {
                try
                {
                    body = body.Replace("###CompareATitleA###", ((ComparedOtherCompetitorsCheck[0].Replace(" ", "") == "True") ? check() : "" + " "));
                    body = body.Replace("###CompareATitleB###", ((ComparedOtherCompetitorsCheck[1].Replace(" ", "") == "True") ? check() : "" + " "));
                    body = body.Replace("###CompareATitleC###", ((ComparedOtherCompetitorsCheck[2].Replace(" ", "") == "True") ? check("center") : "" + " "));
                    body = body.Replace("###CompareATitleD###", ((ComparedOtherCompetitorsCheck[3].Replace(" ", "") == "True") ? check("center") : "" + " "));
                }
                catch { }
            }
        }

        if (entryForm.ComparedOverallSpendCheck != "" && entryForm.ComparedOverallSpendCheck != null)
        {
            string[] ComparedOverallSpendCheck = entryForm.ComparedOverallSpendCheck.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (ComparedOverallSpendCheck.Length != 0)
            {
                try {
                    body = body.Replace("###CompareBTitleA###", ((ComparedOverallSpendCheck[0].Replace(" ", "") == "True") ? check("center") : "" + " "));
                    body = body.Replace("###CompareBTitleB###", ((ComparedOverallSpendCheck[1].Replace(" ", "") == "True") ? check("center") : "" + " "));
                    body = body.Replace("###CompareBTitleC###", ((ComparedOverallSpendCheck[2].Replace(" ", "") == "True") ? check("center") : "" + " "));
                    body = body.Replace("###CompareBTitleD###", ((ComparedOverallSpendCheck[3].Replace(" ", "") == "True") ? check("center") : "" + " "));
                }
                catch { }
            }
        }

        if (entryForm.ExplainWorked != "" && entryForm.ExplainWorked != null)
        {
            string[] ExplainWorked = entryForm.ExplainWorked.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            if (ExplainWorked.Length != 0)
            {
                try
                {
                    body = body.Replace("###HowWorkedA###", GeneralFunctionEntryForm.CheckTextfield(ExplainWorked[0]));
                    body = body.Replace("###HowWorkedB###", GeneralFunctionEntryForm.CheckTextfield(ExplainWorked[1]));
                    body = body.Replace("###HowWorkedC###", GeneralFunctionEntryForm.CheckTextfield(ExplainWorked[2]));
                    body = body.Replace("###HowWorkedD###", GeneralFunctionEntryForm.CheckTextfield(ExplainWorked[3]));
                }
                catch { }
            }
        }

        body = body.Replace("###Anything###", GeneralFunctionEntryForm.CheckTextfield(entryForm.Anything));

        body = PopulateRowPTC(body);
        body = PopulateRowEOM(body);
        body = PopulateRowPME(body);
        body = PopulateImages(body);

        return(body);
    }
Beispiel #11
0
    protected void btnPreview_Click(object sender, EventArgs e)
    {
        string url = "../Main/" + GeneralFunctionEntryForm.GetEntryCategory(entry) + "PDF.aspx?Id=" + entry.Id;

        Page.RegisterClientScriptBlock("openWindow", "<script>window.open('" + url + "', '_blank');</script>");
    }
Beispiel #12
0
    private void PopulateForm()
    {
        GeneralFunction.GetAllScoreCache(true);
        score = GeneralFunction.GetScoreFromMatchingEntryCache(entry, jury.Id, round);
        GeneralFunction.SetddlNomination(ref ddlNomination);

        // Jury Info
        lbJuryId.Text   = jury.SerialNo;
        lbJuryName.Text = jury.FirstName + " " + jury.LastName;
        lbCompany.Text  = jury.Company;
        lbRound.Text    = round;

        //string panel = "";
        //if (round == "1") panel = jury.Round1PanelId;
        //if (round == "2") panel = jury.Round2PanelId;
        //lbPanel.Text = panel;

        // panel information, filter off inactive panels
        SystemData sys           = GeneralFunction.GetSystemData();
        string     jurypanelinfo = jury.Round1PanelId;
        string     activepanels  = sys.ActivePanelsRound1;

        if (round == "2")
        {
            jurypanelinfo = jury.Round2PanelId;
            activepanels  = sys.ActivePanelsRound2;
        }
        string[] jurypanelinfoitem = jurypanelinfo.Split('|');

        for (int i = 0; i < jurypanelinfoitem.Length; i++)
        {
            if (GeneralFunction.IsInList(jurypanelinfoitem[i], activepanels, '|'))
            {
                lbPanel.Text += jurypanelinfoitem[i] + "&nbsp;";
            }
        }



        lbScoreCompletion.Text = "Pending";
        if (score != null && score.IsSubmitted)
        {
            lbScoreCompletion.Text = "Completed";
        }


        // Entry Info
        lbEntryId.Text  = entry.Serial;
        lbTitle.Text    = entry.Campaign;
        lbCategory.Text = GeneralFunction.GetEntryMarket(entry.CategoryMarketFromRound(round)) + "<br/>" + entry.CategoryPSDetailFromRound(round);
        lbBrand.Text    = entry.Brand;
        lbClient.Text   = entry.Client;

        // uploads - entry form
        #region old method
        //if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Entry\\" + entry.Id.ToString() + "\\" + entry.Serial + "_EntryForm_PDF.pdf"))
        //{
        //    lnkEntryFormPDF.Visible = true;
        //    lnkEntryFormPDF.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Entry/" + entry.Id.ToString() + "/" + entry.Serial + "_EntryForm_PDF.pdf?" + DateTime.Now.Ticks.ToString();
        //}
        #endregion
        #region new method
        try
        {
            EntryForm entryForm = EntryForm.GetEntryForm(Guid.Empty, entry.Id);
            if (entryForm.Status != StatusEntry.Draft)
            {
                string url = "../Main/" + GeneralFunctionEntryForm.GetEntryCategory(entry) + "PDF.aspx?Id=" + entry.Id;

                lnkEntryFormPDF.Visible     = true;
                lnkEntryFormPDF.NavigateUrl = url;
            }
        }
        catch
        {
        }
        #endregion

        // entry form word is not shown to jury
        //if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Entry\\" + entry.Id.ToString() + "\\" + entry.Serial + "_EntryForm_Word.doc"))
        //{
        //    lnkEntryFormDOC.Visible = true;
        //    lnkEntryFormDOC.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Entry/" + entry.Id.ToString() + "/" + entry.Serial + "_EntryForm_Word.docx";
        //}
        //else if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Entry\\" + entry.Id.ToString() + "\\" + entry.Serial + "_EntryForm_Word.docx"))
        //{
        //    lnkEntryFormDOC.Visible = true;
        //    lnkEntryFormDOC.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Entry/" + entry.Id.ToString() + "/" + entry.Serial + "_EntryForm_Word.docx";
        //}


        //// uploads - authorization form
        //// not shown to jury, aspx commented out
        //if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Authorisation\\" + entry.Id.ToString() + "\\" + entry.Serial + "_AuthorizationForm_PDF.pdf"))
        //{
        //    lnkAutPDF.Visible = true;
        //    lnkAutPDF.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Authorisation/" + entry.Id.ToString() + "/" + entry.Serial + "_AuthorizationForm_PDF.pdf";
        //}


        //// uploads - case image
        //// not shown to jury, aspx commented out
        //if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Case\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CaseImage.jpg"))
        //{
        //    lnkCaseImage.Visible = true;
        //    lnkCaseImage.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Case/" + entry.Id.ToString() + "/" + entry.Serial + "_CaseImage.jpeg";
        //}
        //if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Case\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CaseImage.jpeg"))
        //{
        //    lnkCaseImage.Visible = true;
        //    lnkCaseImage.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Case/" + entry.Id.ToString() + "/" + entry.Serial + "_CaseImage.jpeg";
        //}


        // uploads - creative materials
        if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Creative\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CreativeMaterials_PDF.pdf"))
        {
            lnkCreativePDF.Visible     = true;
            lnkCreativePDF.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Creative/" + entry.Id.ToString() + "/" + entry.Serial + "_CreativeMaterials_PDF.pdf?" + DateTime.Now.Ticks.ToString();
        }
        if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\Creative\\" + entry.Id.ToString() + "\\" + entry.Serial + "_CreativeMaterialsTranslate_PDF.pdf"))
        {
            lnkCreativePDFTranslate.Visible     = true;
            lnkCreativePDFTranslate.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload/Creative/" + entry.Id.ToString() + "/" + entry.Serial + "_CreativeMaterialsTranslate_PDF.pdf?" + DateTime.Now.Ticks.ToString();
        }
        //if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\CreativeVideo\\"  + entry.Serial + "_CreativeMaterials_Video.mp4"))
        //{
        //    //btnCreativeVid.Visible = true;
        //    //btnCreativeVid.CommandArgument = "EntryUpload/Creative/" + entry.Id.ToString() + "/" + entry.Serial + "_CreativeMaterials_Video.mp4";
        //    lnkCreativeVid.Visible = true;
        //    lnkCreativeVid.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"))
        {
            //btnCreativeVid.Visible = true;
            //btnCreativeVid.CommandArgument = "EntryUpload/Creative/" + entry.Id.ToString() + "/" + entry.Serial + "_CreativeMaterials_Video.mp4";
            lnkCreativeVid.Visible     = true;
            lnkCreativeVid.NavigateUrl = System.Configuration.ConfigurationManager.AppSettings["AWSS3WebURL"] + System.Configuration.ConfigurationManager.AppSettings["AWSBucket_Small"] + "/" + entry.Serial + "_CreativeMaterials_Video.mp4?" + DateTime.Now.Ticks.ToString();
        }
        else
        if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\CreativeVideo\\" + entry.Serial + "_CreativeMaterials_Video.mp4"))
        {
            lnkCreativeVid.Visible     = true;
            lnkCreativeVid.NavigateUrl = System.Configuration.ConfigurationSettings.AppSettings["storageVirtualPath"] + "EntryUpload\\CreativeVideo\\" + entry.Serial + "_CreativeMaterials_Video.mp4";
        }

        // scores
        if (score != null)
        {
            txtSC.Text         = score.ScoreSC.ToString();
            txtID.Text         = score.ScoreID.ToString();
            txtIL.Text         = score.ScoreIL.ToString();
            txtRE.Text         = score.ScoreRE.ToString();
            lbCScoreTotal.Text = score.ScoreComposite.ToString();

            // calculations
            lbCScoreSC.Text    = GeneralFunction.CalculateSC(score.ScoreSC).ToString("N");
            lbCScoreID.Text    = GeneralFunction.CalculateID(score.ScoreID).ToString("N");
            lbCScoreIL.Text    = GeneralFunction.CalculateIL(score.ScoreIL).ToString("N");
            lbCScoreRE.Text    = GeneralFunction.CalculateRE(score.ScoreRE).ToString("N");
            lbCScoreTotal.Text = GeneralFunction.CalculateCompositeScore(score.ScoreSC, score.ScoreID, score.ScoreIL, score.ScoreRE).ToString("N");

            txtFeedbackStrong.Text  = score.FeedbackStrong;
            txtFeedbackWeak.Text    = score.FeedbackWeak;
            ddlFlag.SelectedValue   = score.Flag;
            txtFlagOthers.Text      = score.FlagOthers;
            ddlRecuse.SelectedValue = "No";
            if (score.IsRecuse)
            {
                ddlRecuse.SelectedValue = "Yes";
            }
            txtRecuseRemarks.Text           = score.RecuseRemarks;
            txtAdditionalComments.Text      = score.AdditionalComments;
            ddlRecommendation.SelectedValue = (score.IsAdvancement) ? "Yes" : "No";
            ddlNomination.SelectedValue     = score.Nomination;
        }

        ddlRecommendation.Attributes.Add("onchange", "OnChangeddlRecom('" + AdvancementFlag.ClientID + "','" + ddlRecommendation.ClientID + "', '" + round + "');");


        // enable or disable
        ddlRecuse_SelectedIndexChanged(null, null);


        // admin spoof to disable the form fields and submission
        //btnSave.Visible = !isAdminSpoof;
        //btnSubmit.Visible = !isAdminSpoof;
        if (isAdminSpoof)
        {
            GeneralFunction.ChangeStateControls(this, false);
        }



        if (score != null && score.IsSubmitted)
        {
            btnSave.Visible      = false;
            btnSaveDraft.Visible = false;

            GeneralFunction.ChangeStateControls(this, false);
        }
    }
Beispiel #13
0
    private void PopulateForm()
    {
        // Pop the jpc data
        JuryPanelCategoryList jpcList = JuryPanelCategoryList.GetJuryPanelCategoryList("", "");

        DropDownList firstDdl = null;
        DropDownList secDdl   = null;
        int          rptCount = 0;
        int          rptJPC   = 0;

        foreach (RepeaterItem item in rptPanel.Items)
        {
            string thispanelno = ((Label)item.FindControl("lbPanelNo")).Text;
            // loop all the ddls in the repeater for a match

            List <JuryPanelCategory> filteredJPCList = jpcList.Where(m => m.PanelId.Equals(thispanelno) && m.Round == round).OrderBy(m => m.OrderNo).ToList();



            foreach (JuryPanelCategory jpc in filteredJPCList)
            {
                //if (jpc.Round == round)
                //{
                for (int i = 1; i <= numberOfCats; i++)
                {
                    DropDownList ddlCategory = (DropDownList)item.FindControl("ddlCategory" + i.ToString());
                    if (thispanelno == jpc.PanelId && i == jpc.OrderNo)
                    {
                        if (rptJPC == 0 && rptCount == 0)
                        {
                            firstDdl = ddlCategory;
                        }
                        if (rptJPC == 1 && rptCount == 0)
                        {
                            secDdl = ddlCategory;
                        }

                        ddlCategory.SelectedValue = jpc.CategoryPSDetail;
                        //PopulateAllDDL(ddlCategory);
                        PopulateNumberEntries(ddlCategory);
                    }
                }
                //}
                rptJPC++;
            }
            rptCount++;
        }

        PopulateAllDDL(firstDdl);
        PopulateAllDDL(secDdl);


        // Hide the save as draft if all confirmed
        if (jpcList.Count > 0)
        {
            btnSave.Visible = !jpcList[0].IsActive;
            if (!jpcList[0].IsActive)
            {
                btnConfirm.Attributes.Add("onclick", "return confirm('Confirm to submit?');");
            }
        }
        else
        {
            btnConfirm.Attributes.Add("onclick", "return confirm('Confirm to submit?');");
        }

        if (Security.IsReadOnlyAdmin())
        {
            GeneralFunctionEntryForm.DisableAllAction(this, false);
            btnConfirm.Visible = !Security.IsReadOnlyAdmin();
        }
    }
Beispiel #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;

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