Пример #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, "项目名或项目主要内容不能为空!");
            }
        }
Пример #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            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 (content != "")
            {
                Cultural.BLL.Achievement achBll = new Cultural.BLL.Achievement();
                ach.MainCharge = mainCharge;
                ach.Origon     = Origin;
                ach.Publish    = publish;
                ach.Content    = content;
                ach.Meaning    = meaning;
                ach.BoardID    = boardId;
                if (ach.AccName != accName)
                {
                    ach.AccName = accName;
                    ach.AccURL  = accURL;
                }
                try
                {
                    achBll.Update(ach);
                    MessageBox.ShowAndRedirect(this.Page, "保存成功!", string.Format("AchieveShow.aspx?id=", hidAchID.Value));
                }
                catch
                {
                    MessageBox.Show(this.Page, "网络出错,保存失败!请重试!");
                }
            }
            else
            {
                Maticsoft.Common.MessageBox.Show(this.Page, "项目主要内容不能为空!");
            }
        }
Пример #3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            Cultural.BLL.Achievement achBll = new Cultural.BLL.Achievement();
            context.Response.ContentType = "text/plain";
            string paraFID = context.Request["FID"];                                                                     //读取参数PageSize

            if (paraFID != null && paraFID.Trim() == "ACHL")                                                             //列表界面
            {
                int     paraIndex   = context.Request["Index"] == null ? 1 : int.Parse(context.Request["Index"]);        //读取参数PageSize
                int     paraSize    = context.Request["PageSize"] == null ? 10 : int.Parse(context.Request["PageSize"]); //读取参数PageSize
                string  paraBoardID = context.Request["BoardID"] == null ? "0" : context.Request["BoardID"].ToString();  //读取参数
                AchInfo achInfoInfo = new AchInfo();
                achInfoInfo.AchList = achBll.DataTableToList(achBll.GetListByPage(string.Format(" BoardID={0} and Status!='0' ", paraBoardID), " AchieveID desc", (paraIndex - 1) * paraSize, paraIndex * paraSize).Tables[0]);
                for (int i = 0; i < achInfoInfo.AchList.Count; i++)
                {
                    achInfoInfo.AchList[i].AccURL = achInfoInfo.AchList[i].AccURL == null ? "" : Maticsoft.Common.CommonFun.URLConverToServer("FileUpload/" + achInfoInfo.AchList[i].AccURL);
                }
                achInfoInfo.TotalNum = achBll.GetRecordCount(string.Format(" BoardID={0} and Status!='0' ", paraBoardID));
                context.Response.Write(JsonHelper.Serialize(achInfoInfo));
            }
        }