Beispiel #1
0
        /// <summary>
        /// 上传文档的按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UploadDoc_ButtonClick(object sender, RoutedEventArgs e)
        {
            string uploadDocName = string.Empty;

            if (ofd.ShowDialog() == true)
            {
                uploadDocName = ofd.FileName;
            }
            if (uploadDocName != "")
            {
                string docPath    = uploadDocName;
                string ServerPath = string.Empty;
                string docName    = string.Empty;
                //如果执行上传操作成功,将文件信息添加到数据库中
                if (waysOfWord.WayOfUploadDoc(userId, docPath, ref docName, ref ServerPath) == true)
                {
                    DocInfo docInfo = new DocInfo();
                    docInfo.DocId         = WaysOfString.ReturnNowTimeString();
                    docInfo.DocName       = docName;//更改文档名称为当前时间+队伍账号
                    docInfo.DocPath       = ServerPath;
                    docInfo.UserId        = userId;
                    docInfo.DocIsLast     = 1;//上传后为最新版本
                    docInfo.DocUploadTime = DateTime.Now;
                    docInfo.DocState      = 0;
                    db.SaveUploadDocInfo(docInfo);//插入数据库文件名和时间
                    MessageBox.Show("上传成功!");
                }
            }
            //上传文档后重新加载页面
            LoadDocInfo();
        }
Beispiel #2
0
        /// <summary>
        /// 提交审批的按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SubmitProblem_ButtonClick(object sender, RoutedEventArgs e)
        {
            string viewId = WaysOfString.ReturnNowTimeString();

            //添加意见到数据库,并更改该文档审批状态
            db.SubmitViewMes(viewId, docId, userId, problemTextBox.Text);
            MessageBox.Show("审批意见提交成功");
        }
Beispiel #3
0
 /// <summary>
 /// 注册的按钮点击事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void register_ButtonClick(object sender, RoutedEventArgs e)
 {
     if (String.IsNullOrEmpty(passwordText.Text) || String.IsNullOrEmpty(userNameText.Text))
     {
         MessageBox.Show("用户名或密码不能为空!");
     }
     else if (String.IsNullOrEmpty(passwordAgainText.Text))
     {
         MessageBox.Show("请确认密码!");
     }
     else if (passwordText.Text.Equals(passwordAgainText.Text))
     {
         string userId = WaysOfString.ReturnNowTimeString();
         db.InsertRegisterInfo(userId, userNameText.Text, passwordText.Text);
         MessageBox.Show("登陆成功!您的账号是" + userId + "。请牢记!");
     }
     else
     {
         MessageBox.Show("两次输入密码不一致!");
     }
 }