private void NewsInfoBind() { string ID = Request.QueryString["ID"]; int i = 0; if (int.TryParse(ID, out i)) { T_NEWSBASEEntity FM = new T_NEWSBASEEntity(); FM.ID = int.Parse(ID); FM.Retrieve(); if (FM.IsPersistent) { newstitle.InnerHtml = "<span style='color:" + FM.TITLECOLOR + ";font-size:" + FM.TITLESIZE + "px;font-family:" + FM.TITLEFONT + "'>" + FM.TITLE + "</span>"; if (!"".Equals(FM.SUBTITLE)) { newstitle.InnerHtml = newstitle.InnerHtml + "<BR>"; newstitle.InnerHtml = newstitle.InnerHtml + "<span style='color:" + FM.SUBTITLECOLOR + ";font-size:" + FM.SUBTITLESIZE + "px;font-family:" + FM.SUBTITLEFONT + "'>" + FM.SUBTITLE + "</span>"; } nodename.InnerText = WebFunction.GetNodeName(FM.NODEID.ToString()); newsinfo.InnerHtml = "发布时间:" + FM.PUBLISHTIME.ToString() + " 文章来源:" + FM.COPYRIGHT + " 作者:" + FM.AUTHOR + " 点击数: " + FM.HITS.ToString(); newscontent.InnerHtml = FM.CONTENT; FM.HITS = FM.HITS + 1; FM.Save(); } } }
protected void btnOK_Click(object sender, EventArgs e) { T_NEWSBASEEntity t = new T_NEWSBASEEntity(); t.ID = Convert.ToDecimal(Names.GetSingQuote(hidId.Value)); t.TITLE = Names.GetSingQuote(txtTITLE.Text); t.CONTENT = Names.GetSingQuote(txtContent.Value); t.SUBTITLE = txtSUBTITLE.Text; InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm(); newloginform = (InfoStruct.LoginForm)Session[Names.SessionManage]; t.UPDATEUSERNAME = newloginform.userName; if (!string.IsNullOrEmpty(txtPUBLISHTIME.Text)) { t.PUBLISHTIME = Convert.ToDateTime(txtPUBLISHTIME.Text); } List <string> lNAME = new List <string>(); List <string> lVALUE = new List <string>(); t.DEFAULTPICURL = txtDefaultPicUrl.Text.Trim(); if (b.EditNews(t, lNAME, lVALUE)) { MessageBox("提交成功!"); Response.Redirect("wlList.aspx"); } else { MessageBox("提交失败!"); } }
protected void btnAdd_Click(object sender, EventArgs e) { T_NEWSBASEEntity t = new T_NEWSBASEEntity(); t.NODEID = 45; t.TITLE = Names.GetSingQuote(txtTITLE.Text); t.CONTENT = Names.GetSingQuote(txtContent.Value); InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm(); newloginform = (InfoStruct.LoginForm)Session[Names.SessionManage]; t.USERNAME = newloginform.userName; t.STATUS = 0; if (!string.IsNullOrEmpty(txtPUBLISHTIME.Text)) { t.PUBLISHTIME = Convert.ToDateTime(txtPUBLISHTIME.Text); } List <string> lNAME = new List <string>(); List <string> lVALUE = new List <string>(); try { t.DEFAULTPICURL = Request.Form["uploadList"]; } catch { } if (b.AddNews(t, lNAME, lVALUE)) { MessageBox("提交成功!"); Response.Redirect("lkList.aspx"); } else { MessageBox("提交失败!"); } }
private void NewsInfoBind() { string ID = Request.QueryString["ID"]; int i = 0; if (int.TryParse(ID, out i)) { T_NEWSBASEEntity FM = new T_NEWSBASEEntity(); FM.ID = int.Parse(ID); FM.Retrieve(); if (FM.IsPersistent) { newstitle.InnerHtml = "<font color='" + FM.TITLECOLOR + "' size='" + FM.TITLESIZE + "' face='" + FM.TITLEFONT + "'>" + FM.TITLE + "</font>"; if (!"".Equals(FM.SUBTITLE)) { newstitle.InnerHtml = newstitle.InnerHtml + "<BR>"; newstitle.InnerHtml = newstitle.InnerHtml + "<font color='" + FM.SUBTITLECOLOR + "' size='" + FM.SUBTITLESIZE + "' face='" + FM.SUBTITLEFONT + "'>" + FM.SUBTITLE + "</font>"; } //newsinfo.InnerHtml = "发布时间:" + FM.PUBLISHTIME.ToString() + " 文章来源:" + FM.COPYRIGHT + " 作者:" + FM.AUTHOR + " 点击数: " + FM.HITS.ToString(); newscontent.InnerHtml = FM.CONTENT; FM.HITS = FM.HITS + 1; FM.Save(); } } }
public bool EditNews(T_NEWSBASEEntity t, List <string> lNAME, List <string> lVALUE) { try { OracleConnection mycon = new OracleConnection(strcnn); mycon.Open(); string strUpdate = "update T_NEWSBASE set TITLE='" + t.TITLE + "',TITLEFONT='" + t.TITLEFONT + "',TITLECOLOR='" + t.TITLECOLOR + "',TITLESIZE=" + t.TITLESIZE + ",SUBTITLE='" + t.SUBTITLE + "',SUBTITLEFONT='" + t.SUBTITLEFONT + "',SUBTITLECOLOR='" + t.SUBTITLECOLOR + "',SUBTITLESIZE=" + t.SUBTITLESIZE + ",COPYRIGHT='" + t.COPYRIGHT + "',AUTHOR='" + t.AUTHOR + "',CONTENT=:content,DEFAULTPICURL='" + t.DEFAULTPICURL + "',UPDATEUSERNAME='******',UPDATETIME=sysdate,PUBLISHTIME=to_date('" + t.PUBLISHTIME + "','yyyy-MM-dd HH24:MI:SS'),ISSPECIAL='" + t.ISSPECIAL + "' where id=" + t.ID; OracleCommand mycmd = new OracleCommand(strUpdate); mycmd.Connection = mycon; OracleParameter pa1 = new OracleParameter(":content", OracleDbType.Long); pa1.Value = t.CONTENT; mycmd.Parameters.Add(pa1); mycmd.ExecuteNonQuery(); mycon.Close(); Transaction T = new Transaction(); string sql = ""; for (int i = 0; i < lNAME.Count; i++) { if (Query.ProcessSql("select count(*) from T_NEWSPIC where PICURL='" + lVALUE[i] + "' and NEWSID=" + t.ID, Names.DBName).Rows[0][0].ToString() == "0") { sql = "insert into T_NEWSPIC(ID,NEWSID,PICINFO,PICURL,STATUS) values (" + Sequence.GetNextValue("SEQ_T_NEWSPIC") + "," + t.ID + ",'" + lNAME[i] + "','" + lVALUE[i] + "',1)"; T.AddSqlString(sql, Names.DBName); } } T.Process(); return(true); } catch (Exception ex) { return(false); } }
public bool AddNews(T_NEWSBASEEntity t, List <string> lNAME, List <string> lVALUE) { try { string newsId = Sequence.GetNextValue("SEQ_T_NEWSBASE").ToString(); OracleConnection mycon = new OracleConnection(strcnn); mycon.Open(); string strUpdate = "insert into T_NEWSBASE(ID,NODEID,TITLE,TITLEFONT,TITLECOLOR,TITLESIZE,SUBTITLE,SUBTITLEFONT,SUBTITLECOLOR,SUBTITLESIZE,COPYRIGHT,AUTHOR,CONTENT,DEFAULTPICURL,USERNAME,INSERTTIME,STATUS,ISSPECIAL,PUBLISHTIME,HITS) values(" + newsId + "," + t.NODEID + ",'" + t.TITLE + "','" + t.TITLEFONT + "','" + t.TITLECOLOR + "'," + t.TITLESIZE + ",'" + t.SUBTITLE + "','" + t.SUBTITLEFONT + "','" + t.SUBTITLECOLOR + "'," + t.SUBTITLESIZE + ",'" + t.COPYRIGHT + "','" + t.AUTHOR + "',:content,'" + t.DEFAULTPICURL + "','" + t.USERNAME + "',sysdate,'" + t.STATUS + "','" + t.ISSPECIAL + "',to_date('" + t.PUBLISHTIME + "','yyyy-MM-dd HH24:MI:SS'),0)"; OracleCommand mycmd = new OracleCommand(strUpdate); mycmd.Connection = mycon; OracleParameter pa1 = new OracleParameter(":content", OracleDbType.Long); pa1.Value = t.CONTENT; mycmd.Parameters.Add(pa1); mycmd.ExecuteNonQuery(); mycon.Close(); Transaction T = new Transaction(); string sql = ""; for (int i = 0; i < lNAME.Count; i++) { sql = "insert into T_NEWSPIC(ID,NEWSID,PICINFO,PICURL,STATUS) values (" + Sequence.GetNextValue("SEQ_T_NEWSPIC") + "," + newsId + ",'" + lNAME[i] + "','" + lVALUE[i] + "',1)"; T.AddSqlString(sql, Names.DBName); } T.Process(); return(true); } catch { return(false); } }
protected void btnAdd_Click(object sender, EventArgs e) { //if (txtTITLE.Text == ""){ MessageBox("标题不能为空"); } //else //{ //if (txtPUBLISHTIME.Text == "") { MessageBox("更新时间不能为空"); } //else //{ } T_NEWSBASEEntity t = new T_NEWSBASEEntity(); t.NODEID = 3; t.TITLE = Names.GetSingQuote(txtTITLE.Text); t.TITLEFONT = Names.GetSingQuote(ddlTITLEFONT.SelectedValue); t.TITLECOLOR = Names.GetSingQuote(ddlTITLECOLOR.SelectedValue); t.TITLESIZE = Convert.ToDecimal(Names.GetSingQuote(ddlTITLESIZE.SelectedValue)); t.SUBTITLE = Names.GetSingQuote(txtSUBTITLE.Text); t.SUBTITLEFONT = Names.GetSingQuote(ddlSUBTITLEFONT.SelectedValue); t.SUBTITLECOLOR = Names.GetSingQuote(ddlSUBTITLECOLOR.SelectedValue); t.SUBTITLESIZE = Convert.ToDecimal(Names.GetSingQuote(ddlSUBTITLESIZE.SelectedValue)); t.COPYRIGHT = Names.GetSingQuote(txtCOPYRIGHT.Text); t.AUTHOR = Names.GetSingQuote(txtAUTHOR.Text); t.CONTENT = Names.GetSingQuote(txtContent.Value); InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm(); newloginform = (InfoStruct.LoginForm)Session[Names.SessionManage]; t.USERNAME = newloginform.userName; t.STATUS = 0; t.ISSPECIAL = Names.GetSingQuote(ddlISSPECIAL.SelectedValue); if (!string.IsNullOrEmpty(txtPUBLISHTIME.Text)) { t.PUBLISHTIME = Convert.ToDateTime(txtPUBLISHTIME.Text); } List <string> lNAME = new List <string>(); List <string> lVALUE = new List <string>(); try { t.DEFAULTPICURL = Request.Form["uploadList"]; string[] uploadListValue = Regex.Split(hiduploadListValue.Text, "&&", RegexOptions.IgnoreCase); string[] uploadListText = Regex.Split(hiduploadListText.Text, "&&", RegexOptions.IgnoreCase); for (int i = 0; i < uploadListValue.Length - 1; i++) { lNAME.Add(Names.GetSingQuote(uploadListText[i])); lVALUE.Add(Names.GetSingQuote(uploadListValue[i])); } } catch { } if (b.AddNews(t, lNAME, lVALUE)) { MessageBox("提交成功!"); Response.Redirect("NewsList.aspx"); } else { MessageBox("提交失败!"); } }
protected void btnOK_Click(object sender, EventArgs e) { T_NEWSBASEEntity t = new T_NEWSBASEEntity(); t.ID = Convert.ToDecimal(Names.GetSingQuote(hidId.Value)); t.TITLE = Names.GetSingQuote(txtTITLE.Text); t.COPYRIGHT = Names.GetSingQuote(txtCOPYRIGHT.Text); t.AUTHOR = Names.GetSingQuote(txtAUTHOR.Text); t.CONTENT = Names.GetSingQuote(txtContent.Value); InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm(); newloginform = (InfoStruct.LoginForm)Session[Names.SessionManage]; t.UPDATEUSERNAME = newloginform.userName; if (!string.IsNullOrEmpty(txtPUBLISHTIME.Text)) { t.PUBLISHTIME = Convert.ToDateTime(txtPUBLISHTIME.Text); } List <string> lNAME = new List <string>(); List <string> lVALUE = new List <string>(); try { t.DEFAULTPICURL = Request.Form["uploadList"]; string[] uploadListValue = Regex.Split(hiduploadListValue.Text, "&&", RegexOptions.IgnoreCase); string[] uploadListText = Regex.Split(hiduploadListText.Text, "&&", RegexOptions.IgnoreCase); for (int i = 0; i < uploadListValue.Length - 1; i++) { lNAME.Add(Names.GetSingQuote(uploadListText[i])); lVALUE.Add(Names.GetSingQuote(uploadListValue[i])); } } catch { } if (b.EditNews(t, lNAME, lVALUE)) { MessageBox("提交成功!"); Response.Redirect("dtList.aspx"); } else { MessageBox("提交失败!"); } }
protected void btnSave_Click(object sender, EventArgs e) { T_NEWSBASEEntity FM = new T_NEWSBASEEntity(); FM.ID = Sequence.GetNextValue("SEQ_T_NEWSBASE"); FM.NODEID = 64; FM.TITLE = txtTitle.Text; FM.HITS = int.Parse(txtHits.Text); FM.DEFAULTPICURL = imgPicUrl.ImageUrl; FM.PUBLISHTIME = DateTime.Now; FM.USERNAME = BaseUserName; FM.INSERTTIME = DateTime.Now; FM.Save(); Response.Redirect("processList.aspx"); }
private void NewsInfoBind() { string ID = Request.QueryString["ID"]; int i = 0; if (int.TryParse(ID, out i)) { T_NEWSBASEEntity FM = new T_NEWSBASEEntity(); FM.ID = int.Parse(ID); FM.Retrieve(); if (FM.IsPersistent) { newstitle.InnerHtml = FM.TITLE; imgPicUrl.ImageUrl = FM.DEFAULTPICURL; } } }
private void BestStaffInfoBind() { string ID = Request.QueryString["ID"]; int i = 0; if (int.TryParse(ID, out i)) { txtID.Text = ID; T_NEWSBASEEntity FM = new T_NEWSBASEEntity(); FM.ID = i; FM.Retrieve(); if (FM.IsPersistent) { txtTitle.Text = FM.TITLE; txtSubTitle.Text = FM.SUBTITLE.ToString(); imgPicUrl.ImageUrl = FM.DEFAULTPICURL; } } }
protected void btnSave_Click(object sender, EventArgs e) { T_NEWSBASEEntity FM = new T_NEWSBASEEntity(); int i = 0; if (int.TryParse(txtID.Text, out i)) { FM.ID = i; FM.Retrieve(); if (FM.IsPersistent) { FM.TITLE = txtTitle.Text.Trim(); FM.SUBTITLE = txtSubTitle.Text.Trim(); FM.DEFAULTPICURL = imgPicUrl.ImageUrl; FM.UPDATEUSERNAME = BaseUserName; FM.UPDATETIME = DateTime.Now; FM.Save(); Response.Redirect("beststaffList.aspx"); } } }
protected void btnAdd_Click(object sender, EventArgs e) { T_NEWSBASEEntity t = new T_NEWSBASEEntity(); t.NODEID = 4; t.TITLE = Names.GetSingQuote(txtTITLE.Text); t.TITLEFONT = Names.GetSingQuote(ddlTITLEFONT.SelectedValue); t.TITLECOLOR = Names.GetSingQuote(ddlTITLECOLOR.SelectedValue); t.TITLESIZE = Convert.ToDecimal(Names.GetSingQuote(ddlTITLESIZE.SelectedValue)); t.SUBTITLE = Names.GetSingQuote(txtSUBTITLE.Text); t.SUBTITLEFONT = Names.GetSingQuote(ddlSUBTITLEFONT.SelectedValue); t.SUBTITLECOLOR = Names.GetSingQuote(ddlSUBTITLECOLOR.SelectedValue); t.SUBTITLESIZE = Convert.ToDecimal(Names.GetSingQuote(ddlSUBTITLESIZE.SelectedValue)); t.COPYRIGHT = Names.GetSingQuote(txtCOPYRIGHT.Text); t.AUTHOR = Names.GetSingQuote(txtAUTHOR.Text); t.CONTENT = Names.GetSingQuote(txtContent.Value); InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm(); newloginform = (InfoStruct.LoginForm)Session[Names.SessionManage]; t.USERNAME = newloginform.userName; t.STATUS = 0; if (!string.IsNullOrEmpty(txtPUBLISHTIME.Text)) { t.PUBLISHTIME = Convert.ToDateTime(txtPUBLISHTIME.Text); } List <string> lNAME = new List <string>(); List <string> lVALUE = new List <string>(); if (b.AddNews(t, lNAME, lVALUE)) { MessageBox("提交成功!"); Response.Redirect("spList.aspx"); } else { MessageBox("提交失败!"); } }