Esempio n. 1
0
    public void CollectExplainListOtherMarketing()
    {
        for (int x = 0; x <= Data.ExplainListOtherMarketingData.GetUpperBound(0); x++)
        {
            Data.ExplainListOtherMarketingViewmodel ELOM = new Data.ExplainListOtherMarketingViewmodel();
            ELOM.id = Data.ExplainListOtherMarketingData[x, 0];
            ELOM.MarketingComponents = Data.ExplainListOtherMarketingData[x, 1];
            ELOM.TimePeriod          = null;
            explainOtherMarketingList.Add(ELOM);
        }

        if (entryForm != null)
        {
            string[] ELOMG = entryForm.ExplainListOtherMarketing.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            List <Data.ExplainListOtherMarketingViewmodel> explainOtherMarketingListTemp = new List <Data.ExplainListOtherMarketingViewmodel>();

            if (ELOMG.Count() != 0)
            {
                for (int i = 0; i < ELOMG.Length; i++)
                {
                    string[] Datas = ELOMG[i].Split(':');

                    if (Datas[0] == "998")
                    {
                        txtOtherExplainOtherMarket1.Text = Datas[1];
                    }
                    else if (Datas[0] == "999")
                    {
                        txtOtherExplainOtherMarket2.Text = Datas[1];
                    }
                    else
                    {
                        try
                        {
                            Data.ExplainListOtherMarketingViewmodel ELOM = explainOtherMarketingList.FirstOrDefault(x => x.id == Datas[0]);
                            ELOM.TimePeriod = Datas[1];
                            explainOtherMarketingListTemp.Add(ELOM);
                        }
                        catch
                        {
                            //TODO
                        }
                    }
                }
                RPTExplainOtherMarket.DataSource = explainOtherMarketingListTemp;
            }
            else
            {
                RPTExplainOtherMarket.DataSource = explainOtherMarketingList;
            }
        }
        else
        {
            RPTExplainOtherMarket.DataSource = explainOtherMarketingList;
        }

        RPTExplainOtherMarket.DataBind();
    }
Esempio n. 2
0
    public void CollectExplainListOtherMarketing()
    {
        explainOtherMarketingList = Data.GetListExplainPoitAllOthers();

        if (entryForm != null)
        {
            string[] ELOMG = entryForm.ExplainListOtherMarketing.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);
            List <Data.ExplainListOtherMarketingViewmodel> explainOtherMarketingListTemp = new List <Data.ExplainListOtherMarketingViewmodel>();

            if (ELOMG.Count() != 0)
            {
                for (int i = 0; i < ELOMG.Length; i++)
                {
                    string[] Datas = ELOMG[i].Split(':');

                    if (Datas[0] == "999")
                    {
                        txtOtherSingleMarket.Text = Datas[1];
                    }
                    else if (Datas[0] == "998")
                    {
                        cbOtherSingleMarket.Checked = (Datas[1] == "True") ? true : false;
                    }
                    else
                    {
                        try
                        {
                            Data.ExplainListOtherMarketingViewmodel ELOM = explainOtherMarketingList.FirstOrDefault(x => x.id == Datas[0]);
                            ELOM.TimePeriod = Datas[1];
                            explainOtherMarketingListTemp.Add(ELOM);
                        }
                        catch
                        {
                            //TODO
                        }
                    }
                }
                RPTExplainOtherMarket.DataSource = explainOtherMarketingListTemp;
            }
            else
            {
                RPTExplainOtherMarket.DataSource = explainOtherMarketingList;
            }
        }
        else
        {
            RPTExplainOtherMarket.DataSource = explainOtherMarketingList;
        }


        RPTExplainOtherMarket.DataBind();
    }
Esempio n. 3
0
    protected void RPTExplainOtherMarket_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Data.ExplainListOtherMarketingViewmodel item = (Data.ExplainListOtherMarketingViewmodel)e.Item.DataItem;

            HiddenField hd     = (HiddenField)e.Item.FindControl("hdItemId");
            Label       title  = (Label)e.Item.FindControl("Title");
            CheckBox    cbItem = (CheckBox)e.Item.FindControl("cbItem");
            cbItem.Checked = (item.TimePeriod == "True") ? true : false;
            hd.Value       = item.id;
            title.Text     = item.MarketingComponents;
        }
    }
Esempio n. 4
0
    protected void RPTExplainOtherMarket_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Data.ExplainListOtherMarketingViewmodel item = (Data.ExplainListOtherMarketingViewmodel)e.Item.DataItem;

            HiddenField hd         = (HiddenField)e.Item.FindControl("hdItemId");
            Label       title      = (Label)e.Item.FindControl("MarketingComponents");
            TextBox     TimePeriod = (TextBox)e.Item.FindControl("txtTimePeriod");
            hd.Value        = item.id;
            title.Text      = item.MarketingComponents;
            TimePeriod.Text = item.TimePeriod;
        }
    }
Esempio n. 5
0
    public static string PopulateRowEOM(string body)
    {
        for (int x = 0; x <= Data.ExplainListOtherMarketingData.GetUpperBound(0); x++)
        {
            Data.ExplainListOtherMarketingViewmodel ELOM = new Data.ExplainListOtherMarketingViewmodel();
            ELOM.id = Data.ExplainListOtherMarketingData[x, 0];
            ELOM.MarketingComponents = Data.ExplainListOtherMarketingData[x, 1];
            ELOM.TimePeriod          = null;
            explainOtherMarketingList.Add(ELOM);
        }

        if (entryForm != null)
        {
            string[] ELOMG = entryForm.ExplainListOtherMarketing.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);

            if (ELOMG.Count() != 0)
            {
                for (int i = 0; i < ELOMG.Length; i++)
                {
                    string[] Datas = ELOMG[i].Split(':');

                    if (Datas[0] == "998")
                    {
                        body = body.Replace("###OtherMC1###", Datas[1]);
                    }
                    else if (Datas[0] == "999")
                    {
                        body = body.Replace("###OtherMC2###", Datas[1]);
                    }
                    else
                    {
                        try
                        {
                            Data.ExplainListOtherMarketingViewmodel ELOM = explainOtherMarketingList.FirstOrDefault(x => x.id == Datas[0]);
                            ELOM.TimePeriod = Datas[1];

                            body = body.Replace("###MCTitle" + Datas[0] + "###", ELOM.MarketingComponents);
                            body = body.Replace("###MCDataA" + Datas[0] + "###", Datas[1]);
                        }
                        catch
                        {
                        }
                    }
                }
            }
        }

        return(body);
    }
Esempio n. 6
0
    public static string PopulateRowEOM(string body)
    {
        explainOtherMarketingList = Data.GetListExplainPoitAllOthers();

        if (entryForm != null)
        {
            string[] ELOMG = entryForm.ExplainListOtherMarketing.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries);

            if (ELOMG.Count() != 0)
            {
                for (int i = 0; i < ELOMG.Length; i++)
                {
                    string[] Datas = ELOMG[i].Split(':');


                    if (Datas[0] == "999")
                    {
                        body = body.Replace("###OtherMC2###", Datas[1]);
                    }
                    else if (Datas[0] == "998")
                    {
                        body = body.Replace("###OtherMC1###", (Datas[1] == "True") ? check() : "");
                    }

                    else
                    {
                        try
                        {
                            Data.ExplainListOtherMarketingViewmodel ELOM = explainOtherMarketingList.FirstOrDefault(x => x.id == Datas[0]);
                            ELOM.TimePeriod = Datas[1];

                            body = body.Replace("###MCTitleA" + Datas[0] + "###", ELOM.MarketingComponents);
                            body = body.Replace("###MCDataA" + Datas[0] + "###", (Datas[1] == "True") ? check() : "");
                        }
                        catch
                        {
                        }
                    }
                }
            }
        }

        return(body);
    }