private List <CouponTierTranslation> SetTierTranslations(Repeater repeater, int cTierId, string defaultDescription) { CouponTierTranslation ct = null; List <CouponTierTranslation> listct = new List <CouponTierTranslation>(); foreach (RepeaterItem ri in repeater.Items) { HiddenField hfLangId = (HiddenField)ri.FindControl("hfLangId"); int langId = Convert.ToInt32(hfLangId.Value); TextBox tbTranslation = (TextBox)ri.FindControl("tbTranslation"); ct = new CouponTierTranslation(); ct.LanguageId = langId; ct.CouponTierID = cTierId; if (langId == DefaultLanguageID) { ct.DeliverableMessage = defaultDescription.Trim(); } else { ct.DeliverableMessage = tbTranslation.Text.Trim(); } listct.Add(ct); } return(listct); }
private void repMLIInputs_ItemDataBound(object sender, RepeaterItemEventArgs e) { //Get the translations from the multilanguage usercontrol if (e.Item.DataItem != null) { MultiLanguageInput mli = (MultiLanguageInput)e.Item.DataItem; CouponTierTranslation tierTrans = new CouponTierTranslation(); tierTrans.LanguageId = mli.LanguageID; tierTrans.CouponTierID = mli.IdentifierValue.ConvertToInt32(); tierTrans.DeliverableMessage = mli.Translation.Trim(); tierTransData.Add(tierTrans); } }
private List <CouponTierTranslation> SetCouponTranslationData(int tierLevel, CouponTier ctier) { List <CouponTierTranslation> CouponTierTrans = null; if (repTier_Desc != null) { Repeater repeater = (Repeater)repTier_Desc; FindNestedControl(repeater.Items[tierLevel], "tbMLI"); if (resultControl != null) { CouponTierTrans = new List <CouponTierTranslation>(); TextBox txtDesc = (TextBox)resultControl; ctier.Description = txtDesc.Text.Trim(); CouponTierTranslation ctr = new CouponTierTranslation() { CouponTierID = ctier.Id, DeliverableMessage = txtDesc.Text.Trim(), LanguageId = DefaultLanguageID }; CouponTierTrans.Add(ctr); resultControl = null; } if (isMultiLanguageEnabled) { FindNestedControl(repeater.Items[tierLevel], "repMLIInputs"); if (resultControl != null) { Repeater repMLI = (Repeater)resultControl; CouponTierTrans = SetTierTranslations(repMLI, 1, ctier.Description); resultControl = null; } } } return(CouponTierTrans); }