Ejemplo n.º 1
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
            {
                PoItemsView itemView = new PoItemsView(isNewCreatePo);
                itemView.FillTheTable(poItemsStateList[e.RowIndex].poItem);

                if (DialogResult.Yes == itemView.ShowDialog())
                {
                    if (isNewCreatePo)
                    {
                        sbyte poItemState = poItemsStateList[e.RowIndex].poItem.poItemState;
                        int   soItemId    = poItemsStateList[e.RowIndex].poItem.soItemId;
                        poItemsStateList[e.RowIndex].poItem             = itemView.GetPoItem();
                        poItemsStateList[e.RowIndex].poItem.poItemState = poItemState;
                        poItemsStateList[e.RowIndex].poItem.soItemId    = soItemId;
                    }
                    else
                    {
                        GetPoItemsList();
                    }
                    FillTheDataGridPoItems();
                    HasItemChange = true;
                }
            }
        }
Ejemplo n.º 2
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            PoItemsView itemView = new PoItemsView(true);

            if (itemView.ShowDialog() == DialogResult.Yes)
            {
                poitems item = itemView.GetPoItem();
                var     poItemContentAndState = new PoItemContentAndState();
                poItemContentAndState.poItem      = item;
                poItemContentAndState.poItem.poId = this.poId;
                poItemContentAndState.state       = OrderItemsState.New;
                poItemsStateList.Add(poItemContentAndState);

                FillTheDataGridPoItems();
            }
        }
Ejemplo n.º 3
0
        private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
            {
                PoItemsView itemView = new PoItemsView(false);
                itemView.FillTheTable(poItemsStateList[e.RowIndex].poItem);

                if (DialogResult.Yes == itemView.ShowDialog())
                {
                    int poId     = poItemsStateList[e.RowIndex].poItem.poId.Value;
                    int poItemId = poItemsStateList[e.RowIndex].poItem.PoItemsId;

                    poItemsStateList[e.RowIndex].poItem           = itemView.GetPoItem();
                    poItemsStateList[e.RowIndex].poItem.poId      = poId;
                    poItemsStateList[e.RowIndex].poItem.PoItemsId = poItemId;

                    if (poItemsStateList[e.RowIndex].state != OrderItemsState.New)
                    {
                        poItemsStateList[e.RowIndex].state = OrderItemsState.Modified;
                    }
                    FillTheDataGridPoItems();
                }
            }
        }
Ejemplo n.º 4
0
        private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
            {

                PoItemsView itemView = new PoItemsView(false);
                itemView.FillTheTable(poItemsStateList[e.RowIndex].poItem);

                if (DialogResult.Yes == itemView.ShowDialog())
                {
                    int poId = poItemsStateList[e.RowIndex].poItem.poId.Value;
                    int poItemId = poItemsStateList[e.RowIndex].poItem.PoItemsId;

                    poItemsStateList[e.RowIndex].poItem = itemView.GetPoItem();
                    poItemsStateList[e.RowIndex].poItem.poId=poId;
                    poItemsStateList[e.RowIndex].poItem.PoItemsId = poItemId;

                    if(poItemsStateList[e.RowIndex].state!=OrderItemsState.New)
                    {
                    poItemsStateList[e.RowIndex].state = OrderItemsState.Modified;
                    }
                    FillTheDataGridPoItems();
                }
            }
        }
Ejemplo n.º 5
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            PoItemsView itemView = new PoItemsView(true);
               if (itemView.ShowDialog() == DialogResult.Yes)
               {
               poitems item = itemView.GetPoItem();
               var poItemContentAndState = new PoItemContentAndState();
               poItemContentAndState.poItem = item;
               poItemContentAndState.poItem.poId = this.poId;
               poItemContentAndState.state = OrderItemsState.New;
               poItemsStateList.Add(poItemContentAndState);

               FillTheDataGridPoItems();

               }
        }