Beispiel #1
0
 void dlg_GetValueTable(object sender, GetValueTableEventArgs e)
 {
     if (this.GetValueTable != null)
     {
         this.GetValueTable(sender, e);
     }
 }
Beispiel #2
0
 void orderDesignControl1_GetValueTable(object sender, GetValueTableEventArgs e)
 {
     if (this.GetValueTable != null)
     {
         this.GetValueTable(sender, e);
     }
 }
Beispiel #3
0
 internal void OnGetValueTable(object sender, GetValueTableEventArgs e)
 {
     if (this.GetValueTable != null)
     {
         this.GetValueTable(this, e);  // sender
     }
 }
        private void comboBox_seller_DropDown(object sender, EventArgs e)
        {
            if (this.m_nInDropDown > 0)
            {
                return;
            }

            Cursor oldCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                ComboBox combobox = (ComboBox)sender;

                if (combobox.Items.Count == 0 &&
                    this.GetValueTable != null)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName = "";

                    if (combobox == this.comboBox_seller)
                    {
                        e1.TableName = "orderSeller";
                    }
                    else
                    {
                        Debug.Assert(false, "不支持的sender");
                        return;
                    }

                    this.GetValueTable(this, e1);

                    if (e1.values != null)
                    {
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            string strValue = e1.values[i];

                            // 只加入ExcludeSeller以外的值
                            if (this.ExcludeSellers.IndexOf(strValue) == -1)
                            {
                                combobox.Items.Add(e1.values[i]);
                            }
                        }
                    }
                    else
                    {
                        combobox.Items.Add("<not found>");
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
        private void comboBox_DropDown(object sender, EventArgs e)
        {
            // 防止重入 2009/7/19
            if (this.m_nInDropDown > 0)
            {
                return;
            }

            Cursor oldCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                ComboBox combobox = (ComboBox)sender;

                if (combobox.Items.Count == 0 &&
                    this.GetValueTable != null)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName = this.DbName;

                    if (combobox == this.comboBox_source)
                    {
                        e1.TableName = "orderSource";
                    }
                    else if (combobox == this.comboBox_seller)
                    {
                        e1.TableName = "orderSeller";
                    }
                    else
                    {
                        Debug.Assert(false, "不支持的sender");
                        return;
                    }

                    this.GetValueTable(this, e1);

                    if (e1.values != null)
                    {
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            combobox.Items.Add(e1.values[i]);
                        }
                    }
                    else
                    {
                        combobox.Items.Add("<not found>");
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
Beispiel #6
0
        private void comboBox_state_DropDown(object sender, EventArgs e)
        {
            // 防止重入 2009/7/19
            if (this.m_nInDropDown > 0)
            {
                return;
            }

            ComboBox combobox = (ComboBox)sender;

            Cursor oldCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                if (combobox.Items.Count == 0
                    /*&& this.GetValueTable != null*/)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName = this.BiblioDbName;  // 2009/2/15 change

                    if (combobox == this.comboBox_state)
                    {
                        e1.TableName = "issueState";
                    }
                    else
                    {
                        Debug.Assert(false, "不支持的sender");
                        return;
                    }

                    // this.GetValueTable(this, e1);
                    OnGetValueTable(this, e1);

                    if (e1.values != null)
                    {
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            combobox.Items.Add(e1.values[i]);
                        }
                    }
                    else
                    {
                        combobox.Items.Add("<not found>");
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
Beispiel #7
0
        void FillDropDown(ComboBox combobox)
        {
            // 防止重入 2009/7/19
            if (this.m_nInDropDown > 0)
            {
                return;
            }

            Cursor oldCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                if (combobox.Items.Count == 0 &&
                    this.GetLocationValueTable != null)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName = this.RefDbName;

                    if (combobox == this.comboBox_location)
                    {
                        e1.TableName = "location";
                    }
                    else
                    {
                        Debug.Assert(false, "不支持的combobox");
                    }


                    this.GetLocationValueTable(this, e1);

                    // combobox.Items.Add("<不指定>");

                    if (e1.values != null)
                    {
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            combobox.Items.Add(e1.values[i]);
                        }
                    }
                    else
                    {
                        combobox.Items.Add("{not found}");
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
Beispiel #8
0
        void FillDropDown(ComboBox combobox)
        {
            if (this._actionCfg == null ||
                string.IsNullOrEmpty(this._actionCfg.List) == true)
            {
                return;
            }

            // 防止重入
            if (this.m_nInDropDown > 0)
            {
                return;
            }

            Cursor oldCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                if (combobox.Items.Count <= 0 &&
                    this.GetValueTable != null)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName    = this.RefDbName;
                    e1.TableName = this._actionCfg.List;

                    this.GetValueTable(this, e1);

                    // combobox.Items.Add("<不改变>");

                    if (e1.values != null)
                    {
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            combobox.Items.Add(e1.values[i]);
                        }
                    }
                    else
                    {
                        // combobox.Items.Add("{not found}");
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
Beispiel #9
0
        private void comboBox_operation_DropDown(object sender, EventArgs e)
        {
            // 防止重入 2009/7/19
            if (this.m_nInDropDown > 0)
            {
                return;
            }

            Cursor oldCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                ComboBox combobox = (ComboBox)sender;

                if (combobox.Items.Count == 0 &&
                    this.GetValueTable != null)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    if (String.IsNullOrEmpty(this.RecPath) == false)
                    {
                        e1.DbName = Global.GetDbName(this.RecPath);
                    }

                    e1.TableName = "readerState";

                    this.GetValueTable(this, e1);

                    if (e1.values != null)
                    {
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            combobox.Items.Add(e1.values[i]);
                        }
                    }
                    else
                    {
                        combobox.Items.Add("<not found>");
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
Beispiel #10
0
        void readerEditControl_newReaderDefault_GetValueTable(object sender, GetValueTableEventArgs e)
        {
            string strError = "";

            string[] values = null;
            int      nRet   = MainForm.GetValueTable(e.TableName,
                                                     e.DbName,
                                                     out values,
                                                     out strError);

            if (nRet == -1)
            {
                MessageBox.Show(this, strError);
            }
            e.values = values;
        }
Beispiel #11
0
        private void commentEditControl_editing_GetValueTable(object sender, GetValueTableEventArgs e)
        {
            string strError = "";

            string[] values = null;
            int      nRet   = MainForm.GetValueTable(e.TableName,
                                                     e.DbName,
                                                     out values,
                                                     out strError);

            if (nRet == -1)
            {
                MessageBox.Show(this, strError);
            }
            e.values = values;
        }
Beispiel #12
0
        void dlg_GetValueTable(object sender, GetValueTableEventArgs e)
        {
            string strError = "";

            string[] values = null;
            int      nRet   = Program.MainForm.GetValueTable(e.TableName,
                                                             e.DbName,
                                                             out values,
                                                             out strError);

            if (nRet == -1)
            {
                MessageBox.Show(this, strError);
            }
            e.values = values;
        }
Beispiel #13
0
        void FillReaderStateDropDown(CheckedComboBox combobox)
        {
            // 防止重入
            if (this.m_nInDropDown > 0)
            {
                return;
            }

            Cursor oldCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                if (combobox.Items.Count <= 0 &&
                    this.GetValueTable != null)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName = this.RefDbName;

                    e1.TableName = "readerState";

                    this.GetValueTable(this, e1);

                    if (e1.values != null)
                    {
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            combobox.Items.Add(e1.values[i]);
                        }
                    }
                    else
                    {
                        // combobox.Items.Add("{not found}");
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
Beispiel #14
0
        void FillStateDropDown(CheckedComboBox combobox)
        {
            // 防止重入
            if (this.m_nInDropDown > 0)
            {
                return;
            }

#if NO
            string strTableName = "";
            if (_stateActionCfg != null)
            {
                strTableName = _stateActionCfg.List;
            }
#endif

            Cursor oldCursor = this.Cursor;
            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                if (combobox.Items.Count <= 0 &&
                    this.GetValueTable != null)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName    = this.RefDbName;
                    e1.TableName = this._actionCfg.List;

#if NO
                    if (this.DbType == "patron")
                    {
                        e1.TableName = "readerState";
                    }
                    else if (this.DbType == "item")
                    {
                        e1.TableName = "state";
                    }
                    else
                    {
                        e1.TableName = this.DbType + "State";
                    }
#endif

                    this.GetValueTable(this, e1);

                    if (e1.values != null)
                    {
                        if (e1.TableName == "readerState" && e1.values.Length == 0)
                        {
                            e1.values = StringUtil.SplitList("注销,停借,挂失").ToArray();
                        }
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            combobox.Items.Add(e1.values[i]);
                        }
                    }
                    else
                    {
                        // combobox.Items.Add("{not found}");
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
Beispiel #15
0
        private void comboBox_DropDown(object sender, EventArgs e)
        {
            if (this.m_nInDropDown > 0)
            {
                return;
            }

            Cursor oldCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                CheckedComboBox checked_combobox = null;
                ComboBox        combobox         = null;
                int             nCount           = 0;

                if (sender is CheckedComboBox)
                {
                    checked_combobox = (CheckedComboBox)sender;
                    nCount           = checked_combobox.Items.Count;
                }
                else if (sender is ComboBox)
                {
                    combobox = (ComboBox)sender;
                    nCount   = combobox.Items.Count;
                }
                else
                {
                    throw new Exception("invalid sender type. must by ComboBox or CheckedComboBox");
                }

                if (nCount == 0
                    /*&& this.GetValueTable != null*/)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName = this.BiblioDbName;  // 2009/2/15 changed

                    if (combobox == this.comboBox_type)
                    {
                        e1.TableName = "commentType";   // 评注类型
                    }
                    else if (combobox == this.comboBox_orderSuggestion)
                    {
                        e1.TableName = "orderSuggestion";   // 订购建议
                    }
                    else if (checked_combobox == this.checkedComboBox_state)
                    {
                        e1.TableName = "commentState";  // 评注状态
                    }
                    else
                    {
                        Debug.Assert(false, "不支持的sender");
                        return;
                    }

                    // this.GetValueTable(this, e1);
                    this.OnGetValueTable(this, e1);

                    if (e1.values != null)
                    {
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            if (combobox != null)
                            {
                                combobox.Items.Add(e1.values[i]);
                            }
                            else
                            {
                                checked_combobox.Items.Add(e1.values[i]);
                            }
                        }
                    }
                    else
                    {
                        if (combobox != null)
                        {
                            combobox.Items.Add("<not found>");
                        }
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
        private void comboBox_DropDown(object sender, EventArgs e)
        {
            // 防止重入 2009/7/19
            if (this.m_nInDropDown > 0)
                return;

            Cursor oldCursor = this.Cursor;
            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                ComboBox combobox = (ComboBox)sender;

                if (combobox.Items.Count == 0
                    && this.GetValueTable != null)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName = this.DbName;

                    if (combobox == this.comboBox_source)
                        e1.TableName = "orderSource";
                    else if (combobox == this.comboBox_seller)
                        e1.TableName = "orderSeller";
                    else
                    {
                        Debug.Assert(false, "不支持的sender");
                        return;
                    }

                    this.GetValueTable(this, e1);

                    if (e1.values != null)
                    {
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            combobox.Items.Add(e1.values[i]);
                        }
                    }
                    else
                    {
                        combobox.Items.Add("<not found>");
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
Beispiel #17
0
        void FillItemStateDropDown(CheckedComboBox combobox)
        {
            // 防止重入
            if (this.m_nInDropDown > 0)
            {
                return;
            }

            Cursor oldCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                if (combobox.Items.Count <= 0 &&
                    this.GetValueTable != null)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName = this.RefDbName;

                    e1.TableName = "state";

                    this.GetValueTable(this, e1);

                    if (e1.values != null)
                    {
                        List <string> results = null;

                        string strLibraryCode = "";
                        string strPureName    = "";

                        string strLocationString = this.comboBox_location.Text;
                        if (strLocationString == "<不改变>")
                        {
                            strLocationString = "";
                        }

                        Global.ParseCalendarName(strLocationString,
                                                 out strLibraryCode,
                                                 out strPureName);

                        if (String.IsNullOrEmpty(strLocationString) == false)
                        {
                            // 过滤出符合馆代码的那些值字符串
                            results = Global.FilterValuesWithLibraryCode(strLibraryCode,
                                                                         StringUtil.FromStringArray(e1.values));
                        }
                        else
                        {
                            results = StringUtil.FromStringArray(e1.values);
                        }

                        foreach (string s in results)
                        {
                            combobox.Items.Add(s);
                        }
#if NO
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            combobox.Items.Add(e1.values[i]);
                        }
#endif
                    }
                    else
                    {
                        // combobox.Items.Add("{not found}");
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
Beispiel #18
0
 public void OnGetValueTable(object sender, GetValueTableEventArgs e)
 {
     if (this.GetValueTable != null)
         this.GetValueTable(sender, e);
 }
Beispiel #19
0
 void dlg_GetValueTable(object sender, GetValueTableEventArgs e)
 {
     this.Container.OnGetValueTable(sender, e);
 }
Beispiel #20
0
        void comboBox_seller_DropDown(object sender, EventArgs e)
        {
            // 防止重入 2009/1/15
            if (this.m_nInDropDown > 0)
                return;

            Cursor oldCursor = this.Container.Cursor;
            this.Container.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {

                ComboBox combobox = null;

                if (sender is DoubleComboBox)
                    combobox = ((DoubleComboBox)sender).ComboBox;
                else
                    combobox = (ComboBox)sender;

                if (combobox.Items.Count == 0
                    && this.Container.HasGetValueTable() != false)
                {
                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName = this.Container.BiblioDbName;

                    if (combobox == this.comboBox_seller)
                        e1.TableName = "orderSeller";
                    else if (combobox == this.comboBox_class)
                        e1.TableName = "orderClass";
                    else if (combobox == this.comboBox_source.ComboBox)
                        e1.TableName = "orderSource";
                    else if (combobox == this.comboBox_copy.ComboBox)
                        e1.TableName = "orderCopy";
                    else
                    {
                        Debug.Assert(false, "不支持的sender");
                        return;
                    }

                    this.Container.OnGetValueTable(this, e1);

                    if (e1.values != null)
                    {
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            combobox.Items.Add(e1.values[i]);
                        }
                    }
                    else
                    {
                        combobox.Items.Add("<not found>");
                    }
                }
            }
            finally
            {
                this.Container.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }
Beispiel #21
0
 void textBox_location_GetValueTable(object sender, GetValueTableEventArgs e)
 {
     this.Container.OnGetValueTable(sender, e);
 }
        private void comboBox_location_DropDown(object sender, EventArgs e)
        {
            // 防止重入 2009/2/23
            if (this.m_nInDropDown > 0)
            {
                return;
            }

            Cursor oldCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            this.m_nInDropDown++;
            try
            {
                ComboBox combobox = (ComboBox)sender;
                int      nCount   = combobox.Items.Count;

                if (combobox.Items.Count == 0 &&
                    this.GetValueTable != null)
                {
                    // combobox.Items.Add("<空>");

                    GetValueTableEventArgs e1 = new GetValueTableEventArgs();
                    e1.DbName = "";

                    if (combobox == this.comboBox_location)
                    {
                        e1.TableName = "location";
                    }
                    else
                    {
                        Debug.Assert(false, "不支持的sender");
                        return;
                    }

                    this.GetValueTable(this, e1);

                    if (e1.values != null)
                    {
                        List <string> values = new List <string>();
                        for (int i = 0; i < e1.values.Length; i++)
                        {
                            // 排除部分已经用过的值
                            if (this.ExcludingLocationNames != null)
                            {
                                if (this.ExcludingLocationNames.IndexOf(e1.values[i]) != -1)
                                {
                                    continue;
                                }
                            }

                            values.Add(e1.values[i]);
                        }

                        List <string> results = null;

                        if (String.IsNullOrEmpty(this.LibraryCodeList) == false)
                        {
                            // 过滤出符合馆代码的那些值字符串
                            results = Global.FilterLocationsWithLibraryCodeList(this.LibraryCodeList,
                                                                                values);
                        }
                        else
                        {
                            results = values;
                        }

                        foreach (string s in results)
                        {
                            combobox.Items.Add(GetDisplayString(s));
                        }
                    }

                    else
                    {
                        combobox.Items.Add("<not found>");
                    }
                }
            }
            finally
            {
                this.Cursor = oldCursor;
                this.m_nInDropDown--;
            }
        }