Exemplo n.º 1
0
        void Supplier_Update()
        {
            try
            {
                c_row_select = dgrSupplier.SelectedIndex;
                Supplier_Info _Supplier_Info = (Supplier_Info)dgrSupplier.SelectedItem;

                if (_Supplier_Info == null)
                {
                    return;
                }
                frmCreate_Supplier _frmCreate_Supplier = new frmCreate_Supplier();
                _frmCreate_Supplier.c_Supplier_Info = _Supplier_Info;
                _frmCreate_Supplier.c_type          = Convert.ToInt16(Form_Type.Update);
                _frmCreate_Supplier.Owner           = Window.GetWindow(this);
                _frmCreate_Supplier.ShowDialog();

                if (_frmCreate_Supplier.c_id_insert != 0)
                {
                    LoadData();
                }

                DataGridHelper.NVSFocus(dgrSupplier, c_row_select, 0);
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Exemplo n.º 2
0
        void Supplier_Insert()
        {
            try
            {
                frmCreate_Supplier _frmCreate_Supplier = new frmCreate_Supplier();
                _frmCreate_Supplier.c_type = Convert.ToInt16(Form_Type.Insert);
                _frmCreate_Supplier.Owner  = Window.GetWindow(this);
                _frmCreate_Supplier.ShowDialog();

                if (_frmCreate_Supplier.c_id_insert != 0)
                {
                    LoadData();

                    for (int i = 0; i < c_lst.Count; i++)
                    {
                        Supplier_Info ui = (Supplier_Info)c_lst[i];
                        if (ui.Supplier_Id == _frmCreate_Supplier.c_id_insert)
                        {
                            c_row_select = i;
                            _frmCreate_Supplier.c_id_insert = 0;
                            break;
                        }
                    }
                }

                DataGridHelper.NVSFocus(dgrSupplier, c_row_select, 0);
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }