示例#1
0
        public void SetDataSource(object[] attributes)
        {
            try
            {
                if (attributes.Length == 0)
                {
                    return;
                }
                ReferenceMappingAttribute attribute = attributes[0] as ReferenceMappingAttribute;
                if (attribute == null)
                {
                    return;
                }

                IGenericEntity referencedEntity  = EntityFactory.GetEntityInstance(attribute.ReferencedEntity, SessionManager.GetSessionValueNoRedirect((IndBasePage)this.Page, SessionStrings.CONNECTION_MANAGER));
                DataRow        referencedDataRow = referencedEntity.SelectNew();
                this.SetValue(referencedDataRow["Rank"]);
            }
            catch (IndException ex)
            {
                ControlHierarchyManager.ReportError(ex);
                return;
            }
            catch (Exception ex)
            {
                ControlHierarchyManager.ReportError(new IndException(ex));
                return;
            }
        }
        public IndCatGridPager(GridPagingManager pagingManager, IndCatGrid ownerGrid)
        {
            try
            {
                ControlHierarchyManager = new ControlHierarchyManager(this);

                this.PagingManager = pagingManager;
                this.owner         = ownerGrid;

                if (pagingManager != null)
                {
                    this.RowCount = pagingManager.DataSourceCount;
                }
                this.PageSize = owner.PageSize;

                lblItems.ID = "lblItems";

                CreateControls();
            }
            catch (IndException ex)
            {
                ControlHierarchyManager.ReportError(ex);
                return;
            }
            catch (Exception ex)
            {
                ControlHierarchyManager.ReportError(new IndException(ex));
                return;
            }
        }
        public void SetDataSource(object[] attributes)
        {
            try
            {
                ReferenceMappingAttribute attribute = attributes[0] as ReferenceMappingAttribute;
                if (attribute == null)
                {
                    throw new IndException(ApplicationMessages.EXCEPTION_WRONG_ATTRIBUTE_RECEIVED);
                }


                IGenericEntity referencedEntity = EntityFactory.GetEntityInstance(attribute.ReferencedEntity, SessionManager.GetSessionValueNoRedirect((IndBasePage)this.Page, SessionStrings.CONNECTION_MANAGER));
                //Call the GetAll() method of the referenced object
                DataSet referencedDataSet = referencedEntity.GetAll();
                DSUtils.AddEmptyRecord(referencedDataSet.Tables[0]);
                //Set the DataSource, DataMember, DataValueField and DataTextField of the combobox
                this.DataSource = referencedDataSet;
                this.DataMember = referencedDataSet.Tables[0].TableName;
                this.DataBind();
                this.SelectedValue = ApplicationConstants.INT_NULL_VALUE.ToString();
            }
            catch (IndException ex)
            {
                ControlHierarchyManager.ReportError(ex);
                return;
            }
            catch (Exception ex)
            {
                ControlHierarchyManager.ReportError(new IndException(ex));
                return;
            }
        }
示例#4
0
 public IndSelectLabel()
 {
     lblData                 = new Label();
     btnPopUp                = new Button();
     btnPopUp.Text           = "...";
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }
示例#5
0
 public IndComboBox()
 {
     CssClass            = CSSStrings.ComboBoxCssClass;
     this.MarkFirstMatch = true;
     //this.sK = "~/Skins/ComboBox";
     this.Skin = "Default";
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }
 public IndDatePicker()
 {
     CssClass                 = CSSStrings.DatePickerCssClass;
     this.Calendar.Skin       = "NewDefault";
     this.Calendar.SkinsPath  = "~/Skins/Calendar";
     this.DateInput.Skin      = "NewDefault";
     this.DateInput.SkinsPath = "~/Skins/Calendar";
     this.DateInput.CssClass  = "NewDefault";
     ControlHierarchyManager  = new ControlHierarchyManager(this);
 }
 /// <summary>
 /// Sets the value of this control
 /// </summary>
 /// <param name="val"></param>
 public void SetValue(object val)
 {
     try
     {
         this.SelectedDate = (val == null) ? DateTime.MinValue : (DateTime)val;
     }
     catch (IndException ex)
     {
         ControlHierarchyManager.ReportError(ex);
         return;
     }
     catch (Exception ex)
     {
         ControlHierarchyManager.ReportError(new IndException(ex));
         return;
     }
 }
示例#8
0
 public void SetValue(object val)
 {
     try
     {
         this.Text = (val == null) ? String.Empty : val.ToString();
     }
     catch (IndException ex)
     {
         ControlHierarchyManager.ReportError(ex);
         return;
     }
     catch (Exception ex)
     {
         ControlHierarchyManager.ReportError(new IndException(ex));
         return;
     }
 }
 public object GetValue()
 {
     try
     {
         return(this.Checked);
     }
     catch (IndException ex)
     {
         ControlHierarchyManager.ReportError(ex);
         return(null);
     }
     catch (Exception ex)
     {
         ControlHierarchyManager.ReportError(new IndException(ex));
         return(null);
     }
 }
 public void SetValue(object val)
 {
     try
     {
         this.Checked = (bool)val;
     }
     catch (IndException ex)
     {
         ControlHierarchyManager.ReportError(ex);
         return;
     }
     catch (Exception ex)
     {
         ControlHierarchyManager.ReportError(new IndException(ex));
         return;
     }
 }
示例#11
0
        public IndCatGrid()
        {
            if (!DesignMode)
            {
                this.EnableViewState    = false;
                this.AllowPaging        = true;
                this.PagerStyle.Visible = false;
                this.AllowSorting       = true;
                this.MasterTableView.AllowNaturalSort = false;

                this.EnableAJAX             = false;
                this.AllowFilteringByColumn = true;

                this.AutoGenerateColumns = false;

                this.ItemCreated    += new GridItemEventHandler(GenericGrid_ItemCreated);
                this.NeedDataSource += new GridNeedDataSourceEventHandler(GenericGrid_NeedDataSource);
                this.ColumnCreating += new GridColumnCreatingEventHandler(IndCatGrid_ColumnCreating);

                this.DataSourcePersistenceMode = GridDataSourcePersistenceMode.NoPersistence;

                //Add the add and delete buttons
                if (_UserCanAdd)
                {
                    btnAdd              = new IndImageButton();
                    btnAdd.ID           = "AddButton";
                    btnAdd.ImageUrl     = "~/Images/buttons_new.png";
                    btnAdd.ImageUrlOver = "~/Images/buttons_new_over.png";
                    btnAdd.ToolTip      = "Add";
                }

                btnDelete               = new IndImageButton();
                btnDelete.ID            = "DeleteButton";
                btnDelete.ImageUrl      = "~/Images/buttons_delete.png";
                btnDelete.ImageUrlOver  = "~/Images/buttons_delete_over.png";
                btnDelete.OnClientClick = "if (CheckBoxesSelected()) {if(!confirm('Are you sure you want to delete the selected entries?'))return false;}else {alert('Select at least one entry');return false;}";
                btnDelete.Click        += new ImageClickEventHandler(DeleteButton_Click);
                btnDelete.ToolTip       = "Delete";
                btnDelete.Enabled       = _UserCanDelete;
            }

            ControlHierarchyManager = new ControlHierarchyManager(this);
        }
 public object GetValue()
 {
     try
     {
         if (ViewState["MyObject_" + this.ID] is bool)
         {
             return((bool)(ViewState["MyObject_" + this.ID]) ? "True" : "False");
         }
         return(this.Text);
     }
     catch (IndException ex)
     {
         ControlHierarchyManager.ReportError(ex);
         return(null);
     }
     catch (Exception ex)
     {
         ControlHierarchyManager.ReportError(new IndException(ex));
         return(null);
     }
 }
 /// <summary>
 /// Default Constructor
 /// </summary>
 public IndYearMonth()
 {
     //Set the value for the labels
     lblYear.ID    = "lblYear";
     lblYear.Text  = "Year";
     lblMonth.ID   = "lblMonth";
     lblMonth.Text = "Month";
     cmbYear.ID    = "cmbYear";
     //cmbMonth.SkinsPath = "~/Skins/ComboBox";
     cmbMonth.Skin = "Default";
     cmbYear.Width = 60;
     //cmbYearSkinsPath = "~/Skins/ComboBox";
     cmbYear.Skin            = "Default";
     cmbYear.Height          = 100;
     cmbMonth.ID             = "cmbMonth";
     cmbMonth.Width          = 40;
     cmbMonth.Height         = 100;
     _FirstYear              = YearMonth.FirstYear;
     _LastYear               = YearMonth.LastYear;
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }
        public void SetValue(object val)
        {
            try
            {
                ViewState["MyObject_" + this.ID] = val;

                if (val is DateTime)
                {
                    if ((DateTime)val == DateTime.MinValue)
                    {
                        this.Text = String.Empty;
                    }
                    else
                    {
                        this.Text = ((DateTime)val).ToShortDateString();
                    }
                }
                else
                {
                    if (val is bool)
                    {
                        this.Text = (bool)(val) ? "Yes" : "No";
                    }
                    else
                    {
                        this.Text = (val == null) ? String.Empty : val.ToString();
                    }
                }
            }
            catch (IndException ex)
            {
                ControlHierarchyManager.ReportError(ex);
                return;
            }
            catch (Exception ex)
            {
                ControlHierarchyManager.ReportError(new IndException(ex));
                return;
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            try
            {
                if (!String.IsNullOrEmpty(ReferencedControlName))
                {
                    this.AutoPostBack = true;
                }

                base.OnLoad(e);
            }
            catch (IndException ex)
            {
                ControlHierarchyManager.ReportError(ex);
                return;
            }
            catch (Exception ex)
            {
                ControlHierarchyManager.ReportError(new IndException(ex));
                return;
            }
        }
 private void IndComboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
 {
     try
     {
         if (String.IsNullOrEmpty(ReferencedControlName))
         {
             return;
         }
         Control referencedControl = this.Parent.FindControl(ReferencedControlName);
         if (referencedControl == null)
         {
             throw new IndException(ReferencedControlName + "was not found.");
         }
         if (!(referencedControl is IGenericCatWebControl))
         {
             throw new IndException(ReferencedControlName + "does not implement IGenericWebControl.");
         }
         //The dataTable exist because the event was fired
         DataTable tbl = ((DataSet)this.DataSource).Tables[0];
         if (!tbl.Columns.Contains(this.ReferencedControlValueMember))
         {
             throw new IndException(ReferencedControlValueMember + "was not found in the datasource table.");
         }
         object referencedControlValue = tbl.Rows[this.SelectedIndex][this.ReferencedControlValueMember];
         ((IGenericCatWebControl)referencedControl).SetValue(referencedControlValue);
     }
     catch (IndException ex)
     {
         ControlHierarchyManager.ReportError(ex);
         return;
     }
     catch (Exception ex)
     {
         ControlHierarchyManager.ReportError(new IndException(ex));
         return;
     }
 }
示例#17
0
 protected override void OnPreRender(EventArgs e)
 {
     try
     {
         base.OnPreRender(e);
         //If _AlphaNumericCheck attribute is true, then all characters that will be allowed to be
         //filled in will be the ones defined in ALLOWED_TEXTBOX_CHARACTERS variable
         if (AlphaNumericCheck)
         {
             string previousEvent = this.Attributes["onKeyPress"];
             this.Attributes.Add("onKeyPress", (String.IsNullOrEmpty(previousEvent)?"":previousEvent) + "if (getKeyCode(event) == 13) {return false;} return RestrictKeys(event,'" + ApplicationConstants.ALLOWED_TEXTBOX_CHARACTERS + "',\"" + this.ClientID + "\")");
         }
     }
     catch (IndException ex)
     {
         ControlHierarchyManager.ReportError(ex);
         return;
     }
     catch (Exception ex)
     {
         ControlHierarchyManager.ReportError(new IndException(ex));
         return;
     }
 }
        protected override void OnPreRender(EventArgs e)
        {
            try
            {
                if (_FocusOnLoad)
                {
                    this.Focus();
                }

                AddAjaxReference();

                base.OnPreRender(e);
            }
            catch (IndException ex)
            {
                ControlHierarchyManager.ReportError(ex);
                return;
            }
            catch (Exception ex)
            {
                ControlHierarchyManager.ReportError(new IndException(ex));
                return;
            }
        }
示例#19
0
 public IndCheckBox()
 {
     CssClass = CSSStrings.CheckBoxCssClass;
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }
 public IndFormatedLabel()
 {
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }
示例#21
0
 public IndValidationSummary()
 {
     this.CssClass           = "IndValidationSummary";
     this.ForeColor          = Color.Yellow;
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }
示例#22
0
 public IndGrid()
 {
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }
 public IndCatLastUserLabel()
 {
     this.CssClass           = CSSStrings.LabelCssClass;
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }
 public IndMenuItem()
 {
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }
示例#25
0
 public IndYearMonthLabel()
 {
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }
 public IndTextBox()
 {
     this.CssClass           = CSSStrings.TextBoxCssClass;
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }
示例#27
0
 public override void Initialize()
 {
     ControlHierarchyManager = new ControlHierarchyManager(this.Owner.OwnerGrid);
     base.Initialize();
 }
 public IndImageButton()
 {
     this.CssClass           = CSSStrings.ImageButtonCssClass;
     ControlHierarchyManager = new ControlHierarchyManager(this);
 }