示例#1
0
        /// <summary>
        /// when the selected item in combox have id of -1 (the Agreed sign for this Action) the add new book attirbute window is open.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox       comboBox = (ComboBox)sender;
            BookAttributes elem     = (BookAttributes)comboBox.SelectedValue;
            Type           t        = elem.GetType();

            if (elem.ID == -1)
            {
                Form form = AddBookAttirbutes.Instance(t);
                form.ShowDialog();
                setComboBoxes();
            }
        }
示例#2
0
 public override bool Equals(Object obj)
 {
     //Check for null and compare run-time types.
     if ((obj == null) || !this.GetType().Equals(obj.GetType()))
     {
         return(false);
     }
     else
     {
         BookAttributes p = (BookAttributes)obj;
         return((ID == p.ID) && (Value == p.Value));
     }
 }