Example #1
0
        private void btnUpLoad_Click(object sender, EventArgs e)
        {
            if (CheckInput(rtbNoticeContent.Html))
            {
                Notice notice = new Notice()
                {
                    NoticeNo      = new CounterHelper().GetNewId("NoticeId"),
                    Noticetheme   = txtNoticeTheme.Text.Trim(),
                    NoticeContent = rtbNoticeContent.Html,
                    NoticeTime    = dtpUpLoadDate.Value,
                    NoticeClub    = cboSelectClub.SelectedValue.ToString(),
                    datains_usr   = AdminInfo.Account,
                    datains_date  = DateTime.Now
                };

                switch (cbNoticeType.Text)
                {
                case "人事变动":
                    notice.NoticeTypeName = "PersonnelChanges";
                    break;

                case "普通公告":
                    notice.NoticeTypeName = "GeneralNotice";
                    break;
                }

                bool n = new NoticeService().InsertNotice(notice);
                MessageBox.Show("上传成功!");
                #region 获取添加操作日志所需的信息
                OperationLog o = new OperationLog();
                o.OperationTime    = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss"));
                o.Operationlog     = AdminInfo.Account + AdminInfo.Name + "于" + DateTime.Now + "进行了上传公告操作!编号为:" + notice.NoticeNo;
                o.OperationAccount = AdminInfo.Account + AdminInfo.Name;
                o.datains_usr      = AdminInfo.Account;
                o.datains_date     = DateTime.Now;
                #endregion
                new OperationlogService().InsertOperationLog(o);
            }
            else
            {
                UIMessageBox.ShowWarning("含有非法操作字符!");
                return;
            }
            foreach (Control Ctrol in this.Controls)
            {
                if (Ctrol is TextBox)
                {
                    Ctrol.Text = "";
                }
                if (Ctrol is KSharpEditor.KEditor)
                {
                    Ctrol.Text = "";
                }
            }
        }
Example #2
0
 // 根据书名查找图书信息
 private void searchbtn_Click(object sender, EventArgs e)
 {
     if (nametb.Text.Trim() != "")
     {
         string sql = "select id 编号, bookName 书名, author 作者,bookNumber 数量, publishCompany 出版社, publishDate 出版时间, bookType 类型, pages 页数, wordsNumber 字数 from book where bookName like '%" + nametb.Text.Trim() + "%'";
         SqlHelper.setGDV(sql, tushucaozuoDV);
     }
     else
     {
         UIMessageBox.ShowWarning("请输入书籍名称进行查找");
     }
 }
        private void btnUpd_Click(object sender, EventArgs e)
        {
            bool dr = UIMessageBox.Show("是否确认修改员工信息?", "修改提醒", UIStyle.Green, UIMessageBoxButtons.OKCancel);

            if (dr == true)
            {
                string NewTel = Md5LockedUtil.MD5Encrypt32(WorkerTel.Text.ToString());
                #region 员工信息代码块
                Worker worker = new Worker
                {
                    WorkerId        = WorkerNo.Text.Trim(),
                    WorkerName      = WorkerName.Text.Trim(),
                    WorkerNation    = cbWorkerNation.SelectedValue == null ? "N-00001" : cbWorkerNation.SelectedValue.ToString(),
                    WorkerTel       = NewTel,
                    WorkerAddress   = txtAddress.Text,
                    WorkerFace      = cboWorkerFace.Text,
                    WorkerEducation = cboEducation.SelectedValue.ToString() == null ? "E-00001" : cboEducation.SelectedValue.ToString(),
                    datachg_usr     = AdminInfo.Account,
                    datachg_date    = DateTime.Now
                };
                bool i = new WorkerService().UpdateWorker(worker);
                if (i == true)
                {
                    UIMessageBox.ShowSuccess("信息修改成功!");
                    return;
                }
                else
                {
                    UIMessageBox.ShowError("服务器繁忙!");
                    return;
                }
                #endregion
            }
            else
            {
                UIMessageBox.ShowWarning("修改操作已取消!");
                return;
            }
        }