Ejemplo n.º 1
0
        private void BtmTypes_Click(object sender, EventArgs e)
        {
            StoreCode.Type tyTypeLoc = new StoreCode.Type();
            tyTypeLoc.intID       = this.maMaterials[this.cbName.SelectedIndex].intID;
            tyTypeLoc.strStore    = this.maMaterials[this.cbName.SelectedIndex].strStore;
            tyTypeLoc.strSection  = this.maMaterials[this.cbName.SelectedIndex].strSection;
            tyTypeLoc.strMaterial = this.maMaterials[this.cbName.SelectedIndex].strCode;

            Types tyType = new Types();

            tyType.cnConnection = this.cnConnection;
            tyType.Owner        = this;
            tyType.tySearch     = tyTypeLoc;
            tyType.ShowDialog();
        }
Ejemplo n.º 2
0
        private void BtmOK_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.dsTypes.Tables["tabStuffTypes"].Rows.Count; i++)
            {
                if (this.dsTypes.Tables["tabStuffTypes"].Rows[i].RowState == DataRowState.Deleted)
                {
                    StoreCode.TypeDelete(this.cnConnection, (int)this.dsTypes.Tables["tabStuffTypes"].Rows[i]["intID", DataRowVersion.Original]);
                }

                if (this.dsTypes.Tables["tabStuffTypes"].Rows[i].RowState == DataRowState.Added)
                {
                    StoreCode.Type tyType = new StoreCode.Type();
                    tyType.strStore    = this.tySearch.strStore;
                    tyType.strSection  = this.tySearch.strSection;
                    tyType.strMaterial = this.tySearch.strMaterial;
                    tyType.strName     = this.dsTypes.Tables["tabStuffTypes"].Rows[i]["nvcName"].ToString();

                    StoreCode.TypeInsert(this.cnConnection, tyType);
                }

                if (this.dsTypes.Tables["tabStuffTypes"].Rows[i].RowState == DataRowState.Modified)
                {
                    StoreCode.Type tyType = new StoreCode.Type();
                    tyType.intID   = (int)this.dsTypes.Tables["tabStuffTypes"].Rows[i]["intID"];
                    tyType.strName = this.dsTypes.Tables["tabStuffTypes"].Rows[i]["nvcName"].ToString();
                    StoreCode.TypeUpdate(this.cnConnection, tyType);
                }
            }

            //if (this.Owner is StuffUpdate)
            //{
            //    StuffUpdate frmStuffUpdate = (StuffUpdate)this.Owner;
            //    frmStuffUpdate.FillTypes();
            //}
            //if (this.Owner is StuffInsert)
            //{
            //    StuffInsert frmStuffInsert = (StuffInsert)this.Owner;
            //    frmStuffInsert.FillTypes();
            //}

            this.Close();
        }