Beispiel #1
0
        /// <summary>
        /// Get Next Table Key from the local client keys cache.
        /// </summary>
        /// <param name="TableName">Table Name key</param>
        /// <param name="GoToServerIfEmpty">If no more keys in the client cache go to server to get next key</param>
        /// <returns></returns>
        public int NextClientTableKey(string TableName, bool GoToServerIfEmpty)
        {
            int KeyValue = 0;
            ClientDataAccess cda = new ClientDataAccess();
            string sql = "SELECT * FROM i9ClientTableKey WHERE " + TableName + " ";
            DataTable dt = cda.GetDataTable(sql, "i9ClientTableKey");
            if (dt != null)
            {
                //if(ds.Tables.Count > 0)
                if (dt.Rows.Count > 0)
                    KeyValue = Convert.ToInt32(dt.Rows[0]["KeyValue"].ToString());
            }

            if (KeyValue == 0)
            {
                if (GoToServerIfEmpty)
                    KeyValue = NextServerTableKey(TableName);
            }

            if (KeyValue == 0)
            {
                throw new Exception("Unable to get the next table key for: " + TableName);
            }

            return KeyValue;
        }
Beispiel #2
0
        private void i9ComboBox_DropDownOpened(object sender, EventArgs e)
        {
            i9ComboBox i9cb = (i9ComboBox)sender;

            if (!String.IsNullOrEmpty(i9cb.i9BindCodeSetName) && i9cb.Items.Count <= 0)
            {
                ClientDataAccess cda = new ClientDataAccess();
                DataTable dt = cda.GetDataTable("SELECT Code, CodeText FROM i9Code WHERE Enabled <> 0 AND CodeSetName = " + DataAccessUtilities.GetDBStr(i9cb.i9BindCodeSetName) + " Order By CodeText ", "i9Code");
                i9ComboBox.PopulateCombobox(i9cb, dt, "i9Code");
            }
        }
        private void CodeSetNameComboBox_DropDownOpened(object sender, EventArgs e)
        {
            if (CodeSetNameComboBox.Items.Count <= 0)
            {
                CodeSetNameComboBox.DisplayMemberPath = "CodeSetName";
                CodeSetNameComboBox.SelectedValue = "CodeSetName";
                CodeSetNameComboBox.SelectedValuePath = "CodeSetName";

                ClientDataAccess cda = new ClientDataAccess();
                DataTable dt = cda.GetDataTable("SELECT CodeSetName FROM i9Code Group By CodeSetName Order By CodeSetName ", "i9Code");
                i9ComboBox.PopulateCombobox(CodeSetNameComboBox, dt, "CodeSetName");
            }
        }
 private void ControlTypeComboBox_DropDownOpened(object sender, EventArgs e)
 {
     if (ControlTypeComboBox.Items.Count <= 0)
     {
         ClientDataAccess cda = new ClientDataAccess();
         DataTable dt = cda.GetDataTable("SELECT CtrlTypeName, CtrlTypeDesc FROM i9DynamicEntryCtrlType ", "i9DynamicEntryCtrlType");
         i9ComboBox.PopulateCombobox(ControlTypeComboBox, dt, "CtrlTypeName");        
     }
 }