Ejemplo n.º 1
0
        private void butsh_Click(object sender, System.EventArgs e)
        {
            try
            {
                int       nrow = this.myDataGrid1.CurrentCell.RowNumber;
                DataTable tb   = (DataTable)this.myDataGrid1.DataSource;
                ypconfig = new YpConfig(Convert.ToInt32(Convertor.IsNull(cmbck.SelectedValue, "0")), InstanceForm.BDatabase);

                if (tb.Rows.Count == 0)
                {
                    return;
                }
                if (ypconfig.盘存方式 == "0")
                {
                    Frmzylr f     = new Frmzylr(_menuTag, _chineseName, _mdiParent);
                    Point   point = new Point(160, 75);
                    f.Location  = point;
                    f.MdiParent = _mdiParent;
                    f.Show();
                    f.FillDj(new Guid(tb.Rows[nrow]["id"].ToString()), this.rdo2.Checked);
                }
                else
                {
                    Frmzylr_kcmx f     = new Frmzylr_kcmx(_menuTag, _chineseName, _mdiParent);
                    Point        point = new Point(160, 75);
                    f.Location  = point;
                    f.MdiParent = _mdiParent;
                    f.Show();
                    f.FillDj(new Guid(tb.Rows[nrow]["id"].ToString()), this.rdo2.Checked);
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }
Ejemplo n.º 2
0
        private void butdown_Click(object sender, System.EventArgs e)
        {
            #region 如是维护模板
            if (this.rdowhmb.Checked == true)
            {
                this.Close();
                Frmmbmx f     = new Frmmbmx(_menuTag, _chineseName, _mdiParent);
                Point   point = new Point(160, 160);
                f.Location  = point;
                f.MdiParent = _mdiParent;
                f.Show();
                return;
            }
            #endregion

            #region 如果是打开模板
            if (this.rdomb.Checked == true)
            {
                if (BegionPd() == false)
                {
                    MessageBox.Show("请先生成盘点帐存表"); return;
                }
                if (Convert.ToString(this.cmbmb.Text.Trim()) == "")
                {
                    MessageBox.Show("请选择要打开的模板", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                else
                {
                    try
                    {
                        this.Cursor = PubStaticFun.WaitCursor();;
                        this.Close();
                        if (ypconfig.盘存方式 == "0")
                        {
                            Frmzylr f     = new Frmzylr(_menuTag, _chineseName, _mdiParent);
                            Point   point = new Point(160, 75);
                            f.txtbz.Text = "模板:" + cmbmb.Text.Trim();
                            f.Location   = point;
                            f.MdiParent  = _mdiParent;
                            f.Show();
                            f.AddMB(Convert.ToInt32(Convertor.IsNull(this.cmbmb.SelectedValue, "0")));
                        }
                        else
                        {
                            Frmzylr_kcmx f     = new Frmzylr_kcmx(_menuTag, _chineseName, _mdiParent);
                            Point        point = new Point(160, 75);
                            f.txtbz.Text = "模板:" + cmbmb.Text.Trim();
                            f.Location   = point;
                            f.MdiParent  = _mdiParent;
                            f.Show();
                            f.AddMB(Convert.ToInt32(Convertor.IsNull(this.cmbmb.SelectedValue, "0")));
                        }
                    }
                    catch (System.Exception err)
                    {
                        MessageBox.Show(err.Message);
                    }
                    finally
                    {
                        this.Cursor = Cursors.Arrow;
                    }
                }
            }
            #endregion

            #region 手动录入
            if (this.rdozy.Checked == true && this.panelf.Visible == true)
            {
                if (BegionPd() == false)
                {
                    MessageBox.Show("请先生成盘点帐存表"); return;
                }
                this.Close();
                if (ypconfig.盘存方式 == "0")
                {
                    Frmzylr f     = new Frmzylr(_menuTag, _chineseName, _mdiParent);
                    Point   point = new Point(160, 75);
                    f.Location  = point;
                    f.MdiParent = _mdiParent;
                    f.Show();
                }
                else
                {
                    Frmzylr_kcmx f     = new Frmzylr_kcmx(_menuTag, _chineseName, _mdiParent);
                    Point        point = new Point(160, 75);
                    f.Location  = point;
                    f.MdiParent = _mdiParent;
                    f.Show();
                }

                return;
            }
            #endregion
        }