示例#1
0
 protected void gridView_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "AchDelete")
     {
         Cultural.Model.Achievement ach = new Cultural.Model.Achievement();
         ach        = bll.GetModel(int.Parse(e.CommandArgument.ToString()));
         ach.Status = "0";
         bll.Update(ach);
         BindData();
     }
 }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id = Request.QueryString["id"];
     if (!IsPostBack)
     {
         if (id != null && id.ToString() != "")
         {
             ach = achBll.GetModel(int.Parse(id));
             BindTextBox(ach);
         }
     }
 }
示例#3
0
 public void BindTextBox(Cultural.Model.Achievement ach)
 {
     if (ach != null)
     {
         txtAchName.Text = ach.AchieveName;
         Cultural.BLL.Board   boardBll = new Cultural.BLL.Board();
         Cultural.Model.Board board    = new Cultural.Model.Board();
         board            = boardBll.GetModel(int.Parse(ach.BoardID.ToString()));
         txtBoard.Text    = board != null ? board.BoardName : "";
         txtCharger.Text  = ach.MainCharge;
         txtContent.Text  = ach.Content;
         txtMeaning.Text  = ach.Meaning;
         txtOrigon.Text   = ach.Origon;
         txtPublish.Text  = ach.Publish;
         txtFileName.Text = ach.AccName;
         FilePath         = Maticsoft.Common.CommonFun.URLConverToServer(string.Format("{0}{1}", "../../FileUpload/", ach.AccURL));
     }
 }
示例#4
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, "项目名或项目主要内容不能为空!");
            }
        }