Esempio n. 1
0
        //料件入库
        private void FormMaterialsInInput_Click(object sender, EventArgs e)
        {
            FormMaterialsInInput objForm = new FormMaterialsInInput();

            objForm.MdiParent = this;
            objForm.Show();
        }
        public override void tool1_Add_Click(object sender, EventArgs e)
        {
            base.tool1_Add_Click(sender, e);
            FormMaterialsInInput objForm = new FormMaterialsInInput();

            objForm.MdiParent = this.MdiParent;
            objForm.Show();
        }
        public override void tool1_Modify_Click(object sender, EventArgs e)
        {
            base.tool1_Modify_Click(sender, e);
            bool bHave = false;

            if (this.myDataGridViewHead.CurrentRow.Cells["过帐标志"].Value != DBNull.Value && this.myDataGridViewHead.CurrentRow.Cells["过帐标志"].Value != null &&
                Convert.ToBoolean(this.myDataGridViewHead.CurrentRow.Cells["过帐标志"].Value) == true)
            {
                SysMessage.InformationMsg("料件入库单已经过帐,不允许执行该操作!");
                return;
            }
            int    iOrderID   = Convert.ToInt32(this.myDataGridViewHead.CurrentRow.Cells["料件入库表id"].Value);
            string strBooksNo = this.myDataGridViewHead.CurrentRow.Cells["电子帐册号"].Value.ToString();

            foreach (Form childFrm in this.MdiParent.MdiChildren)
            {
                if (childFrm.Name == "FormMaterialsInInput")
                {
                    FormMaterialsInInput inputForm = (FormMaterialsInInput)childFrm;
                    if (inputForm.giOrderID != 0 && inputForm.giOrderID == iOrderID)
                    {
                        bHave = true;
                        childFrm.Activate();
                        break;
                    }
                }
            }
            if (!bHave)
            {
                FormMaterialsInInput objForm = new FormMaterialsInInput();
                objForm.MdiParent  = this.MdiParent;
                objForm.giOrderID  = iOrderID;
                objForm.strBooksNo = strBooksNo;
                objForm.Show();
            }
        }