本文整理匯總了C#中TPortalClass.JpCommon類的典型用法代碼示例。如果您正苦於以下問題:C# JpCommon類的具體用法?C# JpCommon怎麽用?C# JpCommon使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JpCommon類屬於TPortalClass命名空間,在下文中一共展示了JpCommon類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: RptBind
private void RptBind()
{
TPortalClass.JpCommon JpCommon2 = new TPortalClass.JpCommon();
if (this.Request.QueryString["cid"] != null)
this.pis_cid = JpCommon2.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9);
TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
string ls_where = " and cid like '" + pis_cid + "%' ";
string ls_order = " order by pubtime desc";
DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 3);
DataTable tempTable = dt.Clone();
//在現有的DatatTable增加一列
DataColumn col = new DataColumn("showTime", typeof(String));
//將列添加到DataTable中去
tempTable.Columns.Add(col);
//循環 對DataTable重新賦值
for (int i = 0; i < dt.Rows.Count; i++)
{
DataRow dr = tempTable.NewRow();
for (int j = 0; j < dt.Columns.Count; j++)
{
dr[tempTable.Columns[j].ColumnName] = dt.Rows[i][j];
}
//獲得間隔的時間
dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["crtime"].ToString()));
tempTable.Rows.Add(dr);
}
rptList.DataSource = tempTable;
rptList.DataBind();
this.pis_totalCount = JpArticle.SearchdocsByKeyNum(ls_where);
}
示例2: btnSearch_Click
//關健字查詢
protected void btnSearch_Click(object sender, EventArgs e)
{
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
string pageUrl = JpCommon.CombUrlTxt("list_comment_ysh.aspx", "rnd={0}&keywords={1}",
"" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "");
Response.Redirect(pageUrl);
}
示例3: btnSave_Click
//保存排序
protected void btnSave_Click(object sender, EventArgs e)
{
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
TPortalClass.JpRole JpRole = new TPortalClass.JpRole();
for (int i = 0; i < rptList.Items.Count; i++)
{
//int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
float sortId;
if (!float.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
{
sortId = 99;
}
JpRole.Updatesort(id, sortId);
}
string pageUrl = JpCommon.CombUrlTxt("list_role.aspx", "page={0}&rnd={1}",
"" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "");
//寫係統日誌
string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (userip == null || userip == "")
{
userip = Request.ServerVariables["REMOTE_ADDR"];
}
JpCommon.WriteLog(userip, "保存排序", "批量保存權限排序號", Session["uid"].ToString(), Session["uname"].ToString());
Response.Write("<script>alert('保存排序成功!');window.location='" + pageUrl + "';</script>");
}
示例4: RptBind
public string RptBind()
{
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
StringBuilder stringBuilder = new StringBuilder();
TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
string ls_where = " and cid like '" + pis_cid + "%' and sfzwd='否' ";
string ls_order = " order by pubtime desc";
DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 6);
int commentCount = 0;
JpComment jpComment = new JpComment();
for (int i = 0; i < dt.Rows.Count; i++)
{
commentCount = jpComment.GetdocsbyaidAllCount(dt.Rows[i]["aid"].ToString(), pis_cid);
stringBuilder.Append("<li><a onclick=\"locationDetail('art_detail.aspx?aid=" + dt.Rows[i]["aid"].ToString() + "&cid=" + pis_cid + "','" + locationType + "','1')\">");
stringBuilder.Append("<img class=\"scrollLoading\" src=\"" + dt.Rows[i]["indexdisplaypicpath"].ToString() + "\"><h1>");
stringBuilder.Append("" + dt.Rows[i]["title"].ToString() + "</h1>");
stringBuilder.Append("<p class=\"fleft\">" + JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["crtime"].ToString())) + "</p><p class=\"fleft\"><span><i class=\"ico-dj\"></i>" + dt.Rows[i]["praiseCount"].ToString() + "</span></p><p class=\"fleft\"><span><i class=\"ico-pl\"></i>" + commentCount + "</span>");
if (dt.Rows[i]["map_cid"].ToString() != "")
{
stringBuilder.Append("<p class=\"fright\"><i class=\"ico-zt\">" + dt.Rows[i]["map_cid"].ToString() + "</i></p>");
}
stringBuilder.Append("</a></li>");
}
return stringBuilder.ToString();
}
示例5: btnSubmit_Click
//答複
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (this.Session["uid"] == null || this.Session["uid"].ToString() == "")
{
this.Response.Redirect("../login.aspx");
}
string ls_tip = "答複成功!";
TPortalClass.DAO db = new TPortalClass.DAO();
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
string ls_ = txthy_reply.Text;
int ls_hy_ifsh = 2;
//寫係統日誌
string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (userip == null || userip == "")
{
userip = Request.ServerVariables["REMOTE_ADDR"];
}
JpCommon.WriteLog(userip, "答複", "答複求助記錄[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());
string sql_Update = " UPDATE hy_help SET";
sql_Update += " hy_reply ='" + txthy_reply.Text + "'";
sql_Update += " , hy_replytime ='" + DateTime.Now.ToString("yyyy-MM-dd") + "'";
sql_Update += " , hy_ifsh =" + ls_hy_ifsh + " where id=" + Convert.ToInt32(txtid.Value.Trim()) + "";
db.Execute(sql_Update);
Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
}
示例6: btnAudit_Click
//審核
protected void btnAudit_Click(object sender, EventArgs e)
{
TPortalClass.DAO db = new TPortalClass.DAO();
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
TPortalClass.JpActivityusers JpActivityusers = new TPortalClass.JpActivityusers();
string ls_tip = "審核成功!";
for (int i = 0; i < rptList.Items.Count; i++)
{
string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
if (cb.Checked)
{
string sql = "update hy_activityusers set hy_ifsh=1 where id=" + System.Int32.Parse(id) + "";
db.Execute(sql);
}
}
string pageUrl = "";
pageUrl = JpCommon.CombUrlTxt("list_activityusers.aspx", "page={0}&rnd={1}",
"" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "");
//寫係統日誌
string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (userip == null || userip == "")
{
userip = Request.ServerVariables["REMOTE_ADDR"];
}
JpCommon.WriteLog(userip, "審核人員", "批量審核活動報名人員", Session["uid"].ToString(), Session["uname"].ToString());
Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
}
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string ls_flag = ""; //0登陸成功;1退出係統
string ls_uid = "";
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
if (this.Request.QueryString["flag"] != null)
{
ls_flag = this.Request.QueryString["flag"].ToString();
}
if (ls_flag == "0")
{
if (this.Request.QueryString["uid"] != null)
{
Session["hyuid"] = this.Request.QueryString["uid"].ToString();
}
else
{
Session["hyuid"] = "";
}
}
else
{
//退出係統
Session["hyuid"] = "";
}
Response.Write(Session["hyuid"].ToString());
}
示例8: btnSubmit_Click
//發布
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (this.Session["uid"] == null || this.Session["uid"].ToString() == "")
{
this.Response.Redirect("../login.aspx");
}
string ls_tip = "發布成功!";
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
TPortalClass.JpPhotography JpPhotography = new TPortalClass.JpPhotography();
JpPhotography.id = Convert.ToInt32(txtid.Value);
JpPhotography.hy_uid = txthy_uid.Text;
JpPhotography.hy_addtime = Convert.ToDateTime(txthy_addtime.Text);
JpPhotography.hy_address = txthy_address.Text;
JpPhotography.hy_content = txthy_content.Text;
JpPhotography.hy_ifsh = 2;
JpPhotography.hy_sort = Convert.ToInt32(txthy_sort.Text);
JpPhotography.docid = txtDocid.Value;
//寫係統日誌
string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (userip == null || userip == "")
{
userip = Request.ServerVariables["REMOTE_ADDR"];
}
JpCommon.WriteLog(userip, "發布", "發布手攝記錄[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());
JpPhotography.Update();
Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
}
示例9: btnGoto_Click
//轉到第幾頁
protected void btnGoto_Click(object sender, EventArgs e)
{
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
string pageUrl = JpCommon.CombUrlTxt("list_activity_sh.aspx", "page={0}&rnd={1}&cid={2}",
this.txtGotoPage.Text, "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "");
Response.Redirect(pageUrl);
}
示例10: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string ls_aid = "", ls_cid = "", strType = "", ls_page = "1", la_pagesize = "10";
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
//獲取參數
if (this.Request.QueryString["type"] != null)
{
strType = this.Request.QueryString["type"].ToString();
}
if (this.Request.QueryString["page"] != null)
{
ls_page = this.Request.QueryString["page"].ToString();
}
if (this.Request.QueryString["cid"] != null)
{
ls_cid = this.Request.QueryString["cid"].ToString();
}
if (this.Request.QueryString["pagesize"] != null)
{
la_pagesize = this.Request.QueryString["pagesize"].ToString();
}
JpArticle JpArticle = new JpArticle();
string ls_where = " and cid = '" + ls_cid + "' ";
string ls_order = " order by pubtime desc";
string test = "";
DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, int.Parse(ls_page), int.Parse(la_pagesize));
//轉換成json格式
string strJson = JsonConvert.SerializeObject(dt);
//數據拋出
Response.Write(strJson);
}
示例11: btnDelete_Click
//批量刪除
protected void btnDelete_Click(object sender, EventArgs e)
{
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
TPortalClass.JpHelp JpHelp = new TPortalClass.JpHelp();
string ls_tip = "刪除成功!";
for (int i = 0; i < rptList.Items.Count; i++)
{
string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
if (cb.Checked)
{
JpHelp.id = int.Parse(id);
JpHelp.Delete();
}
}
string pageUrl = JpCommon.CombUrlTxt("list_help_sh.aspx", "page={0}&rnd={1}",
"" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "");
//寫係統日誌
string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (userip == null || userip == "")
{
userip = Request.ServerVariables["REMOTE_ADDR"];
}
JpCommon.WriteLog(userip, "刪除", "批量刪除幫辦記錄", Session["uid"].ToString(), Session["uname"].ToString());
Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
}
示例12: btndelinfo_Click
//刪除圖片
protected void btndelinfo_Click(object sender, EventArgs e)
{
string ls_filepath1 = "", ls_filepath2 = "";
TPortalClass.HyFileatt HyFileatt = new TPortalClass.HyFileatt();
DataTable dt = HyFileatt.Getdocbyid(this.txtuids.Value);
if (dt.Rows.Count > 0)
{
if (dt.Rows[0]["hy_fm"].ToString() == "1")
{
Response.Write("<script>alert('封麵圖片不能刪除');window.location.href=window.location.href;</script>");
return;
}
//刪除文件夾裏的圖片
ls_filepath1 = Server.MapPath("~/") + dt.Rows[0]["hy_filepath"].ToString();
ls_filepath2 = Server.MapPath("~/") + dt.Rows[0]["hy_filepath"].ToString().Replace("thumbnail", "original");
if (System.IO.File.Exists(ls_filepath1))
{
System.IO.File.Delete(ls_filepath1);
}
if (System.IO.File.Exists(ls_filepath2))
{
System.IO.File.Delete(ls_filepath2);
}
}
//刪除數據庫記錄
HyFileatt.Delete(this.txtuids.Value);
//操作日誌
TPortalClass.JpCommon HyCommon = new TPortalClass.JpCommon();
// HyCommon.WriteLog("刪除圖片", "刪除圖片ID:" + this.txtuids.Value, this.Session["hy_id"].ToString(), this.Session["hy_name"].ToString());
// LoadingPictures();
Response.Write("<script>location.replace(location);</script>");
}
示例13: btnSubmit_Click
//提交
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (this.Session["uid"] == null || this.Session["uid"].ToString() == "")
{
this.Response.Redirect("../login.aspx");
}
string ls_tip = "審核成功!";
TPortalClass.JpActivity JpActivity = new TPortalClass.JpActivity();
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
TPortalClass.DAO db = new TPortalClass.DAO();
string sql_cg = "update hy_activity set hy_ifsh=2 where id=" + System.Int32.Parse(this.txtid.Value) + "";
db.Execute(sql_cg);
//寫係統日誌
string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (userip == null || userip == "")
{
userip = Request.ServerVariables["REMOTE_ADDR"];
}
JpCommon.WriteLog(userip, "審核", "審核活動記錄[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());
JpActivity.Update();
Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
}
示例14: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
if (this.Request.QueryString["cid"] != null)
this.pis_cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9);
string ls_where = " and cid like '" + pis_cid + "%' and sfzwd='否' ";
TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
this.pis_totalCount = JpArticle.SearchdocsByKeyNum(ls_where);
}
示例15: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string ls_cid = "", ls_page = "1", la_pagesize = "10";
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
if (this.Request.QueryString["cid"] != null)
{
ls_cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9);
}
if (this.Request.QueryString["page"] != null)
{
ls_page = JpCommon.Filter(this.Request.QueryString["page"].ToString());
}
if (this.Request.QueryString["pagesize"] != null)
{
la_pagesize = JpCommon.Filter(this.Request.QueryString["pagesize"].ToString());
}
//根據傳入的文章欄目ID、頁碼、頁數返回列表信息
TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
string ls_where = "", ls_order = "";
ls_where = " and cid like '" + ls_cid + "%' and sfzwd='否' ";
ls_order = " order by pubtime desc";
DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, int.Parse(ls_page), int.Parse(la_pagesize));
//複製一個DataTalbe
DataTable tempTable = dt.Clone();
//在現有的DatatTable增加一列
DataColumn col = new DataColumn("showTime", typeof(String));
//將列添加到DataTable中去
tempTable.Columns.Add(col);
//在現有的DatatTable增加一列
DataColumn col2 = new DataColumn("commentCount", typeof(String));
//將列添加到DataTable中去
tempTable.Columns.Add(col2);
int commentCount = 0;
JpComment jpComment = new JpComment();
//循環 對DataTable重新賦值
for (int i = 0; i < dt.Rows.Count; i++)
{
DataRow dr = tempTable.NewRow();
for (int j = 0; j < dt.Columns.Count; j++)
{
dr[tempTable.Columns[j].ColumnName] = dt.Rows[i][j];
}
DataTable dtComment = jpComment.Getdocsbyaid_ysh(ls_cid, dt.Rows[i]["aid"].ToString());
commentCount = dtComment.Rows.Count;
//獲得間隔的時間
dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["crtime"].ToString()));
dr["commentCount"] = commentCount;
tempTable.Rows.Add(dr);
}
//轉換成json格式
string strJson = JsonConvert.SerializeObject(tempTable);
//數據拋出
Response.Write(strJson);
}