Esempio n. 1
0
 private void bindFieldsComponent(Comp.Component component)
 {
     txtDescription.DataBindings.Add(new Binding("Text", component, "Description"));
     txtPrice.DataBindings.Add(new Binding("Value", component, "Price"));
     txtTitle.DataBindings.Add(new Binding("Text", component, "Title"));
     txtID.DataBindings.Add(new Binding("Text", component, "Id"));
 }
Esempio n. 2
0
 private void initialise(Comp.Component component, bool insert)
 {
     InitializeComponent();
     CenterToScreen();
     txtPrice.Minimum = decimal.MinValue;
     txtPrice.Maximum = decimal.MaxValue;
     this.insert      = insert;
     this.component   = component;
     component.DeepCopyInto(ref oldCopy);
     bindFieldsComponent(component);
     setFieldEnable(insert);
 }
Esempio n. 3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Comp temp = new Comp("", "", "", 0);
            frmComponentDetails frm;

            frm = new frmComponentDetails(ref temp, true);

            Utils.ShowForm(this, frm, dgvComponents, () =>
            {
                componentList            = Comp.Select();
                dgvComponents.DataSource = componentList;
                showNoRows();
            });
        }
Esempio n. 4
0
        private void dgvComponents_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                string id = dgvComponents.Rows[e.RowIndex].Cells["Id"].Value.ToString();
                var    q  = from c
                            in componentList
                            where c.Id == id
                            select c;

                List <Comp>         tempList = q.ToList();
                Comp                temp     = tempList.Count == 1 ? tempList[0] : new Comp("", "", "", 0);
                frmComponentDetails frm      = new frmComponentDetails(ref temp);
                Utils.ShowForm(this, frm, dgvComponents, () =>
                {
                    componentList            = Comp.Select();
                    dgvComponents.DataSource = componentList;
                    showNoRows();
                });
            }
        }
Esempio n. 5
0
 public frmComponent()
 {
     componentList = Comp.Select();
     initialise();
 }
Esempio n. 6
0
 public frmComponentDetails(ref Product product, ref Comp.Component component, bool insert = false)
 {
     this.product = product;
     initialise(component, insert);
 }
Esempio n. 7
0
 public frmComponentDetails(ref Comp.Component component, bool insert = false)
 {
     initialise(component, insert);
 }
Esempio n. 8
0
 private void button5_Click(object sender, EventArgs e)
 {
     availableComponents = getAvailableComponents(product.Components, Comp.Select());
     dgvAvailableComponents.DataSource = availableComponents;
     dgvUsedComponents.DataSource      = new BindingList <Comp>(product.Components);
 }
Esempio n. 9
0
 private void tabComponents_Enter(object sender, EventArgs e)
 {
     dgvUsedComponents.DataSource      = new BindingList <Comp>(product.Components);
     availableComponents               = getAvailableComponents(product.Components, Comp.Select());
     dgvAvailableComponents.DataSource = availableComponents;
     btnAddComponent.Enabled           = false;
     btnRemoveComponent.Enabled        = false;
 }
Esempio n. 10
0
 private void refetchComponents()
 {
     product.Components                = ComplexQueryHelper.GetComponentsForProduct(product);
     dgvUsedComponents.DataSource      = new AggregatedPropertyBindingList <Comp>(product.Components);
     availableComponents               = getAvailableComponents(product.Components, Comp.Select());
     dgvAvailableComponents.DataSource = new AggregatedPropertyBindingList <Comp>(availableComponents);
 }