private void Form_Load(object sender, EventArgs e)
        {
            this.Text = "新增" + _Catalog;

            Access = new AccessHelper();
            List<GraduationRequirement> graduationRequirements = Access.Select<GraduationRequirement>();
            List<DepartmentGroup> departmentGroups = Access.Select<DepartmentGroup>();

            ComboItem comboItem1 = new ComboItem("不進行複製");
            comboItem1.Tag = null;

            this.cboGraduationRequirementRule.Items.Add(comboItem1);
            foreach (GraduationRequirement var in graduationRequirements)
            {
                IEnumerable<DepartmentGroup> filterRecords = departmentGroups.Where(x => x.UID == var.DepartmentGroupID.ToString());
                if (filterRecords.Count() == 0)
                    continue;

                string departmentGroup = filterRecords.Select(x => x.Name).ElementAt(0);
                ComboItem item = new ComboItem(departmentGroup + "-" + var.Name);
                item.Tag = var;
                cboGraduationRequirementRule.Items.Add(item);
            }

            cboGraduationRequirementRule.SelectedItem = comboItem1;
            txtName.Focus();
        }
        private void Form_Load(object sender, EventArgs e)
        {
            this.Text = (_Survey == null ? "新增" : "修改") + "評鑑樣版";
            this.txtName.Text = (this._Survey == null ? string.Empty : this._Survey.Name);

            if (this._Survey != null)
            {
                this.cboSurvey.Enabled = false;
                this.txtCategory.Text = this._Survey.Category;
                this.txtDescription.Text = this._Survey.Description;
                return;
            }

            List<UDT.Survey> Surveys = Access.Select<UDT.Survey>();

            ComboItem comboItem1 = new ComboItem("不進行複製");
            comboItem1.Tag = null;

            this.cboSurvey.Items.Add(comboItem1);
            foreach (UDT.Survey var in Surveys)
            {
                ComboItem item = new ComboItem(var.Name);
                item.Tag = var;
                cboSurvey.Items.Add(item);
            }

            cboSurvey.SelectedItem = comboItem1;
            txtName.Focus();
        }
        private void _BKWGraduationPlanLoader_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            comboBoxEx1.Items.Remove(comboItem2);
            GraduationPlanInfoCollection resp = (GraduationPlanInfoCollection)e.Result;

            foreach (GraduationPlanInfo gPlan in resp)
            {
                DevComponents.Editors.ComboItem item = new DevComponents.Editors.ComboItem();
                item.Text = gPlan.Name;
                item.Tag  = gPlan.GraduationPlanElement;
                comboBoxEx1.Items.Add(item);
            }
        }
        private void DataBind()
        {
            this.Survey.Items.Clear();
            DataTable myTable = Query.Select(@"select uid, name from $ischool.emba.teaching_evaluation.survey");
            //ComboItem ComboItem1 = new ComboItem("");
            //this.Survey.Items.Add(ComboItem1);
            //this.Survey.SelectedItem = ComboItem1;
            foreach (DataRow row in myTable.Rows)
            {
                ComboItem ComboItem = new ComboItem(row["name"] + "");
                ComboItem.Tag = row["uid"] + "";

                this.Survey.Items.Add(ComboItem);
                if (this.Template != null && this.Template.SurveyID.ToString() == (row["uid"] + ""))
                    this.Survey.SelectedItem = ComboItem;
            }
        }
Exemplo n.º 5
0
        protected ComboItem  CreateComboItem(ChoiceBase choice, UIItemDisplayProperties display)
        {
            string label = display.Text;

            if (label == null)
            {
                label = AdapterStrings.ErrorGeneratingLabel;
            }

            if (!display.Visible)
            {
                return(null);
            }

            label = label.Replace("_", "&");
            DevComponents.Editors.ComboItem item = new DevComponents.Editors.ComboItem();
            item.Text = label;

            Debug.Assert(item != null);
            item.Tag = choice;
            choice.ReferenceWidget = item;
            return(item);
        }
        private void DGV_DataBinding(ComboItem item)
        {
            List<string> SelectedCourseIDs = new List<string>();

            if (!string.IsNullOrEmpty(item.Tag + ""))
                this.DGV_DataBinding(new List<string> { item.Tag + "" });
            else
                this.DGV_DataBinding(this.cboCourse.Items.Cast<ComboItem>().ToList().Where(x => !string.IsNullOrEmpty(x.Tag + "")).Select(x => x.Tag + ""));
        }
 private void InitAreaControl()
 {
     this.cmbArea.Items.Clear();
     ComboItem comboItem = new ComboItem();
     comboItem.Text = "请选择";
     comboItem.Value = "-1";
     this.cmbArea.Items.Add(comboItem);
     IntegratedArea area = this.m_regHelper.GetArea();
     if (area != null && area.result == "success")
     {
         foreach (area current in area.data.areaList)
         {
             ComboItem comboItem2 = new ComboItem();
             comboItem2.Text = current.areaName;
             comboItem2.Value = current.areaCode;
             this.cmbArea.Items.Add(comboItem2);
         }
     }
     this.cmbArea.SelectedIndex = 0;
 }
Exemplo n.º 8
0
        /// <summary>
        /// 建構式,傳入精靈參數
        /// </summary>
        /// <param name="args"></param>
        public SelectKey(ArgDictionary args)
            : base(args)
        {
            InitializeComponent();
            mArgs = args;
            mImportOption = args["ImportOption"] as ImportFullOption;
            mImportWizard = args["EMBA.ImportWizard"] as ImportWizard;
            this.Text = mImportWizard.ValidateRule.Root.GetAttributeText("Name") + "-" + this.Text;
            this.Text += "(" + CurrentStep + "/" + TotalStep + ")"; //功能名稱(目前頁數/總頁數)

            #region 將使用者可選擇的鍵值顯示在畫面上
            mSelectableKeyFields = args["SelectableKeyFields"] as Dictionary<string, List<string>>;
            int cboIdFieldLen = cboIdField.Width;

            foreach (string key in mSelectableKeyFields.Keys)
            {
                ComboItem item = new ComboItem(key);
                item.Tag = mSelectableKeyFields[key];

                cboIdField.Items.Add(item);

                if (key.Length > cboIdFieldLen)
                    cboIdFieldLen = key.Length;
            }

            if (cboIdField.Items.Count > 0)
            {
                cboIdField.SelectedIndex = 0;
                //cboIdField.Width = cboIdFieldLen;
            }
            #endregion

            #region 將使用者可選擇的資料動作
            ImportAction Actions = mImportWizard.GetSupportActions();

            bool IsInsert = (Actions & ImportAction.Insert) == ImportAction.Insert;
            bool IsUpdate = (Actions & ImportAction.Update) == ImportAction.Update;
            bool IsInsertOrUpdate = (Actions & ImportAction.InsertOrUpdate) == ImportAction.InsertOrUpdate;
            bool IsCover = (Actions & ImportAction.Cover) == ImportAction.Cover;
            bool IsDelete = (Actions & ImportAction.Delete) == ImportAction.Delete;

            if (IsInsert)
                lstActions.Items.Add("新增資料");
            if (IsUpdate)
                lstActions.Items.Add("更新資料");
            if (IsInsertOrUpdate)
                lstActions.Items.Add("新增或更新資料");
            if (IsCover)
                lstActions.Items.Add("覆蓋資料");

            lstActions.SelectedIndexChanged += (sender, e) =>
            {
                switch ("" + lstActions.SelectedItem)
                {
                    case "新增資料": lblImportActionMessage.Text = "此選項是將所有資料新增到資料庫中,不會對現有的資料進行任何修改動作。"; break;
                    case "更新資料": lblImportActionMessage.Text = "此選項將修改資料庫中的現有資料,會依據您所指定的識別欄修改資料庫中具有相同識別的資料。"; break;
                    case "新增或更新資料": lblImportActionMessage.Text = "此選項是將資料新增或更新到資料庫中,會針對您的資料來自動判斷新增或更新。"; break;
                    case "覆蓋資料": lblImportActionMessage.Text = "此選項是將資料庫中的資料都先刪除再全部新增"; break;
                    case "刪除資料": lblImportActionMessage.Text = "此選項將依匯入資料中的鍵值刪除資料庫中的現有資料,請您務必小心謹慎使用。"; break;
                };
            };

            lstActions.KeyDown  += (sender, e) =>
            {
                if (e.KeyData == System.Windows.Forms.Keys.Delete)
                    if (IsDelete)
                        lstActions.Items.Add("刪除資料");
            };

            lstActions.SelectedIndex = 0;

            #endregion
        }
Exemplo n.º 9
0
        protected virtual Size GetComboItemSize(ComboItem item, Graphics g)
        {
            if (this.DrawMode == DrawMode.OwnerDrawFixed)
                return new Size(this.DropDownWidth, this.ItemHeight);

            Size sz = Size.Empty;
            Size textSize = Size.Empty;
            Image img = null;
            if (item.ImageIndex >= 0)
                img = m_ImageList.Images[item.ImageIndex];
            else if (item.Image != null)
                img = item.Image;

            int contWidth = this.DropDownWidth;
            if (item.ImagePosition != HorizontalAlignment.Center && img != null)
            {
                contWidth -= img.Width;
                if (contWidth <= 0)
                    contWidth = this.DropDownWidth;
            }

            Font font = this.Font;
            if (item.FontName != "")
            {
                try
                {
                    font = new Font(item.FontName, item.FontSize, item.FontStyle);
                }
                catch
                {
                    font = this.Font;
                }
            }

            eTextFormat format = eTextFormat.Default;
            if (item.TextFormat.Alignment == StringAlignment.Center)
                format = eTextFormat.HorizontalCenter;
            else if (item.TextFormat.Alignment == StringAlignment.Far)
                format = eTextFormat.Right;
            if (item.TextLineAlignment == StringAlignment.Center)
                format |= eTextFormat.VerticalCenter;
            else if (item.TextLineAlignment == StringAlignment.Far)
                format |= eTextFormat.Bottom;

            textSize = TextDrawing.MeasureString(g, item.Text, font, this.DropDownWidth, format);
            textSize.Width += 2;
            sz.Width = textSize.Width;
            sz.Height = textSize.Height;
            if (sz.Width < this.DropDownWidth)
                sz.Width = this.DropDownWidth;

            if (item.ImagePosition == HorizontalAlignment.Center && img != null)
                sz.Height += img.Height;
            else if (img != null && img.Height > sz.Height)
                sz.Height = img.Height;

            return sz;
        }
Exemplo n.º 10
0
		protected ComboItem  CreateComboItem(ChoiceBase choice, UIItemDisplayProperties display)
		{

			string label = display.Text;
			if (label ==null)
				label = AdapterStrings.ErrorGeneratingLabel;

			if(!display.Visible)
				return null;

			label = label.Replace("_", "&");
			DevComponents.Editors.ComboItem item = new DevComponents.Editors.ComboItem();
			item.Text=label;

			Debug.Assert(item != null);
			item.Tag = choice;
			choice.ReferenceWidget = item;
			return item;
		}
        private void InitCourse()
        {
            if (!this.form_loaded)
                return;

            this.cboCourse.Items.Clear();

            int school_year = int.Parse(this.nudSchoolYear.Value + "");
            int semester = int.Parse((this.cboSemester.SelectedItem as CourseSelection.DataItems.SemesterItem).Value);
            List<K12.Data.CourseRecord> SelectedCourses = K12.Data.Course.SelectBySchoolYearAndSemester(school_year, semester);

            if (SelectedCourses.Count == 0)
                return;

            ComboItem comboItem1 = new ComboItem("");
            comboItem1.Tag = null;
            this.cboCourse.Items.Add(comboItem1);

            //  所有課程
            foreach (K12.Data.CourseRecord course in SelectedCourses)
            {
                ComboItem item = new ComboItem(course.Name);
                item.Tag = course.ID;
                this.cboCourse.Items.Add(item);
            }

            this.cboCourse.SelectedItem = comboItem1;
        }
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
     this.styleManager = new DevComponents.DotNetBar.StyleManager(this.components);
     this.comboItem31 = new DevComponents.Editors.ComboItem();
     this.comboItem14 = new DevComponents.Editors.ComboItem();
     this.comboItem15 = new DevComponents.Editors.ComboItem();
     this.comboItem16 = new DevComponents.Editors.ComboItem();
     this.comboItem17 = new DevComponents.Editors.ComboItem();
     this.comboItem18 = new DevComponents.Editors.ComboItem();
     this.comboItem19 = new DevComponents.Editors.ComboItem();
     this.comboItem20 = new DevComponents.Editors.ComboItem();
     this.comboItem21 = new DevComponents.Editors.ComboItem();
     this.comboItem22 = new DevComponents.Editors.ComboItem();
     this.comboItem23 = new DevComponents.Editors.ComboItem();
     this.comboItem24 = new DevComponents.Editors.ComboItem();
     this.comboItem25 = new DevComponents.Editors.ComboItem();
     this.comboItem26 = new DevComponents.Editors.ComboItem();
     this.comboItem27 = new DevComponents.Editors.ComboItem();
     this.comboItem28 = new DevComponents.Editors.ComboItem();
     this.comboItem29 = new DevComponents.Editors.ComboItem();
     this.comboItem30 = new DevComponents.Editors.ComboItem();
     this.comboItem32 = new DevComponents.Editors.ComboItem();
     this.comboItem33 = new DevComponents.Editors.ComboItem();
     this.comboItem34 = new DevComponents.Editors.ComboItem();
     this.comboItem35 = new DevComponents.Editors.ComboItem();
     this.comboItem36 = new DevComponents.Editors.ComboItem();
     this.comboItem37 = new DevComponents.Editors.ComboItem();
     this.comboItem38 = new DevComponents.Editors.ComboItem();
     this.comboItem39 = new DevComponents.Editors.ComboItem();
     this.comboItem40 = new DevComponents.Editors.ComboItem();
     this.comboItem41 = new DevComponents.Editors.ComboItem();
     this.comboItem42 = new DevComponents.Editors.ComboItem();
     this.comboItem43 = new DevComponents.Editors.ComboItem();
     this.comboItem44 = new DevComponents.Editors.ComboItem();
     this.comboItem45 = new DevComponents.Editors.ComboItem();
     this.comboItem46 = new DevComponents.Editors.ComboItem();
     this.comboItem47 = new DevComponents.Editors.ComboItem();
     this.comboItem48 = new DevComponents.Editors.ComboItem();
     this.comboItem49 = new DevComponents.Editors.ComboItem();
     this.comboItem50 = new DevComponents.Editors.ComboItem();
     this.comboItem51 = new DevComponents.Editors.ComboItem();
     this.comboItem52 = new DevComponents.Editors.ComboItem();
     this.comboItem53 = new DevComponents.Editors.ComboItem();
     this.comboItem54 = new DevComponents.Editors.ComboItem();
     this.comboItem55 = new DevComponents.Editors.ComboItem();
     this.comboItem1 = new DevComponents.Editors.ComboItem();
     this.comboItem2 = new DevComponents.Editors.ComboItem();
     this.comboItem3 = new DevComponents.Editors.ComboItem();
     this.comboItem4 = new DevComponents.Editors.ComboItem();
     this.comboItem5 = new DevComponents.Editors.ComboItem();
     this.comboItem6 = new DevComponents.Editors.ComboItem();
     this.comboItem7 = new DevComponents.Editors.ComboItem();
     this.comboItem8 = new DevComponents.Editors.ComboItem();
     this.comboItem9 = new DevComponents.Editors.ComboItem();
     this.comboItem10 = new DevComponents.Editors.ComboItem();
     this.comboItem11 = new DevComponents.Editors.ComboItem();
     this.comboItem12 = new DevComponents.Editors.ComboItem();
     this.comboItem13 = new DevComponents.Editors.ComboItem();
     this.metroShell1 = new DevComponents.DotNetBar.Metro.MetroShell();
     this.metroShell2 = new DevComponents.DotNetBar.Metro.MetroShell();
     this.metroTabPanel1 = new DevComponents.DotNetBar.Metro.MetroTabPanel();
     this.lnbHelp = new System.Windows.Forms.LinkLabel();
     this.labelX1 = new DevComponents.DotNetBar.LabelX();
     this.lbCredibility = new DevComponents.DotNetBar.LabelX();
     this.lbName = new DevComponents.DotNetBar.LabelX();
     this.btnRegister = new DevComponents.DotNetBar.ButtonX();
     this.btnLogin = new DevComponents.DotNetBar.ButtonX();
     this.tbPasswd = new DevComponents.DotNetBar.Controls.TextBoxX();
     this.tbUser = new DevComponents.DotNetBar.Controls.TextBoxX();
     this.lbPassword = new DevComponents.DotNetBar.LabelX();
     this.lbuser = new DevComponents.DotNetBar.LabelX();
     this.metroTabItem1 = new DevComponents.DotNetBar.Metro.MetroTabItem();
     this.metroStatusBar1 = new DevComponents.DotNetBar.Metro.MetroStatusBar();
     this.labelItem1 = new DevComponents.DotNetBar.LabelItem();
     this.lbItemTime = new DevComponents.DotNetBar.LabelItem();
     this.lbItemSpanTime = new DevComponents.DotNetBar.LabelItem();
     this.btnItemDonate = new DevComponents.DotNetBar.ButtonItem();
     this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
     this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.mstripShow = new System.Windows.Forms.ToolStripMenuItem();
     this.mstripExit = new System.Windows.Forms.ToolStripMenuItem();
     this.registerControl = new WindowsForm.RegisterControl();
     this.metroShell2.SuspendLayout();
     this.metroTabPanel1.SuspendLayout();
     this.contextMenuStrip1.SuspendLayout();
     this.SuspendLayout();
     //
     // styleManager
     //
     this.styleManager.ManagerColorTint = System.Drawing.Color.White;
     this.styleManager.ManagerStyle = DevComponents.DotNetBar.eStyle.OfficeMobile2014;
     this.styleManager.MetroColorParameters = new DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters(System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(254)))), ((int)(((byte)(254))))), System.Drawing.Color.FromArgb(((int)(((byte)(62)))), ((int)(((byte)(120)))), ((int)(((byte)(143))))));
     //
     // comboItem31
     //
     this.comboItem31.Text = "Default";
     //
     // comboItem14
     //
     this.comboItem14.Text = "VisualStudio2012Light";
     //
     // comboItem15
     //
     this.comboItem15.Text = "VisualStudio2012Dark";
     //
     // comboItem16
     //
     this.comboItem16.Text = "WashedWhite";
     //
     // comboItem17
     //
     this.comboItem17.Text = "WashedBlue";
     //
     // comboItem18
     //
     this.comboItem18.Text = "BlackClouds";
     //
     // comboItem19
     //
     this.comboItem19.Text = "BlackLilac";
     //
     // comboItem20
     //
     this.comboItem20.Text = "BlackMaroon";
     //
     // comboItem21
     //
     this.comboItem21.Text = "BlackSky";
     //
     // comboItem22
     //
     this.comboItem22.Text = "Blue";
     //
     // comboItem23
     //
     this.comboItem23.Text = "BlueishBrown";
     //
     // comboItem24
     //
     this.comboItem24.Text = "Bordeaux";
     //
     // comboItem25
     //
     this.comboItem25.Text = "Brown";
     //
     // comboItem26
     //
     this.comboItem26.Text = "Cherry";
     //
     // comboItem27
     //
     this.comboItem27.Text = "DarkBlue";
     //
     // comboItem28
     //
     this.comboItem28.Text = "DarkBrown";
     //
     // comboItem29
     //
     this.comboItem29.Text = "DarkPurple";
     //
     // comboItem30
     //
     this.comboItem30.Text = "DarkRed";
     //
     // comboItem32
     //
     this.comboItem32.Text = "EarlyMaroon";
     //
     // comboItem33
     //
     this.comboItem33.Text = "EarlyOrange";
     //
     // comboItem34
     //
     this.comboItem34.Text = "EarlyRed";
     //
     // comboItem35
     //
     this.comboItem35.Text = "Espresso";
     //
     // comboItem36
     //
     this.comboItem36.Text = "ForestGreen";
     //
     // comboItem37
     //
     this.comboItem37.Text = "GrayOrange";
     //
     // comboItem38
     //
     this.comboItem38.Text = "Green";
     //
     // comboItem39
     //
     this.comboItem39.Text = "Latte";
     //
     // comboItem40
     //
     this.comboItem40.Text = "LatteDarkSteel";
     //
     // comboItem41
     //
     this.comboItem41.Text = "LatteRed";
     //
     // comboItem42
     //
     this.comboItem42.Text = "Magenta";
     //
     // comboItem43
     //
     this.comboItem43.Text = "MaroonSilver";
     //
     // comboItem44
     //
     this.comboItem44.Text = "NapaRed";
     //
     // comboItem45
     //
     this.comboItem45.Text = "Orange";
     //
     // comboItem46
     //
     this.comboItem46.Text = "PowderRed";
     //
     // comboItem47
     //
     this.comboItem47.Text = "Purple";
     //
     // comboItem48
     //
     this.comboItem48.Text = "Red";
     //
     // comboItem49
     //
     this.comboItem49.Text = "RedAmplified";
     //
     // comboItem50
     //
     this.comboItem50.Text = "RetroBlue";
     //
     // comboItem51
     //
     this.comboItem51.Text = "Rust";
     //
     // comboItem52
     //
     this.comboItem52.Text = "SilverBlues";
     //
     // comboItem53
     //
     this.comboItem53.Text = "SilverGreen";
     //
     // comboItem54
     //
     this.comboItem54.Text = "SimplyBlue";
     //
     // comboItem55
     //
     this.comboItem55.Text = "SkyGreen";
     //
     // comboItem1
     //
     this.comboItem1.Text = "Office2007Blue";
     //
     // comboItem2
     //
     this.comboItem2.Text = "Office2007Silver";
     //
     // comboItem3
     //
     this.comboItem3.Text = "Office2007Black";
     //
     // comboItem4
     //
     this.comboItem4.Text = "Office2007VistaGlass";
     //
     // comboItem5
     //
     this.comboItem5.Text = "Office2010Silver";
     //
     // comboItem6
     //
     this.comboItem6.Text = "Office2010Blue";
     //
     // comboItem7
     //
     this.comboItem7.Text = "Office2010Black";
     //
     // comboItem8
     //
     this.comboItem8.Text = "Windows7Blue";
     //
     // comboItem9
     //
     this.comboItem9.Text = "VisualStudio2010Blue";
     //
     // comboItem10
     //
     this.comboItem10.Text = "Office2013";
     //
     // comboItem11
     //
     this.comboItem11.Text = "VisualStudio2012Light";
     //
     // comboItem12
     //
     this.comboItem12.Text = "VisualStudio2012Dark";
     //
     // comboItem13
     //
     this.comboItem13.Text = "OfficeMobile2014";
     //
     // metroShell1
     //
     this.metroShell1.BackColor = System.Drawing.Color.White;
     //
     //
     //
     this.metroShell1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.metroShell1.ForeColor = System.Drawing.Color.Black;
     this.metroShell1.HelpButtonText = null;
     this.metroShell1.Location = new System.Drawing.Point(0, 0);
     this.metroShell1.Name = "metroShell1";
     this.metroShell1.Size = new System.Drawing.Size(200, 100);
     this.metroShell1.SystemText.MaximizeRibbonText = "&Maximize the Ribbon";
     this.metroShell1.SystemText.MinimizeRibbonText = "Mi&nimize the Ribbon";
     this.metroShell1.SystemText.QatAddItemText = "&Add to Quick Access Toolbar";
     this.metroShell1.SystemText.QatCustomizeMenuLabel = "<b>Customize Quick Access Toolbar</b>";
     this.metroShell1.SystemText.QatCustomizeText = "&Customize Quick Access Toolbar...";
     this.metroShell1.SystemText.QatDialogAddButton = "&Add >>";
     this.metroShell1.SystemText.QatDialogCancelButton = "Cancel";
     this.metroShell1.SystemText.QatDialogCaption = "Customize Quick Access Toolbar";
     this.metroShell1.SystemText.QatDialogCategoriesLabel = "&Choose commands from:";
     this.metroShell1.SystemText.QatDialogOkButton = "OK";
     this.metroShell1.SystemText.QatDialogPlacementCheckbox = "&Place Quick Access Toolbar below the Ribbon";
     this.metroShell1.SystemText.QatDialogRemoveButton = "&Remove";
     this.metroShell1.SystemText.QatPlaceAboveRibbonText = "&Place Quick Access Toolbar above the Ribbon";
     this.metroShell1.SystemText.QatPlaceBelowRibbonText = "&Place Quick Access Toolbar below the Ribbon";
     this.metroShell1.SystemText.QatRemoveItemText = "&Remove from Quick Access Toolbar";
     this.metroShell1.TabIndex = 0;
     this.metroShell1.TabStripFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     //
     // metroShell2
     //
     this.metroShell2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(254)))), ((int)(((byte)(254)))));
     //
     //
     //
     this.metroShell2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.metroShell2.CaptionVisible = true;
     this.metroShell2.Controls.Add(this.metroTabPanel1);
     this.metroShell2.Dock = System.Windows.Forms.DockStyle.Top;
     this.metroShell2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.metroShell2.ForeColor = System.Drawing.Color.Black;
     this.metroShell2.HelpButtonText = "关于";
     this.metroShell2.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
     this.metroTabItem1});
     this.metroShell2.KeyTipsFont = new System.Drawing.Font("Tahoma", 7F);
     this.metroShell2.Location = new System.Drawing.Point(1, 1);
     this.metroShell2.Margin = new System.Windows.Forms.Padding(2);
     this.metroShell2.MouseWheelTabScrollEnabled = false;
     this.metroShell2.Name = "metroShell2";
     this.metroShell2.SettingsButtonText = "设置";
     this.metroShell2.Size = new System.Drawing.Size(1034, 132);
     this.metroShell2.SystemText.MaximizeRibbonText = "&Maximize the Ribbon";
     this.metroShell2.SystemText.MinimizeRibbonText = "Mi&nimize the Ribbon";
     this.metroShell2.SystemText.QatAddItemText = "&Add to Quick Access Toolbar";
     this.metroShell2.SystemText.QatCustomizeMenuLabel = "<b>Customize Quick Access Toolbar</b>";
     this.metroShell2.SystemText.QatCustomizeText = "&Customize Quick Access Toolbar...";
     this.metroShell2.SystemText.QatDialogAddButton = "&Add >>";
     this.metroShell2.SystemText.QatDialogCancelButton = "Cancel";
     this.metroShell2.SystemText.QatDialogCaption = "Customize Quick Access Toolbar";
     this.metroShell2.SystemText.QatDialogCategoriesLabel = "&Choose commands from:";
     this.metroShell2.SystemText.QatDialogOkButton = "OK";
     this.metroShell2.SystemText.QatDialogPlacementCheckbox = "&Place Quick Access Toolbar below the Ribbon";
     this.metroShell2.SystemText.QatDialogRemoveButton = "&Remove";
     this.metroShell2.SystemText.QatPlaceAboveRibbonText = "&Place Quick Access Toolbar above the Ribbon";
     this.metroShell2.SystemText.QatPlaceBelowRibbonText = "&Place Quick Access Toolbar below the Ribbon";
     this.metroShell2.SystemText.QatRemoveItemText = "&Remove from Quick Access Toolbar";
     this.metroShell2.TabIndex = 0;
     this.metroShell2.TabStripFont = new System.Drawing.Font("Segoe UI", 10.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.metroShell2.Text = "metroShell2";
     this.metroShell2.UseCustomizeDialog = false;
     this.metroShell2.SettingsButtonClick += new System.EventHandler(this.metroShell2_SettingsButtonClick);
     this.metroShell2.HelpButtonClick += new System.EventHandler(this.metroShell2_HelpButtonClick);
     this.metroShell2.SizeChanged += new System.EventHandler(this.metroShell2_SizeChanged);
     //
     // metroTabPanel1
     //
     this.metroTabPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
     this.metroTabPanel1.Controls.Add(this.lnbHelp);
     this.metroTabPanel1.Controls.Add(this.labelX1);
     this.metroTabPanel1.Controls.Add(this.lbCredibility);
     this.metroTabPanel1.Controls.Add(this.lbName);
     this.metroTabPanel1.Controls.Add(this.btnRegister);
     this.metroTabPanel1.Controls.Add(this.btnLogin);
     this.metroTabPanel1.Controls.Add(this.tbPasswd);
     this.metroTabPanel1.Controls.Add(this.tbUser);
     this.metroTabPanel1.Controls.Add(this.lbPassword);
     this.metroTabPanel1.Controls.Add(this.lbuser);
     this.metroTabPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.metroTabPanel1.Location = new System.Drawing.Point(0, 63);
     this.metroTabPanel1.Margin = new System.Windows.Forms.Padding(2);
     this.metroTabPanel1.Name = "metroTabPanel1";
     this.metroTabPanel1.Padding = new System.Windows.Forms.Padding(2, 0, 2, 2);
     this.metroTabPanel1.Size = new System.Drawing.Size(1034, 69);
     //
     //
     //
     this.metroTabPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     //
     //
     //
     this.metroTabPanel1.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     //
     //
     //
     this.metroTabPanel1.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.metroTabPanel1.TabIndex = 1;
     //
     // lnbHelp
     //
     this.lnbHelp.AutoSize = true;
     this.lnbHelp.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(254)))), ((int)(((byte)(254)))));
     this.lnbHelp.ForeColor = System.Drawing.Color.Black;
     this.lnbHelp.Location = new System.Drawing.Point(360, 44);
     this.lnbHelp.Name = "lnbHelp";
     this.lnbHelp.Size = new System.Drawing.Size(119, 14);
     this.lnbHelp.TabIndex = 9;
     this.lnbHelp.TabStop = true;
     this.lnbHelp.Text = "信誉度等常见问题";
     this.lnbHelp.Click += new System.EventHandler(this.lnbHelp_Click);
     //
     // labelX1
     //
     this.labelX1.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.labelX1.ForeColor = System.Drawing.Color.Black;
     this.labelX1.Location = new System.Drawing.Point(360, 13);
     this.labelX1.Name = "labelX1";
     this.labelX1.Size = new System.Drawing.Size(583, 23);
     this.labelX1.TabIndex = 8;
     this.labelX1.Text = "声明:本软件使用过程中不记录用户名和密码,同时也不以任何形式保存用户名和密码。";
     //
     // lbCredibility
     //
     this.lbCredibility.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.lbCredibility.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.lbCredibility.ForeColor = System.Drawing.Color.Black;
     this.lbCredibility.Location = new System.Drawing.Point(132, 39);
     this.lbCredibility.Name = "lbCredibility";
     this.lbCredibility.Size = new System.Drawing.Size(111, 23);
     this.lbCredibility.TabIndex = 7;
     this.lbCredibility.Visible = false;
     //
     // lbName
     //
     this.lbName.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.lbName.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.lbName.ForeColor = System.Drawing.Color.Black;
     this.lbName.Location = new System.Drawing.Point(132, 11);
     this.lbName.Name = "lbName";
     this.lbName.Size = new System.Drawing.Size(111, 23);
     this.lbName.TabIndex = 6;
     this.lbName.Visible = false;
     //
     // btnRegister
     //
     this.btnRegister.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
     this.btnRegister.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
     this.btnRegister.Location = new System.Drawing.Point(254, 41);
     this.btnRegister.Name = "btnRegister";
     this.btnRegister.Size = new System.Drawing.Size(75, 23);
     this.btnRegister.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
     this.btnRegister.TabIndex = 5;
     this.btnRegister.Text = "免费注册";
     this.btnRegister.Click += new System.EventHandler(this.btnRegister_Click);
     //
     // btnLogin
     //
     this.btnLogin.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
     this.btnLogin.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
     this.btnLogin.Location = new System.Drawing.Point(254, 10);
     this.btnLogin.Name = "btnLogin";
     this.btnLogin.Size = new System.Drawing.Size(75, 23);
     this.btnLogin.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
     this.btnLogin.TabIndex = 4;
     this.btnLogin.Text = "登陆";
     this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
     //
     // tbPasswd
     //
     this.tbPasswd.BackColor = System.Drawing.Color.White;
     //
     //
     //
     this.tbPasswd.Border.Class = "TextBoxBorder";
     this.tbPasswd.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.tbPasswd.DisabledBackColor = System.Drawing.Color.White;
     this.tbPasswd.ForeColor = System.Drawing.Color.Black;
     this.tbPasswd.Location = new System.Drawing.Point(86, 40);
     this.tbPasswd.Name = "tbPasswd";
     this.tbPasswd.PasswordChar = '*';
     this.tbPasswd.PreventEnterBeep = true;
     this.tbPasswd.Size = new System.Drawing.Size(151, 23);
     this.tbPasswd.TabIndex = 3;
     //
     // tbUser
     //
     this.tbUser.BackColor = System.Drawing.Color.White;
     //
     //
     //
     this.tbUser.Border.Class = "TextBoxBorder";
     this.tbUser.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.tbUser.DisabledBackColor = System.Drawing.Color.White;
     this.tbUser.ForeColor = System.Drawing.Color.Black;
     this.tbUser.Location = new System.Drawing.Point(86, 10);
     this.tbUser.Name = "tbUser";
     this.tbUser.PreventEnterBeep = true;
     this.tbUser.Size = new System.Drawing.Size(151, 23);
     this.tbUser.TabIndex = 2;
     this.tbUser.WatermarkText = "请输入身份证";
     //
     // lbPassword
     //
     this.lbPassword.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.lbPassword.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.lbPassword.ForeColor = System.Drawing.Color.Black;
     this.lbPassword.Location = new System.Drawing.Point(21, 40);
     this.lbPassword.Name = "lbPassword";
     this.lbPassword.Size = new System.Drawing.Size(59, 23);
     this.lbPassword.TabIndex = 1;
     this.lbPassword.Text = "密 码";
     //
     // lbuser
     //
     this.lbuser.BackColor = System.Drawing.Color.Transparent;
     //
     //
     //
     this.lbuser.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.lbuser.ForeColor = System.Drawing.Color.Black;
     this.lbuser.Location = new System.Drawing.Point(21, 10);
     this.lbuser.Name = "lbuser";
     this.lbuser.Size = new System.Drawing.Size(59, 23);
     this.lbuser.TabIndex = 0;
     this.lbuser.Text = "账户名";
     //
     // metroTabItem1
     //
     this.metroTabItem1.Checked = true;
     this.metroTabItem1.Name = "metroTabItem1";
     this.metroTabItem1.Panel = this.metroTabPanel1;
     this.metroTabItem1.Text = "个人中心";
     //
     // metroStatusBar1
     //
     this.metroStatusBar1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(254)))), ((int)(((byte)(254)))));
     //
     //
     //
     this.metroStatusBar1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
     this.metroStatusBar1.ContainerControlProcessDialogKey = true;
     this.metroStatusBar1.Dock = System.Windows.Forms.DockStyle.Bottom;
     this.metroStatusBar1.DragDropSupport = true;
     this.metroStatusBar1.Font = new System.Drawing.Font("Segoe UI", 10.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.metroStatusBar1.ForeColor = System.Drawing.Color.Black;
     this.metroStatusBar1.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
     this.labelItem1,
     this.lbItemTime,
     this.lbItemSpanTime,
     this.btnItemDonate});
     this.metroStatusBar1.Location = new System.Drawing.Point(1, 642);
     this.metroStatusBar1.Margin = new System.Windows.Forms.Padding(2);
     this.metroStatusBar1.Name = "metroStatusBar1";
     this.metroStatusBar1.Size = new System.Drawing.Size(1034, 32);
     this.metroStatusBar1.TabIndex = 1;
     this.metroStatusBar1.Text = "metroStatusBar1";
     //
     // labelItem1
     //
     this.labelItem1.Name = "labelItem1";
     this.labelItem1.Text = "北京时间:";
     //
     // lbItemTime
     //
     this.lbItemTime.Cursor = System.Windows.Forms.Cursors.Hand;
     this.lbItemTime.Name = "lbItemTime";
     this.lbItemTime.Text = "网络连接失败";
     this.lbItemTime.Click += new System.EventHandler(this.lbItemTime_Click);
     //
     // lbItemSpanTime
     //
     this.lbItemSpanTime.Name = "lbItemSpanTime";
     //
     // btnItemDonate
     //
     this.btnItemDonate.ItemAlignment = DevComponents.DotNetBar.eItemAlignment.Far;
     this.btnItemDonate.Name = "btnItemDonate";
     this.btnItemDonate.Text = "捐助软件";
     this.btnItemDonate.Click += new System.EventHandler(this.btnItemDonate_Click);
     //
     // notifyIcon1
     //
     this.notifyIcon1.ContextMenuStrip = this.contextMenuStrip1;
     this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
     this.notifyIcon1.Text = "杭州预约挂号辅助软件";
     this.notifyIcon1.Visible = true;
     this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
     //
     // contextMenuStrip1
     //
     this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.mstripShow,
     this.mstripExit});
     this.contextMenuStrip1.Name = "contextMenuStrip1";
     this.contextMenuStrip1.Size = new System.Drawing.Size(137, 48);
     //
     // mstripShow
     //
     this.mstripShow.Name = "mstripShow";
     this.mstripShow.Size = new System.Drawing.Size(136, 22);
     this.mstripShow.Text = "打开主程序";
     this.mstripShow.Click += new System.EventHandler(this.mstripShow_Click);
     //
     // mstripExit
     //
     this.mstripExit.Name = "mstripExit";
     this.mstripExit.Size = new System.Drawing.Size(136, 22);
     this.mstripExit.Text = "退出";
     this.mstripExit.Click += new System.EventHandler(this.mstripExit_Click);
     //
     // registerControl
     //
     this.registerControl.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(254)))), ((int)(((byte)(254)))));
     this.registerControl.Dock = System.Windows.Forms.DockStyle.Fill;
     this.registerControl.ForeColor = System.Drawing.Color.Black;
     this.registerControl.Location = new System.Drawing.Point(1, 133);
     this.registerControl.Name = "registerControl";
     this.registerControl.Size = new System.Drawing.Size(1034, 509);
     this.registerControl.TabIndex = 2;
     //
     // MainForm
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(1036, 675);
     this.Controls.Add(this.registerControl);
     this.Controls.Add(this.metroStatusBar1);
     this.Controls.Add(this.metroShell2);
     this.DoubleBuffered = true;
     this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Margin = new System.Windows.Forms.Padding(2);
     this.Name = "MainForm";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.SystemMenuClose = "关闭";
     this.SystemMenuMaximize = "最大化";
     this.SystemMenuMinimize = "最小化";
     this.SystemMenuMove = "移动";
     this.SystemMenuRestore = "还原";
     this.SystemMenuSize = "大小";
     this.Text = "杭州预约挂号辅助软件";
     this.metroShell2.ResumeLayout(false);
     this.metroShell2.PerformLayout();
     this.metroTabPanel1.ResumeLayout(false);
     this.metroTabPanel1.PerformLayout();
     this.contextMenuStrip1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
        private void InitSurvey()
        {
            List<UDT.Survey> Surveys = Access.Select<UDT.Survey>();

            ComboItem comboItem1 = new ComboItem("");
            comboItem1.Tag = null;

            this.cboSurvey.Items.Add(comboItem1);
            foreach (UDT.Survey var in Surveys)
            {
                ComboItem item = new ComboItem(var.Name);
                item.Tag = var;
                cboSurvey.Items.Add(item);
            }

            cboSurvey.SelectedItem = comboItem1;
        }
        private void BindDepartmentGroup()
        {
            List<DepartmentGroup> departmentGroups = Access.Select<DepartmentGroup>();

            ComboItem comboItem1 = new ComboItem("");
            comboItem1.Tag = null;

            this.cboDepartmentGroup.Items.Add(comboItem1);
            foreach (DepartmentGroup var in departmentGroups)
            {
                string departmentGroup = var.Name;
                ComboItem item = new ComboItem(departmentGroup);
                item.Tag = var;
                cboDepartmentGroup.Items.Add(item);
            }
            cboDepartmentGroup.SelectedItem = comboItem1;
        }
        private void InitCourse(IEnumerable<CourseRecord> SelectedCourses)
        {
            this.cboCourse.Items.Clear();

            //if (SelectedCourses.Count() == 0)
            //    return;

            ComboItem comboItem1 = new ComboItem("全部");
            comboItem1.Tag = string.Empty;
            this.cboCourse.Items.Add(comboItem1);

            //  所有課程
            foreach (K12.Data.CourseRecord course in SelectedCourses)
            {
                ComboItem item = new ComboItem(course.Name);
                item.Tag = course.ID;
                this.cboCourse.Items.Add(item);
            }

            this.cboCourse.SelectedItem = comboItem1;
        }
Exemplo n.º 16
0
 protected virtual Size GetComboItemSize(ComboItem item)
 {
     Size size = Size.Empty;
     if (BarFunctions.IsHandleValid(this))
     {
         Graphics g = this.CreateGraphics();
         try
         {
             size = GetComboItemSize(item, g);
         }
         finally
         {
             g.Dispose();
         }
     }
     return size;
 }
 private void cmbArea_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     this.cmbHospital.Items.Clear();
     ComboItem comboItem = new ComboItem();
     comboItem.Text = "请选择";
     comboItem.Value = "-1";
     this.cmbHospital.Items.Add(comboItem);
     ComboItem comboItem2 = (ComboItem)this.cmbArea.SelectedItem;
     if (comboItem2.Text == "省直")
     {
         this.m_spanRegTime = new System.TimeSpan(15, 0, 0);
         this.m_bIsProvinceHos = true;
     }
     else
     {
         this.m_spanRegTime = new System.TimeSpan(14, 0, 0);
         this.m_bIsProvinceHos = false;
     }
     if (comboItem2.Value.ToString() != "-1")
     {
         IntergetedHospital hispital = this.m_regHelper.GetHispital(comboItem2.Value.ToString());
         if (hispital != null && hispital.result == "success")
         {
             foreach (HospitalInfo current in hispital.data.hos)
             {
                 ComboItem comboItem3 = new ComboItem();
                 comboItem3.Text = current.aliasName;
                 comboItem3.Value = current.hosCode;
                 this.cmbHospital.Items.Add(comboItem3);
             }
         }
     }
     this.cmbHospital.SelectedIndex = 0;
 }
Exemplo n.º 18
0
        /// <summary>
        /// Loads all fonts available on system into the combo box.
        /// </summary>
        public void LoadFonts()
        {
            this.Items.Clear();

            System.Drawing.Text.InstalledFontCollection colInstalledFonts = new System.Drawing.Text.InstalledFontCollection();
            FontFamily[] aFamilies = colInstalledFonts.Families;
            foreach (FontFamily ff in aFamilies)
            {
                ComboItem item = new ComboItem();
                item.IsFontItem = true;
                item.FontName = ff.GetName(0);
                item.FontSize = this.Font.Size;
                item.Text = ff.GetName(0);
                this.Items.Add(item);
            }
            this.DropDownWidth = this.Width * 2;
        }
 private void cmbHospital_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     this.cmbDepartment.Items.Clear();
     ComboItem comboItem = new ComboItem();
     comboItem.Text = "请选择";
     comboItem.Value = "-1";
     this.cmbDepartment.Items.Add(comboItem);
     ComboItem comboItem2 = (ComboItem)this.cmbHospital.SelectedItem;
     if (comboItem2.Value.ToString() != "-1")
     {
         IntergretedDepartment department = this.m_regHelper.GetDepartment(comboItem2.Value.ToString());
         if (department != null && department.result == "success")
         {
             foreach (DeptInfo current in department.data.dept)
             {
                 ComboItem comboItem3 = new ComboItem();
                 comboItem3.Text = current.deptName;
                 this.cmbDepartment.Items.Add(comboItem3);
             }
         }
     }
     this.cmbDepartment.SelectedIndex = 0;
 }
        private void InitItem()
        {
            ComboItem comboItem1 = new ComboItem("");
            comboItem1.Tag = null;
            this.cboItem.Items.Add(comboItem1);

            ComboItem comboItem2 = new ComboItem("第一階段");
            comboItem2.Tag = 1;
            this.cboItem.Items.Add(comboItem2);

            ComboItem comboItem3 = new ComboItem("第二階段");
            comboItem3.Tag = 2;
            this.cboItem.Items.Add(comboItem3);
        }
Exemplo n.º 21
0
        private void InitSemesterCourses()
        {
            circularProgress.Visible = true;
            circularProgress.IsRunning = true;
            this.nudSchoolYear.Enabled = false;
            this.cboSemester.Enabled = false;
            this.cboCourse.Enabled = false;
            decimal school_year = this.nudSchoolYear.Value;
            string semester = this.cboSemester.SelectedValue.ToString();
            Task<DataTable> task = Task<DataTable>.Factory.StartNew(() =>
            {
                string strSQL = "select c.id, c.course_name, ce.subject_code from course c left outer join $ischool.emba.course_ext ce on c.id = ce.ref_course_id where c.school_year={0} and c.semester = {1} order by ce.serial_no;";
                strSQL = string.Format(strSQL, school_year, semester);
                DataTable dt = this.Query.Select(strSQL);

                return dt;
            });
            task.ContinueWith((x) =>
            {
                this.circularProgress.Visible = false;
                this.circularProgress.IsRunning = false;
                this.nudSchoolYear.Enabled = true;
                this.cboSemester.Enabled = true;
                this.cboCourse.Enabled = true;
                form_loaded = true;
                if (x.Exception != null)
                {
                    MessageBox.Show(x.Exception.InnerException.Message);
                    return;
                }
                this.cboCourse.Items.Clear();
                this.dicCourses.Clear();
                foreach (DataRow dr in x.Result.Rows)
                {
                    string key = (dr["subject_code"] == null ? "" : dr["subject_code"].ToString()) + "  " + dr["course_name"].ToString();
                    ComboItem item = new ComboItem(key);
                    item.Tag = new { CourseName = dr["course_name"] + "", SchoolYear = school_year, Semester = semester, CourseID = dr["id"] + "" };
                    this.cboCourse.Items.Add(item);

                    this.dicCourses.Add(key, dr["id"].ToString());
                }
                if (this.cboCourse.Items.Count > 0)
                    this.cboCourse.SelectedIndex = 0;
                else
                    this.dg.Rows.Clear();

            }, System.Threading.CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
        }