Exemplo n.º 1
0
        /// <summary>
        /// 设置表格格式
        /// </summary>
        protected virtual void SetGridFormat()
        {
            frmSetGrid myGrid = new frmSetGrid();

            myGrid.gvSource = gvReport;
            myGrid.ShowDialog();
            myGrid.Dispose();
        }
Exemplo n.º 2
0
        private void frmKQReport_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F7 && DataLib.SysVar.strUGroup == "超级用户")
            {
                Common.frmSetGrid myGrid = new Common.frmSetGrid();
                myGrid.gvSource = viewQuery;
                myGrid.ShowDialog();
                myGrid.Dispose();
            }

            if (e.KeyCode == Keys.F5 && DataLib.SysVar.strUGroup == "超级用户")
            {
                DataLib.sysClass.SaveGridToDB(viewQuery, this.Name, 0);
            }
        }
Exemplo n.º 3
0
        private void frmBaseList_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F7 && DataLib.SysVar.strUGroup == "超级用户")
            {
                frmSetGrid myGrid = new frmSetGrid();
                myGrid.gvSource = gvBase;
                myGrid.ShowDialog();
                myGrid.Dispose();
            }

            if (e.KeyCode == Keys.F5 && DataLib.SysVar.strUGroup == "超级用户")
            {
                DataLib.sysClass.SaveGridToDB(gvBase, this.Name, 0);
                //SaveFieldFormat();
            }
        }
Exemplo n.º 4
0
        private void frmBillList_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F7 && DataLib.SysVar.strUGroup == "超级用户")
            {
                frmSetGrid myGrid = new frmSetGrid();
                myGrid.gvSource = gvList;
                myGrid.ShowDialog();
                myGrid.Dispose();
            }

            if (e.KeyCode == Keys.F5 && DataLib.SysVar.strUGroup == "超级用户")
            {
                DataLib.sysClass.SaveGridToDB(gvList, BillTag, cbType.SelectedIndex);
                //SaveFieldFormat();
            }

            if (e.Control == true && e.KeyCode == Keys.F9)
            {
                frmSQL mySQL = new frmSQL();
                mySQL.MeSQL.Text = strQuerySQL;
                if (mySQL.ShowDialog() == DialogResult.OK)
                {
                    strQuerySQL = mySQL.MeSQL.Text;
                    if (BindData() == 0)
                    {
                        DataLib.DataHelper myHelper = new DataLib.DataHelper();
                        string             strSQL   = "select * from t_SQL where F_Class = '" + BillTag + "' and F_Tag = '" + cbType.SelectedIndex.ToString() + "'";
                        DataSet            ds       = myHelper.GetDs(strSQL);
                        if (ds.Tables[0].Rows.Count == 0)
                        {
                            DataRow drNew = ds.Tables[0].NewRow();
                            drNew["F_Class"] = BillTag;
                            drNew["F_Tag"]   = cbType.SelectedIndex.ToString();
                            drNew["F_SQL"]   = strQuerySQL;
                            ds.Tables[0].Rows.Add(drNew);
                        }
                        else
                        {
                            ds.Tables[0].Rows[0]["F_SQL"] = strQuerySQL;
                        }
                        myHelper.SaveData(ds, strSQL);
                    }
                }
                mySQL.Dispose();
            }
        }
Exemplo n.º 5
0
        private void frmBillImport_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Control == true && e.KeyCode == Keys.F11)
            {
                frmSetField mySetField = new frmSetField();
                mySetField.dtSource  = ((DataView)gcMaster.DataSource).Table;
                mySetField.dtSource1 = ((DataView)gcSlaver.DataSource).Table;
                mySetField.dtDes     = dtMaster;
                mySetField.dtDes1    = dtSlaver;
                mySetField.strType   = strBillType;
                mySetField.strClass  = cbBill.Text;
                mySetField.ShowDialog();
                mySetField.Dispose();
            }

            if (e.KeyCode == Keys.F7)
            {
                frmSetGrid myGrid = new frmSetGrid();
                if (gcMaster.Focused == true)
                {
                    myGrid.gvSource = gvMaster;
                }
                else
                {
                    myGrid.gvSource = gvSlaver;
                }
                myGrid.ShowDialog();
                myGrid.Dispose();
            }

            if (e.KeyCode == Keys.F5)
            {
                DataLib.sysClass.SaveGridToDB(gvMaster, BillTag, 0);
                DataLib.sysClass.SaveGridToDB(gvSlaver, BillTag, 1);
                //SaveFieldFormat();
                //SaveFieldFormat1();
            }
        }