Esempio n. 1
0
        protected void btnSaveAdd_Click(object sender, EventArgs e)
        {
            string achName    = txtAchName.Text.Trim();
            string mainCharge = txtCharger.Text.Trim();
            string Origin     = txtOrigon.Text.Trim();
            string publish    = txtPublish.Text.Trim();
            string content    = txtContent.Text.Trim();
            string meaning    = txtMeaning.Text.Trim();
            int    boardId    = int.Parse(ddlBoard.SelectedValue);
            string accName    = hidFileOriName.Value;
            string accURL     = hidFileNewName.Value;

            if (achName != "" && content != "")
            {
                Cultural.BLL.Achievement   achBll  = new Cultural.BLL.Achievement();
                Cultural.Model.Achievement achieve = new Cultural.Model.Achievement();
                achieve.AchieveName = achName;
                achieve.MainCharge  = mainCharge;
                achieve.Origon      = Origin;
                achieve.Publish     = publish;
                achieve.Content     = content;
                achieve.Meaning     = meaning;
                achieve.BoardID     = boardId;
                achieve.AccName     = accName;
                achieve.AccURL      = accURL;
                achieve.Status      = "1";
                try
                {
                    achBll.Add(achieve);
                    MessageBox.ShowAndRedirect(this.Page, "保存成功!", "AchieveAdd.aspx");
                }
                catch
                {
                    MessageBox.Show(this.Page, "网络出错,保存失败!请重试!");
                }
            }
            else
            {
                Maticsoft.Common.MessageBox.Show(this.Page, "项目名或项目主要内容不能为空!");
            }
        }