private void FromTemplate()
 {
     if (objOffer.FromTemplate)
     {
         RewardTemplateFieldContainer rc = ucTemplateLockableFields.RewardTemplateFieldSource;
         if (rc != null)
         {
             foreach (CMS.AMS.Models.TemplateField temp in rc.TemplateFieldList)
             {
                 if (temp.Tiered)
                 {
                     for (int i = 0, j = 0; i < objOffer.NumbersOfTier; i++)
                     {
                         if (temp.FieldName == "Message" && !temp.Editable)
                         {
                             List <Language> lang = SystemSettings.GetAllActiveLanguages((Engines)objOffer.EngineID);
                             var             k    = 0;
                             foreach (Language lan in lang)
                             {
                                 var tt = (HtmlControl)this.FindControl(repProximityMsg.ID + "$ctl0" + j + "$" + "repProximityMsgDesc" + "$ctl0" + k + "$" + temp.ControlName);
                                 if (tt != null)
                                 {
                                     tt.Attributes.Add("disabled", "true");
                                 }
                                 k++;
                             }
                         }
                         else
                         {
                             if (!temp.Editable)
                             {
                                 var t = (WebControl)this.FindControl(repProximityMsg.ID + "$ctl0" + j + "$" + temp.ControlName);
                                 t.Attributes.Add("disabled", "true");
                             }
                         }
                         j += 1;
                     }
                 }
                 else
                 {
                     if (!temp.Editable)
                     {
                         if (temp.FieldName == "Tag")
                         {
                             var t = (WebControl)this.FindControl(temp.ControlName);
                             t.Attributes.Add("disabled", "true");
                         }
                         else
                         {
                             var t = (DropDownList)this.FindControl(temp.ControlName);
                             t.Attributes.Add("disabled", "true");
                         }
                     }
                 }
             }
         }
     }
 }
 private void IsTemplate()
 {
     if (objOffer.IsTemplate && !DisabledAttribute)
     {
         RewardTemplateFieldContainer rc = ucTemplateLockableFields.RewardTemplateFieldSource;
         if (rc != null)
         {
             foreach (CMS.AMS.Models.TemplateField temp in rc.TemplateFieldList)
             {
                 if (temp.Tiered)
                 {
                     for (int i = 0, j = 0; i < objOffer.NumbersOfTier; i++)
                     {
                         if (temp.FieldName == "Message")
                         {
                             List <Language> lang = SystemSettings.GetAllActiveLanguages((Engines)objOffer.EngineID);
                             var             k    = 0;
                             foreach (Language lan in lang)
                             {
                                 var tt = (HtmlControl)this.FindControl(repProximityMsg.ID + "$ctl0" + j + "$" + "repProximityMsgDesc" + "$ctl0" + k + "$" + temp.ControlName);
                                 if (rc.DisallowEdit == true && temp.Editable)
                                 {
                                     tt.Style.Add("background", "#bfffff");
                                 }
                                 else if (!rc.DisallowEdit && !temp.Editable)
                                 {
                                     tt.Style.Add("background", "#ffdddd");
                                 }
                                 k++;
                             }
                         }
                         else
                         {
                             var t = (WebControl)this.FindControl(repProximityMsg.ID + "$ctl0" + j + "$" + temp.ControlName);
                             if (rc.DisallowEdit == true && temp.Editable)
                             {
                                 t.Style.Add("background-color", "#bfffff");
                             }
                             else if (!rc.DisallowEdit && !temp.Editable)
                             {
                                 t.Style.Add("background-color", "#ffdddd");
                             }
                         }
                         j += 1;
                     }
                 }
                 else
                 {
                     var t = (WebControl)this.FindControl(temp.ControlName);
                     if (rc.DisallowEdit == true && temp.Editable)
                     {
                         t.Style.Add("background-color", "#bfffff");
                     }
                     else if (!rc.DisallowEdit && !temp.Editable)
                     {
                         t.Style.Add("background-color", "#ffdddd");
                     }
                 }
             }
         }
     }
 }