Esempio n. 1
0
        private void Paramenter_TextChanged(object sender, TextChangedEventArgs e)
        {
            string input = ((TextBox)sender).Text.Trim();
            string acronym;

            if (input != null && input.Length > 0)
            {
                acronym = CommonTool.CaptureUpperCase(input);
                cmdService.ShuffleList(acronym);
            }
            int count = this.RecList.Items.Count;

            if (count > 0)
            {
                this.Popup.IsOpen = true;
            }
            else
            {
                this.Popup.IsOpen = false;
            }
        }
Esempio n. 2
0
        public void CopyFolders(string path)
        {
            this.result.Text = "";
            bool hasCopyed = false;

            foreach (string folder in folderList)
            {
                string AsbUrl = relUrl + folder;
                if (Directory.Exists(AsbUrl))
                {
                    hasCopyed = true;
                    CommonTool.CopyDir(AsbUrl, System.IO.Path.Combine(path, folder));
                    this.result.Text += folder + " 拷贝成功" + Environment.NewLine;
                }
            }
            if (hasCopyed)
            {
                this.result.Text += "项目成功拷贝到了 <" + path + " >目录下" + Environment.NewLine;;
            }
            else
            {
                this.result.Text = "没有文件被拷贝,轻查看路径下是否有模板项目文件" + Environment.NewLine;;
            }
        }
Esempio n. 3
0
        private void Save(object sender, RoutedEventArgs e)
        {
            string name    = (this.Name.Text != null) ? this.Name.Text.Trim().Replace(" ", "") : null;
            string sql     = String.Format("SELECT count(*) from parameter where tag = '{0}'", name);
            int    nameCnt = accesser.GetCount(sql);

            sql = String.Format("SELECT count(*) from parameter where para = '{0}'", Parameter);
            int ParaCnt = accesser.GetCount(sql);

            if (name == null || name.Length == 0)
            {
                MessageBox.Show("请输入正确的变量名称以便保存");
            }
            else if (nameCnt > 0)
            {
                MessageBox.Show("名称已存在");
            }
            else if (ParaCnt > 0)
            {
                MessageBox.Show("参数已存在,不要重复保存");
            }
            else
            {
                sql = String.Format("insert into Parameter(tag,para,capital) values('{0}','{1}','{2}')", name, Parameter, CommonTool.CaptureUpperCase(name));
                int result = accesser.Update(sql);
                if (result == 1)
                {
                    MessageBox.Show("保存成功");
                    this.Close();
                }
                else
                {
                    MessageBox.Show("保存失败!");
                    this.Close();
                }
            }
        }