public static string PopulateRowPTC(string body) { CTPList = Data.GetCommunicationTouchPointCountryMulti(); if (entryForm != null) { List <Data.CountriesList> CTPListTemp = new List <Data.CountriesList>(); string[] communicationTouchPointsList = entryForm.CommunicationTouchPointsCheck.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries); if (communicationTouchPointsList.Count() != 0) { for (int i = 0; i < communicationTouchPointsList.Length; i++) { string[] Datas = communicationTouchPointsList[i].Split(new string[] { Delimiter[1] }, System.StringSplitOptions.RemoveEmptyEntries); string[] count1 = Datas[0].Split(':'); if (count1[0] == "998") { body = body.Replace("###OtherDataCTP2###", (count1[1] == "True") ? check() : ""); } if (count1[0] == "999") { body = body.Replace("###OtherDataCTP1###", count1[1]); } else { try { Data.CollectData CT = CTPList.FirstOrDefault(x => x.id == count1[0]); CT.Data1 = Datas[0].Split(':')[1]; CT.Data2 = Datas[1].Split(':')[1]; CT.Data3 = Datas[2].Split(':')[1]; if (CT.AttrType == "Header" || CT.AttrType == "SingleHeader") { body = body.Replace("###CTPTitle" + count1[0] + "###", "<strong>" + CT.Title + "</strong>"); } else { body = body.Replace("###CTPTitle" + count1[0] + "###", "- " + CT.Title); } body = body.Replace("###CTPDataA" + count1[0] + "###", (CT.Data1 == "True") ? check() : ""); body = body.Replace("###CTPDataB" + count1[0] + "###", (CT.Data2 == "True") ? check() : ""); body = body.Replace("###CTPDataC" + count1[0] + "###", (CT.Data3 == "True") ? check() : ""); } catch { //TODO } } } } } return(body); }
public void CollectCommunicationTouchPoints() { CTPList = Data.GetCommunicationTouchPointData(); if (entryForm != null) { string[] CTPInitialdb = entryForm.CommunicationTouchPointsInitialYear.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries); string[] CTPCurrentdb = entryForm.CommunicationTouchPointsCurrentYear.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries); string[] CTPInterimdb = entryForm.CommunicationTouchPointsInterimYear.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries); if (CTPInitialdb.Count() != 0) { for (int i = 0; i < CTPCurrentdb.Length; i++) { if (CTPCurrentdb[i].Split(':')[0] == "999") { cbOtherCTP4.Text = CTPCurrentdb[i].Split(':')[1]; break; } string[] Initial = CTPInitialdb[i].Split(':'); string[] Interim = CTPInterimdb[i].Split(':'); string[] Current = CTPCurrentdb[i].Split(':'); if (Initial[0] == "000") { DdlInitialYear.Text = Initial[1]; DdlInterimYear.Text = Interim[1]; DdlCurrentYear.Text = Current[1]; } else if (Initial[0] == "998") { txtOtherCTP1.Text = Initial[1]; cbOtherCTP2.Text = Interim[1]; cbOtherCTP3.Text = Current[1]; } else { try { Data.CollectData CT = CTPList.FirstOrDefault(x => x.id == Initial[0]); CT.Data1 = Initial[1]; CT.Data2 = Interim[1]; CT.Data3 = Current[1]; } catch { rptCTP.DataSource = CTPList; } } } } } rptCTP.DataSource = CTPList; rptCTP.DataBind(); }
public void CollectCommunicationTouchPoints() { List <Data.CollectData> CTPList = Data.GetCTPMulti(); if (entryForm != null) { string[] communicationTouchPointsList = entryForm.CommunicationTouchPointsCheck.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries); if (communicationTouchPointsList.Count() != 0) { for (int i = 0; i < communicationTouchPointsList.Length; i++) { string[] Datas = communicationTouchPointsList[i].Split(new string[] { Delimiter[1] }, System.StringSplitOptions.RemoveEmptyEntries); string[] Data1 = null; string[] Data2 = null; string[] Data3 = null; string[] Data4 = null; if (Datas.Length >= 3) { Data1 = Datas[0].Split(':'); Data2 = Datas[1].Split(':'); Data3 = Datas[2].Split(':'); Data4 = Datas[3].Split(':'); if (Data1[0] == "998") { string[] Data5 = Datas[3].Split(':'); txtOtherCTP2.Text = Data1[1]; OtherPreDuringPost1.Checked = (Data2[1] == "True") ? true : false; OtherPreDuringPost2.Checked = (Data3[1] == "True") ? true : false; OtherPreDuringPost3.Checked = (Data4[1] == "True") ? true : false; } else { try { Data.CollectData CT = CTPList.FirstOrDefault(x => x.id == Data1[0]); CT.Data1 = Data1[1]; CT.Data2 = Data2[1]; CT.Data3 = Data3[1]; CT.Data4 = Data4[1]; } catch { //TODO } } } } } } rptCTP.DataSource = CTPList; rptCTP.DataBind(); }
protected void RPTPaidMedia_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Data.CollectData item = (Data.CollectData)e.Item.DataItem; HiddenField hd = (HiddenField)e.Item.FindControl("hdItemId"); Label title1 = (Label)e.Item.FindControl("Title1"); CheckBox cbItem1 = (CheckBox)e.Item.FindControl("cbItem1"); Label title2 = (Label)e.Item.FindControl("Title2"); CheckBox cbItem2 = (CheckBox)e.Item.FindControl("cbItem2"); cbItem1.Checked = (item.Data1 == "True") ? true : false; cbItem2.Checked = (item.Data2 == "True") ? true : false; hd.Value = item.id; title1.Text = item.Title; title2.Text = item.Title; } }
protected void rptCTP_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Data.CollectData item = (Data.CollectData)e.Item.DataItem; HiddenField hd = (HiddenField)e.Item.FindControl("hdItemId"); Literal title = (Literal)e.Item.FindControl("Title"); TextBox Initial = (TextBox)e.Item.FindControl("txtInitial"); TextBox Interim = (TextBox)e.Item.FindControl("txtInterim"); TextBox Current = (TextBox)e.Item.FindControl("txtCurrent"); hd.Value = item.id; title.Text = item.Title; Initial.Text = item.Data1; Interim.Text = item.Data2; Current.Text = item.Data3; } }
public void CollectCommunicationTouchPoints() { List <Data.CollectData> CTPPCEList = Data.GetCTPPCE(); if (entryForm != null) { string[] communicationTouchPointsList = entryForm.CommunicationTouchPointsCheck.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries); if (communicationTouchPointsList.Count() != 0) { for (int i = 0; i < communicationTouchPointsList.Length; i++) { string[] Datas = communicationTouchPointsList[i].Split(new string[] { Delimiter[1] }, System.StringSplitOptions.RemoveEmptyEntries); string[] count1 = Datas[0].Split(':'); if (count1[0] == "998") { cbOtherCTP1.Checked = (count1[1] == "True") ? true : false; } else if (count1[0] == "999") { txtOtherCTP2.Text = count1[1]; } else { try { Data.CollectData CT = CTPPCEList.FirstOrDefault(x => x.id == count1[0]); CT.Data1 = Datas[0].Split(':')[1]; } catch { //TODO } } } } } rptCTP.DataSource = CTPPCEList; rptCTP.DataBind(); }
protected void rptCTP_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Data.CollectData item = (Data.CollectData)e.Item.DataItem; HiddenField hd = (HiddenField)e.Item.FindControl("hdItemId"); HiddenField hdAttrType = (HiddenField)e.Item.FindControl("hdAttrType"); Label title = (Label)e.Item.FindControl("Title"); CheckBox cbItem = (CheckBox)e.Item.FindControl("cbItem"); CheckBox PreDuringPost1 = (CheckBox)e.Item.FindControl("PreDuringPost1"); CheckBox PreDuringPost2 = (CheckBox)e.Item.FindControl("PreDuringPost2"); CheckBox PreDuringPost3 = (CheckBox)e.Item.FindControl("PreDuringPost3"); hdAttrType.Value = item.AttrType; hd.Value = item.id; title.Text = item.Title; cbItem.Checked = (item.Data1 == "True") ? true : false; PreDuringPost1.Checked = (item.Data2 == "True") ? true : false; PreDuringPost2.Checked = (item.Data3 == "True") ? true : false; PreDuringPost3.Checked = (item.Data4 == "True") ? true : false; title.Text = item.Title; if (item.AttrType == "Header" || item.AttrType == "SingleHeader") { title.Text = "<span style=\" font-size: 14px; \">" + item.Title + "</span>"; title.Font.Bold = true; cbItem.Visible = false; } else if (item.AttrType == "Body") { PreDuringPost1.Visible = false; PreDuringPost2.Visible = false; PreDuringPost3.Visible = false; } } }
protected void rptCTP_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Data.CollectData item = (Data.CollectData)e.Item.DataItem; HiddenField hd = (HiddenField)e.Item.FindControl("hdItemId"); Label title = (Label)e.Item.FindControl("Title"); CheckBox cbItem = (CheckBox)e.Item.FindControl("cbItem"); HiddenField hdAttrType = (HiddenField)e.Item.FindControl("hdAttrType"); hd.Value = item.id; title.Text = item.Title; cbItem.Checked = (item.Data1 == "True") ? true : false; hdAttrType.Value = item.AttrType; if (item.AttrType == "Header") { cbItem.Visible = false; title.Font.Bold = true; title.Text = "<span style=\" font-size: 14px; margin-left: 15px;\">" + item.Title + "</span>"; } if (item.AttrType == "SingleHeader") { title.Font.Bold = true; title.Text = "<span style=\" font-size: 14px; \">" + item.Title + "</span>"; } if (item.AttrType == "Body") { cbItem.CssClass = "CusinputBody"; title.Text = "<span style=\"margin-left: 0px;\">" + item.Title + "</span>"; } else { cbItem.CssClass = "Cusinput"; } } }
public static string PopulateRowPTC(string body) { CTPList = Data.GetCommunicationTouchPointData(); if (entryForm != null) { string[] CTPInitialdb = entryForm.CommunicationTouchPointsInitialYear.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries); string[] CTPCurrentdb = entryForm.CommunicationTouchPointsCurrentYear.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries); string[] CTPInterimdb = entryForm.CommunicationTouchPointsInterimYear.Split(new string[] { Delimiter[0] }, System.StringSplitOptions.RemoveEmptyEntries); if (CTPInitialdb.Count() != 0) { for (int i = 0; i <= CTPCurrentdb.Length; i++) { if (CTPCurrentdb[i].Split(':')[0] == "999") { body = body.Replace("###OtherCTP4###", CTPCurrentdb[i].Split(':')[1]); break; } string[] Initial = CTPInitialdb[i].Split(':'); string[] Interim = CTPInterimdb[i].Split(':'); string[] Current = CTPCurrentdb[i].Split(':'); if (Initial[0] == "000") { body = body.Replace("###InitialYear###", Initial[1]); body = body.Replace("###InterimYear###", Interim[1]); body = body.Replace("###CurrentYear###", Current[1]); } else if (Initial[0] == "998") { body = body.Replace("###OtherCTP1###", Initial[1]); body = body.Replace("###OtherCTP1###", ""); body = body.Replace("###OtherCTP2###", Interim[1]); body = body.Replace("###OtherCTP3###", Current[1]); } else { try { Data.CollectData CT = CTPList.FirstOrDefault(x => x.id == Initial[0]); CT.Data1 = Initial[1]; CT.Data2 = Interim[1]; CT.Data3 = Current[1]; body = body.Replace("###CTPTitle" + Initial[0] + "###", CT.Title); body = body.Replace("###CTPDataA" + Initial[0] + "###", CT.Data1); body = body.Replace("###CTPDataB" + Initial[0] + "###", CT.Data2); body = body.Replace("###CTPDataC" + Initial[0] + "###", CT.Data3); } catch { } } } } } return(body); }