Exemplo n.º 1
0
        private void btnItemDown_Click(object sender, EventArgs e)
        {
            Int32 i = lstDocTypes.SelectedIndex;

            if (i < lstDocTypes.Items.Count - 1)
            {
                CheckedListBoxItem docType = (CheckedListBoxItem)lstDocTypes.Items[i];
                lstDocTypes.Items.RemoveAt(i);
                lstDocTypes.Items.Insert(i + 1, docType);
                lstDocTypes.SelectedIndex = i + 1;
            }
            else
            {
                lstDocTypes.SelectedIndex = i;
            }
        }
        private void connectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Connect connForm = Connect.GetChildInstance();

            if (connForm.ShowDialog(this) == DialogResult.OK)
            {
                this.DocListChkLst.Items.Clear();
                this.connector          = new OBConnection(connForm.ConnName, connForm.ConnString);
                this.ConnStatusLbl.Text = "Connection Name: " + connForm.ConnName;

                String queryString = "select itemtypenum, trim(itemtypename) from hsi.doctype where itemtypenum in (select itemtypenum from hsi.scanqueuexit) and itemtypegroupnum > 100 order by itemtypename";
                Type[] typeAr      = { Type.GetType("System.Int32"), Type.GetType("System.String") };
                System.Data.DataSet   DocumentTypes = this.connector.Query(queryString, typeAr);
                System.Data.DataTable DocTypeTable  = DocumentTypes.Tables[0];

                for (Int32 x = 0; x < DocTypeTable.Rows.Count; x++)
                {
                    CheckedListBoxItem clbItem = new CheckedListBoxItem((System.String)DocTypeTable.Rows[x][1], System.Decimal.ToInt32((System.Decimal)DocTypeTable.Rows[x][0]));
                    DocListChkLst.Items.Add(clbItem);
                }
            }
        }
        private void connectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Connect connForm = Connect.GetChildInstance();
            if (connForm.ShowDialog(this) == DialogResult.OK)
            {
                this.DocListChkLst.Items.Clear();
                this.connector = new OBConnection(connForm.ConnName, connForm.ConnString);
                this.ConnStatusLbl.Text = "Connection Name: " + connForm.ConnName;

                String queryString = "select itemtypenum, trim(itemtypename) from hsi.doctype where itemtypenum in (select itemtypenum from hsi.scanqueuexit) and itemtypegroupnum > 100 order by itemtypename";
                Type[] typeAr = { Type.GetType("System.Int32"), Type.GetType("System.String") };
                System.Data.DataSet DocumentTypes = this.connector.Query(queryString, typeAr);
                System.Data.DataTable DocTypeTable = DocumentTypes.Tables[0];

                for (Int32 x = 0; x < DocTypeTable.Rows.Count; x++)
                {
                    CheckedListBoxItem clbItem = new CheckedListBoxItem((System.String)DocTypeTable.Rows[x][1], System.Decimal.ToInt32((System.Decimal)DocTypeTable.Rows[x][0]));
                    DocListChkLst.Items.Add(clbItem);
                }
            }
        }