public string GetCompanyNewsDetail(HttpContext context) { string jsonStr = string.Empty; int ID = Convert.ToInt32(context.Request.Params["ID"]); int Language = Convert.ToInt32(context.Request.Params["lang"]); DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment(); try { if (dbm.Open()) { Model.Company_News cn = Factory.GetExecution().SelectByID <Model.Company_News>(ID); cn.BrowseTimes += 1; bool flag = Factory.GetExecution().Update <Model.Company_News>(cn); List <Model.Company_News> cp = Factory.GetExecution().GetByWhereSqlList <Model.Company_News>(" and ID=" + ID + " and Language=" + Language, " ID asc"); jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(cp); context.Response.Write(jsonStr); } } catch (Exception ex) { context.Response.Write("FAIL|无法获取驳回原因"); } finally { dbm.Close(); } return(jsonStr); }
public void BindData() { if (view_action == "notify") { Model.Company_News cp = Factory.GetExecution().SelectByID <Model.Company_News>(requestID); if (cp != null) { if (cp.Language == 1) { Chinese.Checked = true; } else if (cp.Language == 3) { English.Checked = true; } else if (cp.Language == 2) { Traditional.Checked = true; } txtTitle.Text = cp.Title; XiangQing = cp.Content; txtCreatePeople.Text = cp.CreatePeople; txtCreateCompany.Text = cp.CreateCompany; HomePageUploadImg.ImageUrl = WebSite.IMAGESERVER_WEBPATH + photoPath + cp.LogoUrl; HomePageUploadFileName.Text = cp.LogoUrl; txtKeywords.Text = cp.Keywords; txtDescription.Text = cp.Description; } } }
protected void btnSave_Click(object sender, EventArgs e) { try { XiangQing = Request.Form["editorValue"]; //获取umeditor的值 if (string.IsNullOrEmpty(XiangQing)) { Common.MessageBox.ShowLayer(this, "正文内容不能为空", 2); return; } if (view_action == "notify") { Model.Company_News cp = Factory.GetExecution().SelectByID <Model.Company_News>(requestID); if (cp != null) { cp.Language = Convert.ToInt32(Request.Form["language"]); cp.Title = txtTitle.Text; cp.Content = XiangQing; cp.CreatePeople = txtCreatePeople.Text; cp.CreateCompany = txtCreateCompany.Text; cp.LogoUrl = HomePageUploadFileName.Text; cp.CreatePeople = txtCreatePeople.Text; cp.UpdateTime = DateTime.Now; cp.Keywords = txtKeywords.Text.Trim(); cp.Description = txtDescription.Text.Trim(); bool flag = Factory.GetExecution().Update <Model.Company_News>(cp); if (flag) { Common.MessageBox.ShowRedirect(this, "/BusinessConsulting/CompanyNews.aspx"); } } } else { Model.Company_News cp = new Model.Company_News(); cp.Language = Convert.ToInt32(Request.Form["language"]); cp.Title = txtTitle.Text; cp.Content = XiangQing; cp.CreatePeople = txtCreatePeople.Text; cp.CreateCompany = txtCreateCompany.Text; cp.LogoUrl = HomePageUploadFileName.Text; cp.CreatePeople = txtCreatePeople.Text; cp.BrowseTimes = 0; cp.UpdateTime = DateTime.Now; cp.CreateTime = DateTime.Now; cp.Keywords = txtKeywords.Text.Trim(); cp.Description = txtDescription.Text.Trim(); bool flag = Factory.GetExecution().Add <Model.Company_News>(cp); if (flag) { Common.MessageBox.ShowRedirect(this, "/BusinessConsulting/CompanyNews.aspx"); } } } catch (Exception ex) { Common.MessageBox.ShowLayer(this, "添加失败!" + ex.Message, 2); } finally { BindData(); } }