示例#1
0
        //模糊查询
        private void Click_QueryOnly(object sender, EventArgs e)
        {
            FrmInputs inputs = new FrmInputs("模糊查询", new string[] { "班级编号", "班级名称", "学院编号" }, new Dictionary <string, HZH_Controls.TextInputType>()
            {
                { "班级编号", HZH_Controls.TextInputType.Regex }, { "班级名称", HZH_Controls.TextInputType.Regex }, { "学院编号", HZH_Controls.TextInputType.Regex }
            }, new Dictionary <string, string>()
            {
                { "班级编号", @"^\d+$" }, { "班级名称", @"^[\u4E00-\u9FFF0-9]+$" }, { "学员编号", @"^\d+$" }
            });

            inputs.ShowDialog();
            var        values = inputs.Values;
            T_ClassDAL dal    = new T_ClassDAL();
            string     t_sql  = "FulzySearchInT_Class";

            SqlParameter[] pars = new SqlParameter[] {
                new SqlParameter("@classID", SqlDbType.VarChar)
                {
                    Value = "%" + values[0] + "%"
                },
                new SqlParameter("@className", SqlDbType.VarChar)
                {
                    Value = "%" + values[1] + "%"
                },
                new SqlParameter("@collegeID", SqlDbType.VarChar)
                {
                    Value = "%" + values[2] + "%"
                }
            };
            dataGridView1.DataSource = dal.FulzySearch(t_sql, CommandType.StoredProcedure, pars);
        }
示例#2
0
        //模糊查询
        private void Click_QueryOnly(object sender, EventArgs e)
        {
            //打开多输入窗口
            FrmInputs input = new FrmInputs("模糊查询", new string[] { "学号", "姓名", "班级编号" });

            input.ShowDialog();
            //获取输入值
            var values = input.Values;
            //进行模糊查询配置
            string t_sql = "select StuID, StuName, StuBirthday, StuSex, ClassID from T_StudentBasicInformation where StuID like @stuID and StuName like @name and ClassID like @classID";

            SqlParameter[] pars = new SqlParameter[] {
                new SqlParameter("@stuID", SqlDbType.VarChar)
                {
                    Value = "%" + values[0] + "%"
                },
                new SqlParameter("@name", SqlDbType.VarChar)
                {
                    Value = "%" + values[1] + "%"
                },
                new SqlParameter("@classID", SqlDbType.VarChar)
                {
                    Value = "%" + values[2] + "%"
                }
            };
            T_StudentDal dal = new T_StudentDal();
            var          res = dal.FuzzyQuery(t_sql, CommandType.Text, pars);

            dataGridView1.DataSource = res;
            ResetCurIndexAndClassID(1, classID);
        }
示例#3
0
        //插入数据
        private void Click_OpenInsertDataInforamtion(object sender, EventArgs e)
        {
            FrmInputs inputs = new FrmInputs("插入班级信息", new string[] { "班级名称", "学院编号" }, new Dictionary <string, HZH_Controls.TextInputType>()
            {
                { "班级名称", HZH_Controls.TextInputType.Regex }, { "学院编号", HZH_Controls.TextInputType.Regex }
            }, new Dictionary <string, string>()
            {
                { "班级名称", @"^[\u4E00-\u9FFF0-9]+$" }, { "学员编号", @"^\d+$" }
            });

            inputs.ShowDialog();
            var values = inputs.Values;

            foreach (var item in values)
            {
                if (item == null || item == string.Empty)
                {
                    return;
                }
            }
            string t_sql = "InsertintoT_Class";

            SqlParameter[] pars = new SqlParameter[] {
                new SqlParameter("@className", SqlDbType.VarChar, 20)
                {
                    Value = values[0]
                },
                new SqlParameter("@collegeID", SqlDbType.Int)
                {
                    Value = values[1]
                },
            };
            T_ClassDAL dal   = new T_ClassDAL();
            int        temp1 = curIndex;
            int        temp2 = collegeID;

            try
            {
                var res = (int)dal.ExecuteScalar(t_sql, CommandType.StoredProcedure, pars);
                if (res == 1)
                {
                    curIndex = 1;
                    dataGridView1.DataSource = dal.LoadPagiation(curIndex, dataLength, collegeID);
                    FrmDialog.ShowDialog(this, "保存成功");
                }
                else
                {
                    throw new Exception();
                }
            }
            catch
            {
                curIndex  = temp1;
                collegeID = temp2;
                FrmDialog.ShowDialog(this, "保存失败,请检查输入是否正确");
            }
        }
示例#4
0
        private void ucBtnChangePwd_BtnClick(object sender, EventArgs e)
        {
            FrmInputs frm = new FrmInputs("修改密码",
                                          new string[] { "旧密码", "新密码", "确定密码" },
                                          new Dictionary <string, HZH_Controls.TextInputType>()
            {
            },
                                          new Dictionary <string, string>()
            {
            },
                                          new Dictionary <string, KeyBoardType>()
            {
                { "旧密码", KeyBoardType.UCKeyBorderAll_EN }, { "新密码", KeyBoardType.UCKeyBorderAll_EN }
            },
                                          new List <string>()
            {
                "旧密码", "新密码", "确定密码"
            });

            frm.ShowDialog(this);
            if (frm.DialogResult == DialogResult.OK)
            {
                string oldPwd = frm.Values[0];
                string newPwd = frm.Values[1];
                string comPwd = frm.Values[2];
                if (newPwd != comPwd)
                {
                    MessageBox.Show("两次密码不一致");
                    return;
                }

                //if (!Check.isPwd(newPwd))
                // {
                //     MessageBox.Show("密码最少6位,包括至少1个大写字母,1个小写字母,1个数字,1个特殊字符");
                //     return;
                // }

                if (MD5Encode.GetMd5(oldPwd) == teacher.PassWord)
                {
                    TeacherBLL bll = new TeacherBLL();
                    string     msg = bll.EditPwd(MD5Encode.GetMd5(newPwd), teacher.TID)?"修改成功":"修改失败";
                    MessageBox.Show(msg);
                }
                else
                {
                    MessageBox.Show("原密码错误");
                }
            }
        }
 /// <summary>
 /// 模糊查询
 /// </summary>
 private void FuzzyQuery(object sender, EventArgs e)
 {
     using (FrmInputs inputs = new FrmInputs("查询教师", new string[] { "教师编号", "教师姓名" }, new Dictionary <string, HZH_Controls.TextInputType>()
     {
         { "教师编号", HZH_Controls.TextInputType.Regex }, { "教师姓名", HZH_Controls.TextInputType.Regex }
     }, new Dictionary <string, string>()
     {
         { "教师编号", @"^\d+$" }, { "教师姓名", @"^[\u4e00-\u9fa5]+$" }
     }))
     {
         inputs.ShowDialog();
         _values = inputs.Values;
         InitialDataGridViewDataSource(0, 1);
     }
 }
 /// <summary>
 /// 教师的学生课程分数
 /// </summary>
 private void TeachersStudentCourseFraction(object sender, EventArgs e)
 {
     using (FrmInputs inputs = new FrmInputs("查询教师教授课程学生成绩", new string[] { "教师编号" }, new Dictionary <string, HZH_Controls.TextInputType>()
     {
         { "教师编号", HZH_Controls.TextInputType.Regex }
     }, new Dictionary <string, string>()
     {
         { "教师编号", @"^\d+$" }
     }))
     {
         inputs.ShowDialog();
         _values = inputs.Values;
         InitialDataGridViewDataSource(1, 1);
     }
 }
        //20201108新增修改会员信息
        private async void tsm_ChangeCardInfo_Click(object sender, EventArgs e)
        {
            if (_currentCard == null)
            {
                return;
            }
            FrmInputs frm = new FrmInputs("修改会员信息",
                                          new string[] { "手机号码", "会员姓名" },
                                          new Dictionary <string, HZH_Controls.TextInputType>()
            {
                { "手机号码", HZH_Controls.TextInputType.NotControl }, { "会员姓名", HZH_Controls.TextInputType.NotControl }
            },
                                          new Dictionary <string, string>()
            {
            },
                                          new Dictionary <string, KeyBoardType>()
            {
            },
                                          new List <string>()
            {
                "礼物名称", "礼物分值"
            },
                                          new Dictionary <string, string>()
            {
                { "手机号码", _currentCard.PhoneNumber }, { "会员姓名", _currentCard.UserName }
            });

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                var phoneNumber = frm.Values[0];
                var userName    = frm.Values[1];
                using (var db = new MemberCardContext())
                {
                    var card = await db.Cards.FirstOrDefaultAsync(item => item.CardId == _currentCard.CardId);

                    if (card == null)
                    {
                        FrmDialog.ShowDialog(this, "未找到该会员卡");
                        return;
                    }
                    card.PhoneNumber = phoneNumber;
                    card.UserName    = userName;
                    await db.SaveChangesAsync();
                }
                await Search();
            }
        }
示例#8
0
        private void OpenCourseFactionDataInformationFulySerach(object sender, EventArgs e)
        {
            //学生成绩模糊查询
            FrmInputs inputs = new FrmInputs("成绩查询", new string[] { "学生编号", "学生姓名", "课程名称", "教师姓名" }, new Dictionary <string, HZH_Controls.TextInputType>()
            {
                { "学生编号", HZH_Controls.TextInputType.Regex }, { "学生姓名", HZH_Controls.TextInputType.Regex }, { "课程名称", HZH_Controls.TextInputType.Regex }, { "教师姓名", HZH_Controls.TextInputType.Regex }
            }, new Dictionary <string, string>()
            {
                { "学生编号", @"^\d+$" }, { "学生姓名", @"^[\u4E00-\u9FFF]+$" }, { "课程名称", @"^.+$" }, { "教师姓名", @"^[\u4E00-\u9FFF]$" }
            });
            var dialogRes = inputs.ShowDialog();

            if (dialogRes == DialogResult.Cancel)
            {
                return;
            }
            values = new string[] { inputs.Values[0], inputs.Values[1], inputs.Values[2], inputs.Values[3] };
            InitialCurIndexToLoades(4);
        }
示例#9
0
        /// <summary>
        /// 表单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnForm_BtnClick(object sender, EventArgs e)
        {
            FrmInputs frm = new FrmInputs("动态多输入窗体测试",
                                          new string[] { "姓名", "电话", "身份证号", "住址" },
                                          new Dictionary <string, HZH_Controls.TextInputType>()
            {
                { "电话", HZH_Controls.TextInputType.Regex }, { "身份证号", HZH_Controls.TextInputType.Regex }
            },
                                          new Dictionary <string, string>()
            {
                { "电话", @"" }, { "身份证号", "" }
            },
                                          new Dictionary <string, KeyBoardType>()
            {
                { "电话", KeyBoardType.UCKeyBorderNum }, { "身份证号", KeyBoardType.UCKeyBorderNum }
            });

            frm.ShowDialog(this);
        }
        private void ucBtnChangePwd_BtnClick(object sender, EventArgs e)
        {
            FrmInputs frm = new FrmInputs("修改密码",
                                          new string[] { "旧密码", "新密码", "确定密码" },
                                          new Dictionary <string, HZH_Controls.TextInputType>()
            {
            },
                                          new Dictionary <string, string>()
            {
            },
                                          new Dictionary <string, KeyBoardType>()
            {
                { "旧密码", KeyBoardType.UCKeyBorderAll_EN }, { "新密码", KeyBoardType.UCKeyBorderAll_EN }
            },
                                          new List <string>()
            {
                "旧密码", "新密码", "确定密码"
            });

            frm.ShowDialog(this);
            if (frm.DialogResult == DialogResult.OK)
            {
                string oldPwd = frm.Values[0];
                string newPwd = frm.Values[1];
                string comPwd = frm.Values[2];
                if (newPwd != comPwd)
                {
                    MessageBox.Show("两次密码不一致");
                    return;
                }
                if (MD5Encode.GetMd5(oldPwd) == student.PassWord)
                {
                    StudentBLL bll = new StudentBLL();
                    string     msg = bll.EditPwd(MD5Encode.GetMd5(newPwd), student.SID) ? "修改成功" : "修改失败";
                    MessageBox.Show(msg);
                }
                else
                {
                    MessageBox.Show("原密码错误");
                }
            }
        }
示例#11
0
 private void OpenCourseDataInformationFulySearch(object sender, EventArgs e)
 {
     //课程信息模糊查询
     using (FrmInputs inputs = new FrmInputs("课程查询", new string[] { "课程名" }, new Dictionary <string, HZH_Controls.TextInputType>()
     {
         { "课程名", HZH_Controls.TextInputType.Regex }
     }, new Dictionary <string, string>()
     {
         { "课程名", @"^.+$" }
     }))
     {
         var dialogRes = inputs.ShowDialog();
         if (dialogRes == DialogResult.Cancel)
         {
             return;
         }
         values = new string[] { inputs.Values[0] };
         InitialCurIndexToLoades(0);
     }
 }
示例#12
0
 private void OpenClassCourseDataInforamtionFulySerach(object sender, EventArgs e)
 {
     //班级开课信息模糊查询
     using (FrmInputs inputs = new FrmInputs("班级开课查询", new string[] { "课程名", "班级名", "教师名" }, new Dictionary <string, HZH_Controls.TextInputType>()
     {
         { "课程名", HZH_Controls.TextInputType.Regex }, { "班级名", HZH_Controls.TextInputType.Regex }, { "教师名", HZH_Controls.TextInputType.Regex }
     }, new Dictionary <string, string>()
     {
         { "课程名", @"^.+$" }, { "班级名", @"^[\u4E00-\u9FFF0-9]+$" }, { "教师名", @"^[\u4E00-\u9FFF0-9]+$" }
     }))
     {
         var dialogRes = inputs.ShowDialog();
         if (dialogRes == DialogResult.Cancel)
         {
             return;
         }
         values = new string[] { inputs.Values[0], inputs.Values[1], inputs.Values[2] };
         InitialCurIndexToLoades(2);
     }
 }
示例#13
0
        private async void btn_Add_BtnClick(object sender, EventArgs e)
        {
            FrmInputs frm = new FrmInputs("添加礼物",
                                          new string[] { "礼物名称", "礼物分值" },
                                          new Dictionary <string, HZH_Controls.TextInputType>()
            {
                { "礼物名称", HZH_Controls.TextInputType.NotControl }, { "礼物分值", HZH_Controls.TextInputType.Integer }
            },
                                          new Dictionary <string, string>()
            {
            },
                                          new Dictionary <string, KeyBoardType>()
            {
            },
                                          new List <string>()
            {
                "礼物名称", "礼物分值"
            });

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                var name   = frm.Values[0];
                var points = frm.Values[1];
                if (int.TryParse(points, out var _giftPoints) == false)
                {
                    FrmDialog.ShowDialog(this, "礼物分值格式错误");
                    return;
                }
                using (var db = new MemberCardContext())
                {
                    var gift = new Gift()
                    {
                        GiftName = name,
                        Points   = _giftPoints
                    };
                    db.Gifts.Add(gift);
                    await db.SaveChangesAsync();
                }
                await RefreshGifts();
            }
        }
示例#14
0
        private void button2_Click(object sender, EventArgs e)
        {
            FrmInputs frm = new FrmInputs("动态多输入窗体测试",
                                          new string[] { "姓名", "电话", "身份证号", "住址" },
                                          new Dictionary <string, HZH_Controls.TextInputType>()
            {
                { "电话", HZH_Controls.TextInputType.Regex }, { "身份证号", HZH_Controls.TextInputType.Regex }
            },
                                          new Dictionary <string, string>()
            {
                { "电话", "^1\\d{0,10}$" }, { "身份证号", "^\\d{0,18}$" }
            },
                                          new Dictionary <string, KeyBoardType>()
            {
                { "电话", KeyBoardType.UCKeyBorderNum }, { "身份证号", KeyBoardType.UCKeyBorderNum }
            },
                                          new List <string>()
            {
                "姓名", "电话", "身份证号"
            });

            frm.ShowDialog(this);
        }
示例#15
0
        private void ucBtnExt5_BtnClick(object sender, EventArgs e)
        {
            FrmInputs frm = new FrmInputs("输入数据库密码",
                                          new string[] { "Cache密码" },
                                          new Dictionary <string, HZH_Controls.TextInputType>()
            {
                { "Cache密码", HZH_Controls.TextInputType.NotControl }
            },
                                          new Dictionary <string, string>()
            {
            },
                                          new Dictionary <string, KeyBoardType>()
            {
                { "Cache密码", KeyBoardType.UCKeyBorderAll_EN }
            },
                                          new List <string>()
            {
                "Cache密码"
            });

            frm.ShowDialog(this);
            if (frm.DialogResult == DialogResult.OK)
            {
                Properties.Settings.Default.FileConnectLIS  = FileConnectLIS.Checked;
                Properties.Settings.Default.FileClassMethod = FileClassMethod.Text;
                Properties.Settings.Default.FileMI          = MachineID.Text;
                Properties.Settings.Default.CacheHost       = HostandPort.Text.Split(':')[0];
                Properties.Settings.Default.CachePort       = HostandPort.Text.Split(':')[1];
                Properties.Settings.Default.CacheNamespace  = Namespace.Text;
                Properties.Settings.Default.CacheUserID     = UserID.Text;
                Properties.Settings.Default.CachePassword   = frm.Values[0];
                Properties.Settings.Default.Save();
                FrmTips.ShowTipsSuccess(this, "设置已保存");
                ucPanelTitle1.IsExpand = false;
            }
        }
示例#16
0
        //插入数据
        private void Click_OpenInsertDataInforamtion(object sender, EventArgs e)
        {
            //进行插入数据的操作
            //打开多输入窗口
            FrmInputs input = new FrmInputs("插入学生数据", new string[] { "学号", "姓名", "出生年月", "性别", "班级编号" }, new Dictionary <string, HZH_Controls.TextInputType>()
            {
                { "学号", HZH_Controls.TextInputType.Regex }, { "性别", HZH_Controls.TextInputType.Regex }, { "班级编号", HZH_Controls.TextInputType.Regex }
            },
                                            new Dictionary <string, string>()
            {
                { "学号", @"^\d+$" }, { "性别", @"^[\u4e00-\u9fa5]{1}$" }, { "班级编号", @"^\d+$" }
            });

            input.ShowDialog();
            var values = input.Values;

            //确保所有数据已输入
            foreach (var item in values)
            {
                if (item == null || item.Trim() == string.Empty)
                {
                    return;
                }
            }
            //必须判断日期输入是否正确
            int sex = values[3] == "男" ? 1 : 0;
            var res = Regex.IsMatch(values[2], @"^(?!0000)[0-9]{4}-((0{0,1}[1-9]|1[0-2])-(0{0,1}[1-9]|1[0-9]|2[0-8])|(0{0,1}[13-9]|1[0-2])-(29|30)|(0{0,1}[13578]|1[02])-31)$");

            if (res == false)
            {
                return;
            }
            //插入数据存储过程
            string t_sql = "InserIntoStudentBasicInformation";

            SqlParameter[] pars = new SqlParameter[] {
                new SqlParameter("@StuID", SqlDbType.Int)
                {
                    Value = values[0]
                },
                new SqlParameter("@StuName", SqlDbType.VarChar, 20)
                {
                    Value = values[1]
                },
                new SqlParameter("@StuBirthday", SqlDbType.Date)
                {
                    Value = values[2]
                },
                new SqlParameter("@StuSex", SqlDbType.BigInt)
                {
                    Value = sex
                },
                new SqlParameter("@ClassID", SqlDbType.Int)
                {
                    Value = values[4]
                }
            };

            T_StudentDal dal = new T_StudentDal();

            //调用 Dal
            try
            {
                int resVal = (int)dal.ExecuteScalar(t_sql, CommandType.StoredProcedure, pars);
                if (resVal == 1)
                {
                    curIndex = 1;
                    classID  = int.Parse(values[4]);
                    dataGridView1.DataSource = dal.LoadStudents(curIndex, dataLength, classID);
                    FrmDialog.ShowDialog(this, "保存成功", "提示");
                }
                else
                {
                    throw new Exception("保存失败");
                }
            }
            catch (Exception ex)
            {
                FrmDialog.ShowDialog(this, "保存失败,请检查您输入的学号、班级编号输入正确", "提示");
            }
        }
示例#17
0
        private void tvMenu_AfterSelect(object sender, TreeViewEventArgs e)
        {
            panControl.Controls.Clear();
            string strName = e.Node.Text.Trim();

            this.Title = "HZHControls控件库DEMO--" + strName;
            switch (strName)
            {
            case "关于授权":
                AddControl(new UCShouQuan());
                break;

                #region 窗体    English:forms
            case "提示窗体":
                if (FrmDialog.ShowDialog(this, "是否再显示一个没有取消按钮的提示框?", "模式窗体测试", true) == System.Windows.Forms.DialogResult.OK)
                {
                    FrmDialog.ShowDialog(this, "这是一个没有取消按钮的提示框", "模式窗体测试");
                }
                break;

            case "多输入窗体":
                FrmInputs frm = new FrmInputs("动态多输入窗体测试",
                                              new string[] { "姓名", "电话", "身份证号", "住址" },
                                              new Dictionary <string, HZH_Controls.TextInputType>()
                {
                    { "电话", HZH_Controls.TextInputType.Regex }, { "身份证号", HZH_Controls.TextInputType.Regex }
                },
                                              new Dictionary <string, string>()
                {
                    { "电话", "^1\\d{0,10}$" }, { "身份证号", "^\\d{0,18}$" }
                },
                                              new Dictionary <string, KeyBoardType>()
                {
                    { "电话", KeyBoardType.UCKeyBorderNum }, { "身份证号", KeyBoardType.UCKeyBorderNum }
                },
                                              new List <string>()
                {
                    "姓名", "电话", "身份证号"
                });
                frm.ShowDialog(this);
                break;

            case "气泡提示窗体":
                FrmTips.ShowTipsError(this, "Error提示信息");
                FrmTips.ShowTipsInfo(this, "Info提示信息");
                FrmTips.ShowTipsSuccess(this, "Success提示信息");
                FrmTips.ShowTipsWarning(this, "Warning提示信息");
                FrmTips.ShowTips(this, "自定义提示信息", 2000, true, ContentAlignment.MiddleCenter, null, TipsSizeMode.Medium, new Size(300, 50), TipsState.Success);
                break;

            case "有返回的窗体":
                new FrmTestFrmBack().ShowDialog(this);
                break;

            case "等待窗体":
                ControlHelper.ThreadRunExt(this, () =>
                {
                    Thread.Sleep(5000);
                    ControlHelper.ThreadInvokerControl(this, () =>
                    {
                        FrmTips.ShowTipsSuccess(this, "FrmWaiting测试");
                    });
                }, null, this);
                break;

            case "仅有标题的窗体":
                new FrmWithTitleTest().ShowDialog(this);
                break;

            case "确定取消窗体1":
                new FrmOKCancel1Test().ShowDialog(this);
                break;

            case "确定取消窗体2":
                new FrmOKCancel2Test().ShowDialog(this);
                break;

            case "资源加载窗体":
                FrmTestLoading frmLoading = new FrmTestLoading();
                frmLoading.BackgroundWorkAction = delegate()
                {
                    try
                    {
                        frmLoading.CurrentMsg = new KeyValuePair <int, string>(1, "正在初始化配置...");
                        Thread.Sleep(1000);
                        frmLoading.CurrentMsg = new KeyValuePair <int, string>(10, "正在加载第一个资源...");
                        Thread.Sleep(1000);
                        frmLoading.CurrentMsg = new KeyValuePair <int, string>(20, "正在加载第二个资源...");
                        Thread.Sleep(1000);
                        frmLoading.CurrentMsg = new KeyValuePair <int, string>(30, "正在加载第三个资源...");
                        Thread.Sleep(1000);
                        frmLoading.CurrentMsg = new KeyValuePair <int, string>(40, "正在加载第四个资源...");
                        Thread.Sleep(1000);
                        frmLoading.CurrentMsg = new KeyValuePair <int, string>(50, "正在加载第五个资源...");
                        Thread.Sleep(1000);
                        frmLoading.CurrentMsg = new KeyValuePair <int, string>(60, "正在加载第六个资源...");
                        Thread.Sleep(1000);
                        frmLoading.CurrentMsg = new KeyValuePair <int, string>(70, "正在加载第七个资源...");
                        Thread.Sleep(1000);
                        frmLoading.CurrentMsg = new KeyValuePair <int, string>(80, "正在加载第八个资源...");
                        Thread.Sleep(1000);
                        frmLoading.CurrentMsg = new KeyValuePair <int, string>(90, "正在加载第九个资源...");
                        Thread.Sleep(1000);
                        frmLoading.CurrentMsg = new KeyValuePair <int, string>(1000, "数据加载完成...");
                        Thread.Sleep(1000);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("加载资源时出现错误");
                    }
                };
                frmLoading.ShowDialog();
                break;
                #endregion

                #region 控件    English:control
            case "表单控件":
                AddControl(new UC.UCTestForms());
                break;

            case "按钮":
                AddControl(new UC.UCTestBtns());
                break;

            case "选项卡":
                AddControl(new UC.UCTestTab());
                break;

            case "树":
                AddControl(new UC.UCTestTreeview()
                {
                    Dock = DockStyle.Left
                });
                break;

            case "列表":
                AddControl(new UC.UCTestList()
                {
                    Dock = DockStyle.Left
                });
                break;

            case "平铺列表":
                AddControl(new UC.UCTestListView()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "垂直导航":
                AddControl(new UC.UCTestMenu()
                {
                    Dock = DockStyle.Left
                });
                break;

            case "横向列表":
                AddControl(new UC.UCTestHorizontalList());
                break;

            case "分页控件":
                AddControl(new UC.UCTestPage());
                break;

            case "表格":
                AddControl(new UC.UCTestGridTable());
                break;

            case "表格-自定义单元格":
                AddControl(new UC.UCTestGridTableCustom());
                break;

            case "树表格":
                AddControl(new UC.UCTestTreeGridTable());
                break;

            case "进度条":
                AddControl(new UC.UCTestProcess()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "步骤控件":
                AddControl(new UC.UCTestStep()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "面包屑导航":
                AddControl(new UC.UCTestNavigation()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "文字提示":
                AddControl(new UC.UCTestTips()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "滚动文字":
                AddControl(new UC.UCTestRollText()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "滑块":
                AddControl(new UC.UCTestTrackbar()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "水波":
                AddControl(new UC.UCTestWave()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "有标题的面板":
                AddControl(new UC.UCTestPanelTitle()
                {
                    Dock = DockStyle.Left
                });
                break;

            case "图标":
                AddControl(new UC.UCTestIcon()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "滚动条":
                AddControl(new UC.UCTestScrollbar()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "控件水印":
                AddControl(new UC.UCTestGraphicalOverlay());
                break;

            case "表单验证":
                AddControl(new UC.UCTestVerification()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "图片采样控件":
                AddControl(new UC.UCTestSampling());
                break;

            case "倒影":
                AddControl(new UC.UCTestShadow());
                break;

            case "内置颜色":
                AddControl(new UC.UCTestColors());
                break;

            case "导航菜单":
                AddControl(new UC.UCTestNavigationMenu());
                break;

            case "扩展导航菜单":
                AddControl(new UC.UCTestNavigationMenuExt());
                break;

            case "类Office导航菜单":
                AddControl(new UC.UCTestNavigationMenuOffice());
                break;

            case "分割线标签":
                AddControl(new UC.UCTestSplitLabel());
                break;

            case "时间轴":
                AddControl(new UC.UCTestTimeLine()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "穿梭框":
                AddControl(new UC.UCTestTransfer());
                break;

            case "引用区块":
                AddControl(new UC.UCTestPanelQuote());
                break;

            case "右键菜单":
                AddControl(new UC.UCTestContextMenu());
                break;
                #endregion

                #region 图表    English:Chart
            case "组织结构图":
                AddControl(new UC.UCTestMindMapping()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "滚动图表":
                AddControl(new UC.UCTestWaveChart()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "雷达图":
                AddControl(new UC.UCTestRadarChart()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "金字塔图":
                AddControl(new UC.UCTestFunnelChart());
                break;

            case "Live Charts":
                AddControl(new UC.UCTestLiveCharts());
                break;
                #endregion

                #region 工业    English:Industry
            case "LED文字":
                AddControl(new UC.UCTestLED()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "仪表":
                AddControl(new UC.UCTestMeter());
                break;

            case "管道":
                AddControl(new UC.UCTestConduit());
                break;

            case "阀门":
                AddControl(new UC.UCTestValve());
                break;

            case "鼓风机":
                AddControl(new UC.UCTestBlower());
                break;

            case "传送带":
                AddControl(new UC.UCTestConveyor());
                break;

            case "警示灯":
                AddControl(new UC.UCTestSignalLamp());
                break;

            case "箭头":
                AddControl(new UC.UCTestArrow());
                break;

            case "温度计":
                AddControl(new UC.UCTestThermometer());
                break;

            case "转子":
                AddControl(new UC.UCTestRotor());
                break;

            case "多通道转盘":
                AddControl(new UC.UCTestDialAisle());
                break;

            case "转盘":
                AddControl(new UC.UCTestTurntable());
                break;
                #endregion
            }
        }
示例#18
0
        private void tvMenu_AfterSelect(object sender, TreeViewEventArgs e)
        {
            panControl.Controls.Clear();
            string strName = e.Node.Text.Trim();

            switch (strName)
            {
                #region 窗体    English:forms
            case "提示窗体":
                if (FrmDialog.ShowDialog(this, "是否再显示一个没有取消按钮的提示框?", "模式窗体测试", true) == System.Windows.Forms.DialogResult.OK)
                {
                    FrmDialog.ShowDialog(this, "这是一个没有取消按钮的提示框", "模式窗体测试");
                }
                break;

            case "多输入窗体":
                FrmInputs frm = new FrmInputs("动态多输入窗体测试",
                                              new string[] { "姓名", "电话", "身份证号", "住址" },
                                              new Dictionary <string, HZH_Controls.TextInputType>()
                {
                    { "电话", HZH_Controls.TextInputType.Regex }, { "身份证号", HZH_Controls.TextInputType.Regex }
                },
                                              new Dictionary <string, string>()
                {
                    { "电话", "^1\\d{0,10}$" }, { "身份证号", "^\\d{0,18}$" }
                },
                                              new Dictionary <string, KeyBoardType>()
                {
                    { "电话", KeyBoardType.UCKeyBorderNum }, { "身份证号", KeyBoardType.UCKeyBorderNum }
                },
                                              new List <string>()
                {
                    "姓名", "电话", "身份证号"
                });
                frm.ShowDialog(this);
                break;

            case "气泡提示窗体":
                FrmTips.ShowTipsError(this, "Error提示信息");
                FrmTips.ShowTipsInfo(this, "Info提示信息");
                FrmTips.ShowTipsSuccess(this, "Success提示信息");
                FrmTips.ShowTipsWarning(this, "Warning提示信息");
                FrmTips.ShowTips(this, "自定义提示信息", 2000, true, ContentAlignment.MiddleCenter, null, TipsSizeMode.Medium, new Size(300, 50), TipsState.Success);
                break;

            case "有返回的窗体":
                new FrmTestFrmBack().ShowDialog(this);
                break;

            case "等待窗体":
                ControlHelper.ThreadRunExt(this, () =>
                {
                    Thread.Sleep(5000);
                    ControlHelper.ThreadInvokerControl(this, () =>
                    {
                        FrmTips.ShowTipsSuccess(this, "FrmWaiting测试");
                    });
                }, null, this);
                break;

            case "仅有标题的窗体":
                new FrmWithTitleTest().ShowDialog(this);
                break;

            case "确定取消窗体1":
                new FrmOKCancel1Test().ShowDialog(this);
                break;

            case "确定取消窗体2":
                new FrmOKCancel2Test().ShowDialog(this);
                break;
                #endregion

                #region 控件    English:control
            case "表单控件":
                AddControl(new UC.UCTestForms());
                break;

            case "按钮":
                AddControl(new UC.UCTestBtns());
                break;

            case "选项卡":
                AddControl(new UC.UCTestTab());
                break;

            case "树":
                AddControl(new UC.UCTestTreeview()
                {
                    Dock = DockStyle.Left
                });
                break;

            case "列表":
                AddControl(new UC.UCTestList()
                {
                    Dock = DockStyle.Left
                });
                break;

            case "平铺列表":
                AddControl(new UC.UCTestListView()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "垂直导航":
                AddControl(new UC.UCTestMenu()
                {
                    Dock = DockStyle.Left
                });
                break;

            case "横向列表":
                AddControl(new UC.UCTestHorizontalList());
                break;

            case "分页控件":
                AddControl(new UC.UCTestPage());
                break;

            case "表格":
                AddControl(new UC.UCTestGridTable()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "树表格":
                AddControl(new UC.UCTestTreeGridTable()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "进度条":
                AddControl(new UC.UCTestProcess()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "步骤控件":
                AddControl(new UC.UCTestStep()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "面包屑导航":
                AddControl(new UC.UCTestNavigation()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "文字提示":
                AddControl(new UC.UCTestTips()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "滚动文字":
                AddControl(new UC.UCTestRollText()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "滑块":
                AddControl(new UC.UCTestTrackbar()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "水波":
                AddControl(new UC.UCTestWave()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "有标题的面板":
                AddControl(new UC.UCTestPanelTitle()
                {
                    Dock = DockStyle.Left
                });
                break;

            case "图标":
                AddControl(new UC.UCTestIcon()
                {
                    Dock = DockStyle.Fill
                });
                break;

                #endregion

                #region 图表    English:Chart
            case "组织结构图":
                AddControl(new UC.UCTestMindMapping()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "柱状图":
                AddControl(new UC.UCTestBarcharts());
                break;

            case "滚动图表":
                AddControl(new UC.UCTestWaveChart()
                {
                    Dock = DockStyle.Fill
                });
                break;
                #endregion

                #region 工业    English:Industry
            case "LED文字":
                AddControl(new UC.UCTestLED()
                {
                    Dock = DockStyle.Fill
                });
                break;

            case "仪表":
                AddControl(new UC.UCTestMeter());
                break;

            case "管道":
                AddControl(new UC.UCTestConduit());
                break;

            case "阀门":
                AddControl(new UC.UCTestValve());
                break;

            case "鼓风机":
                AddControl(new UC.UCTestBlower());
                break;

            case "传送带":
                AddControl(new UC.UCTestConveyor());
                break;

            case "警示灯":
                AddControl(new UC.UCTestSignalLamp());
                break;

            case "箭头":
                AddControl(new UC.UCTestArrow());
                break;

            case "温度计":
                AddControl(new UC.UCTestThermometer());
                break;
                #endregion
            }
        }