public void addExtender(ValidationExtender extender)
        {
            this._textBox.Load += new EventHandler(extender.RegisterScript);
            this._textBox.TextChanged += new EventHandler(extender.DoStuff);

            if (extender._targetControl is DynamicTextBox)
                this._textBox.Attributes.Add("onblur", "ValidationMethod('" + ((DynamicTextBox)extender._targetControl)._required.ClientID + "');");
            else if (extender._targetControl is DynamicCountableTextBox)
                this._textBox.Attributes.Add("onblur", "ValidationMethod('" + ((DynamicCountableTextBox)extender._targetControl)._required.ClientID + "');");
            else if (extender._targetControl is DynamicDropDownList)
                this._textBox.Attributes.Add("onblur", "ValidationMethod('" + ((DynamicDropDownList)extender._targetControl)._required.ClientID + "');");
        }
 public void addExtender(ValidationExtender extender)
 {
     _checkBox.CheckedChanged += new EventHandler(extender.DoStuff);
     _checkBox.AutoPostBack = true;
 }
        /// <summary>
        /// Method that will create the ASP.net Controls based on the DynamicFieldsAggregator Class
        /// </summary>
        private static List<Control> CreateDynamicsFields(DynamicFieldsAggregator aggregator, Dictionary<string, object> parameters)
        {
            List<Control> controlList = new List<Control>();

            foreach (DynamicControls control in aggregator.Controls)
            {
                string controlValue = string.Empty;

                if (parameters.ContainsKey("DateTime"))
                {
                    if (control.Name.Equals(Globals.CallEntry.ActionDateFieldName))
                        controlValue = ((DateTime)parameters["DateTime"]).ToString("MM/dd/yyyy");
                    else if (control.Name.Equals(Globals.CallEntry.ActionTimeFieldName))
                        controlValue = ((DateTime)parameters["DateTime"]).ToString("HH:mm");
                }

                if (control is DynamicTextBoxXml)
                {
                    DynamicTextBox customControl = new DynamicTextBox(control as DynamicTextBoxXml);
                    controlList.Add(customControl);
                    if (customControl.Text.Equals(string.Empty) && !controlValue.Equals(string.Empty))
                        customControl.Text = controlValue;
                }
                else if (control is DynamicDropDownListXml)
                {
                    DynamicDropDownList customControl = new DynamicDropDownList(control as DynamicDropDownListXml);
                    controlList.Add(customControl);
                }
                else if (control is DynamicGridViewXml)
                {
                    DynamicGridView customControl = new DynamicGridView(control as DynamicGridViewXml);
                    controlList.Add(customControl);
                }
                else if (control is DynamicCountableTextBoxXml)
                {
                    DynamicCountableTextBox customControl = new DynamicCountableTextBox(control as DynamicCountableTextBoxXml);
                    controlList.Add(customControl);
                    if (customControl.Text.Equals(string.Empty) && !controlValue.Equals(string.Empty))
                        customControl.Text = controlValue;
                }
                else if (control is DynamicDatePickerXml)
                {
                    DynamicDatePicker customControl = new DynamicDatePicker(control as DynamicDatePickerXml);
                    controlList.Add(customControl);
                    if (!customControl.Value.HasValue && !controlValue.Equals(string.Empty))
                        customControl.Value = Convert.ToDateTime(controlValue, new System.Globalization.CultureInfo("en-US"));
                }
                else if (control is DynamicTimeXml)
                {
                    DynamicTime customControl = new DynamicTime(control as DynamicTimeXml);
                    controlList.Add(customControl);
                    if (customControl.Text.Equals(string.Empty) && !controlValue.Equals(string.Empty))
                        customControl.Text = controlValue;
                }
                else if (control is DynamicFilteredTextBoxXml)
                {
                    DynamicFilteredTextBox customControl = new DynamicFilteredTextBox(control as DynamicFilteredTextBoxXml);
                    controlList.Add(customControl);
                    if (customControl.Text.Equals(string.Empty) && !controlValue.Equals(string.Empty))
                        customControl.Text = controlValue;
                }
                else if (control is DynamicCheckBoxXml)
                {
                    DynamicCheckBox customControl = new DynamicCheckBox(control as DynamicCheckBoxXml);
                    controlList.Add(customControl);
                }
                else if (control is DynamicRadioButtonListXml)
                {
                    DynamicRadioButtonList customControl = new DynamicRadioButtonList(control as DynamicRadioButtonListXml);
                    controlList.Add(customControl);
                }
            }

            foreach (Extenders extender in aggregator.Extenders)
            {
                if (extender is VisibleExtenderXml)
                {
                    VisibleExtenderXml extenderXml = extender as VisibleExtenderXml;

                    WebControl caller = FindControlByName(controlList, extenderXml.CallerControlName) as WebControl;
                    WebControl target = FindControlByName(controlList, extenderXml.TargetControlName) as WebControl;

                    if (caller != null && target != null)
                    {
                        VisibleExtender vExtender = new VisibleExtender(extenderXml, caller, target);

                        if (caller is DynamicTextBox)
                        {
                            ((DynamicTextBox)caller).addExtender(vExtender);
                        }
                        else if (caller is DynamicCountableTextBox)
                        {
                            ((DynamicCountableTextBox)caller).addExtender(vExtender);
                        }
                        else if (caller is DynamicDropDownList)
                        {
                            ((DynamicDropDownList)caller).addExtender(vExtender);
                        }
                        else if (caller is DynamicRadioButtonList)
                        {
                            ((DynamicRadioButtonList)caller).addExtender(vExtender);
                        }
                        else if (caller is DynamicCheckBox)
                        {
                            ((DynamicCheckBox)caller).addExtender(vExtender);
                        }
                    }
                }
                else if (extender is AutoFillExtenderXml)
                {
                    AutoFillExtenderXml extenderXml = extender as AutoFillExtenderXml;

                    WebControl target = FindControlByName(controlList, extenderXml.TargetControlName) as WebControl;

                    if (target != null)
                    {
                        AutoFillExtender aExtender = new AutoFillExtender(extenderXml, target);
                        switch (extenderXml.Type)
                        {
                            case Hulcher.OneSource.CustomerService.Core.Globals.CallEntry.AutoFillType.JobCity:
                            case Hulcher.OneSource.CustomerService.Core.Globals.CallEntry.AutoFillType.JobState:
                            case Hulcher.OneSource.CustomerService.Core.Globals.CallEntry.AutoFillType.JobCountry:
                                if (parameters.ContainsKey("JobID"))
                                    aExtender._filterId = parameters["JobID"].ToString();
                                break;
                            case Hulcher.OneSource.CustomerService.Core.Globals.CallEntry.AutoFillType.PreviousCallType:
                                if (parameters.ContainsKey("JobID"))
                                    aExtender._filterId = parameters["JobID"].ToString();
                                break;
                            default:
                                break;
                        }

                        if (!string.IsNullOrEmpty(extenderXml.ConditionalControlName))
                            aExtender._conditionalControlName = extenderXml.ConditionalControlName;

                        if (target is DynamicTextBox)
                        {
                            ((DynamicTextBox)target).addExtender(aExtender);
                        }
                        else if (target is DynamicCountableTextBox)
                        {
                            ((DynamicCountableTextBox)target).addExtender(aExtender);
                        }
                        else if (target is DynamicDropDownList)
                        {
                            ((DynamicDropDownList)target).addExtender(aExtender);
                        }
                    }
                }
                else if (extender is ValidationExtenderXml)
                {
                    ValidationExtenderXml extenderXml = extender as ValidationExtenderXml;

                    WebControl caller = FindControlByName(controlList, extenderXml.CallerControlName) as WebControl;
                    WebControl target = FindControlByName(controlList, extenderXml.TargetControlName) as WebControl;

                    if (caller != null && target != null)
                    {
                        ValidationExtender vExtender = new ValidationExtender(extenderXml, target, caller);

                        if (caller is DynamicTextBox)
                        {
                            ((DynamicTextBox)caller).addExtender(vExtender);
                        }
                        else if (caller is DynamicCountableTextBox)
                        {
                            ((DynamicCountableTextBox)caller).addExtender(vExtender);
                        }
                    }
                }
                else if (extender is ListExtenderXml)
                {
                    ListExtenderXml extenderXml = extender as ListExtenderXml;

                    WebControl target = FindControlByName(controlList, extenderXml.TargetControlName) as WebControl;

                    if (target != null)
                    {
                        ListExtender lExtender = new ListExtender(extenderXml, target);

                        if (target is DynamicDropDownList)
                        {
                            ((DynamicDropDownList)target).addExtender(lExtender);
                        }
                        else if (target is DynamicRadioButtonList)
                        {
                            ((DynamicRadioButtonList)target).addExtender(lExtender);
                        }
                    }
                }
                else if (extender is CascadeListExtenderXml)
                {
                    CascadeListExtenderXml extenderXml = extender as CascadeListExtenderXml;

                    WebControl caller = FindControlByName(controlList, extenderXml.SourceControlName) as WebControl;
                    WebControl target = FindControlByName(controlList, extenderXml.TargetControlName) as WebControl;

                    if (caller != null && target != null)
                    {
                        CascadeListExtender cExtender = new CascadeListExtender(extenderXml, target, caller);

                        if (caller is DynamicDropDownList)
                        {
                            ((DynamicDropDownList)caller).addExtender(cExtender);
                        }
                    }
                }
                else if (extender is GridViewExtenderXml)
                {
                    GridViewExtenderXml extenderXml = extender as GridViewExtenderXml;

                    WebControl source = FindControlByName(controlList, extenderXml.SourceControlName) as WebControl;
                    WebControl target = FindControlByName(controlList, extenderXml.TargetControlName) as WebControl;

                    if (source != null && target != null)
                    {
                        GridViewExtender cExtender = new GridViewExtender(source, target, extenderXml.Label);

                        if (source is DynamicGridView)
                        {
                            ((DynamicGridView)source).AddExtender(cExtender);
                        }
                    }
                }
            }

            return controlList;
        }
 public void addExtender(ValidationExtender extender)
 {
     this._textBox.TextChanged += new EventHandler(extender.DoStuff);
     this._textBox.AutoPostBack = true;
 }