本文整理汇总了C#中TPortalClass.DAO类的典型用法代码示例。如果您正苦于以下问题:C# DAO类的具体用法?C# DAO怎么用?C# DAO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DAO类属于TPortalClass命名空间,在下文中一共展示了DAO类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: JpColumns
public JpColumns(string cid)
{
string sql = " select * from JpColumns ";
sql += " where cid = @cid ";
DAO db = new DAO();
SqlParameter[] sqlparam = {
db.MakeInParam("@cid",SqlDbType.VarChar,cid),
};
DataTable dt = db.GetDataTable(sql, sqlparam);
if (dt.Rows.Count > 0)
{
this.cid = dt.Rows[0]["cid"].ToString();
this.cname = dt.Rows[0]["cname"].ToString();
this.tmp_col = dt.Rows[0]["tmp_col"].ToString();
this.tmp_art = dt.Rows[0]["tmp_art"].ToString();
this.online = dt.Rows[0]["online"].ToString();
this.hotpublish = dt.Rows[0]["hotpublish"].ToString();
this.pubtime = dt.Rows[0]["pubtime"].ToString();
this.seotitle = dt.Rows[0]["seotitle"].ToString();
this.seokeywords = dt.Rows[0]["seokeywords"].ToString();
this.seodescription = dt.Rows[0]["seodescription"].ToString();
this.pubhtmlpath = dt.Rows[0]["pubhtmlpath"].ToString();
this.ifhotnews = dt.Rows[0]["ifhotnews"].ToString();
this.csort = Int32.Parse(dt.Rows[0]["csort"].ToString());
this.shtml = dt.Rows[0]["shtml"].ToString();
this.rss = Int32.Parse(dt.Rows[0]["rss"].ToString());
this.newpic = dt.Rows[0]["newpic"].ToString();
this.newday = Int32.Parse(dt.Rows[0]["newday"].ToString());
}
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:34,代码来源:JpColumns.cs
示例2: Update
/// <summary>
/// 修改
/// </summary>
/// <returns></returns>
public bool Update()
{
bool ret = true;
DAO db = new DAO();
try
{
String sqlUpdate = " update hy_verifycode set [email protected]_tel,[email protected]_addtime,[email protected]_code where 1=1 and [email protected]";
SqlParameter[] sqlparam = {db.MakeInParam("@hy_addtime",SqlDbType.DateTime,hy_addtime),
db.MakeInParam("@hy_tel",SqlDbType.VarChar,hy_tel),
db.MakeInParam("@hy_code",SqlDbType.VarChar,hy_code),
db.MakeInParam("@id",SqlDbType.Int,id)
};
db.Execute(sqlUpdate, sqlparam);
}
catch
{
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:29,代码来源:JpVerifyCode.cs
示例3: Insert
/// <summary>
/// 插入
/// </summary>
/// <returns></returns>
public bool Insert()
{
bool ret = true;
DAO db = new DAO();
try
{
String sqlInsert = " insert into hy_verifycode(hy_tel,hy_code,hy_addtime) values (@hy_tel,@hy_code,@hy_addtime)";
SqlParameter[] sqlparam = {db.MakeInParam("@hy_addtime",SqlDbType.DateTime,hy_addtime),
db.MakeInParam("@hy_tel",SqlDbType.VarChar,hy_tel),
db.MakeInParam("@hy_code",SqlDbType.VarChar,hy_code)
};
db.Execute(sqlInsert, sqlparam);
}
catch (Exception ex)
{
throw ex;
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:30,代码来源:JpVerifyCode.cs
示例4: Delete
/// <summary>
/// ɾ��
/// </summary>
/// <returns></returns>
public bool Delete()
{
bool ret = true;
DAO db = new DAO();
try
{
String sql = "delete from JpDepts where [email protected] ";
SqlParameter[] sqlparam = {
db.MakeInParam("@deptid",SqlDbType.VarChar,deptid),
};
db.Execute(sql, sqlparam);
}
catch
{
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:30,代码来源:JpDepts.cs
示例5: DeleteBycid
/// <summary>
/// ɾ��ij��Ŀ�����й���
/// </summary>
/// <returns></returns>
public bool DeleteBycid(string cid)
{
bool ret = true;
DAO db = new DAO();
try
{
string sql = " delete JpColumnRelations where [email protected] ";
SqlParameter[] sqlparam = {
db.MakeInParam("@cid",SqlDbType.VarChar,cid),
};
db.Execute(sql, sqlparam);
}
catch
{
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:29,代码来源:JpColumnRelations.cs
示例6: Insert
public bool Insert()
{
bool ret = true;
DAO db = new DAO();
try
{
string sql = " insert into JpPubHtml(id,pages,days,status) values (@id,@pages,@days,@status)";
SqlParameter[] sqlparam = {
db.MakeInParam("@id",SqlDbType.VarChar,id),
db.MakeInParam("@pages",SqlDbType.VarChar,pages),
db.MakeInParam("@days",SqlDbType.VarChar,days),
db.MakeInParam("@status",SqlDbType.VarChar,status),
};
db.Execute(sql, sqlparam);
}
catch
{
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:29,代码来源:JpPubHtml.cs
示例7: GetHits
public DataTable GetHits()
{
String sql = "Select * from JpHits order by hits_date desc";
DAO db = new DAO();
DataTable dt = db.GetDataTable(sql);
return dt;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:7,代码来源:JpHits.cs
示例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.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>");
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:26,代码来源:main_activity_sh.aspx.cs
示例9: 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>");
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:30,代码来源:list_activityusers.aspx.cs
示例10: DeleteAll
/// <summary>
/// ɾ�����
/// </summary>
/// <returns></returns>
public bool DeleteAll(string uids)
{
bool ret = true;
DAO db = new DAO();
try
{
String sql = "delete from JpStudents where @uid like '%,'+uid+',%'";
SqlParameter[] sqlparam = {
db.MakeInParam("@uid",SqlDbType.VarChar,uids),
};
db.Execute(sql, sqlparam);
}
catch
{
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:30,代码来源:JpStudents.cs
示例11: Delete
/// <summary>
/// ɾ��
/// </summary>
/// <returns></returns>
public bool Delete()
{
bool ret = true;
DAO db = new DAO();
try
{
string sql = "delete from JpTemplate where [email protected] ";
SqlParameter[] sqlparam = {
db.MakeInParam("@url",SqlDbType.VarChar,url),
};
db.Execute(sql, sqlparam);
}
catch
{
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:29,代码来源:JpTemplate.cs
示例12: Delete
/// <summary>
/// ɾ��
/// </summary>
/// <returns></returns>
public bool Delete()
{
bool ret = true;
DAO db = new DAO();
try
{
String sql = "delete from JpOpinionHF where [email protected] ";
SqlParameter[] sqlparam = {
db.MakeInParam("@id",SqlDbType.Int,id),
};
db.Execute(sql, sqlparam);
}
catch
{
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:29,代码来源:JpOpinionHF.cs
示例13: Insert
/// <summary>
/// ����
/// </summary>
/// <returns></returns>
public bool Insert()
{
bool ret = true;
DAO db = new DAO();
try
{
string sql = " insert into JpColumnsStyle(url,tclass,cid) values ";
sql += " (@url,@tclass,@cid) ";
SqlParameter[] sqlparam = {
db.MakeInParam("@url",SqlDbType.VarChar,url),
db.MakeInParam("@tclass",SqlDbType.VarChar,tclass),
db.MakeInParam("@cid",SqlDbType.VarChar,cid),
};
db.Execute(sql, sqlparam);
}
catch
{
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:32,代码来源:JpColumnsStyle.cs
示例14: 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>");
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:26,代码来源:main_help_sh.aspx.cs
示例15: Update
public bool Update()
{
bool ret = true;
DAO db = new DAO();
try
{
String sql = "UPDATE JpPubHtml SET [email protected],[email protected],[email protected] where [email protected]";
SqlParameter[] sqlparam = {
db.MakeInParam("@id",SqlDbType.VarChar,id),
db.MakeInParam("@pages",SqlDbType.VarChar,pages),
db.MakeInParam("@days",SqlDbType.VarChar,days),
db.MakeInParam("@status",SqlDbType.VarChar,status),
};
db.Execute(sql, sqlparam);
}
catch
{
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:27,代码来源:JpPubHtml.cs
示例16: Delete
/// <summary>
/// ɾ��
/// </summary>
/// <returns></returns>
public bool Delete()
{
bool ret = true;
DAO db = new DAO();
try
{
//��ɾ��ѡ��
String sql_option = "delete from hy_favorite where [email protected] ";
SqlParameter[] sqlparam_option = {
db.MakeInParam("@id",SqlDbType.Int,id),
};
db.Execute(sql_option, sqlparam_option);
}
catch
{
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:29,代码来源:JpFavorite.cs
示例17: DeleteImg
public bool DeleteImg(string id)
{
bool ret = true;
DAO db = new DAO();
try
{
string sql = "delete from hy_fileatt where [email protected] ";
SqlParameter[] sqlparam = new SqlParameter[]
{
db.MakeInParam("@id", SqlDbType.VarChar, id)
};
db.Execute(sql, sqlparam);
}
catch
{
ret = false;
}
finally
{
db.Close();
db.Dispose();
}
return ret;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:25,代码来源:HyFileatt.cs
示例18: JpSite
public JpSite()
{
String sql = "Select * from JpSite";
DAO db = new DAO();
DataTable dt = db.GetDataTable(sql);
if (dt.Rows.Count > 0)
{
SiteName = dt.Rows[0]["SiteName"].ToString();
CompName = dt.Rows[0]["CompName"].ToString();
host = dt.Rows[0]["host"].ToString();
root = dt.Rows[0]["root"].ToString();
tel = dt.Rows[0]["tel"].ToString();
fax = dt.Rows[0]["fax"].ToString();
adminemail = dt.Rows[0]["adminemail"].ToString();
bah = dt.Rows[0]["bah"].ToString();
seo_indextitle = dt.Rows[0]["seo_indextitle"].ToString();
seo_indexkeyword = dt.Rows[0]["seo_indexkeyword"].ToString();
seo_indexdescription = dt.Rows[0]["seo_indexdescription"].ToString();
copyright = dt.Rows[0]["copyright"].ToString();
homepage = dt.Rows[0]["homepage"].ToString();
visitors = System.Int32.Parse(dt.Rows[0]["visitors"].ToString());
dbname = dt.Rows[0]["dbname"].ToString();
version = dt.Rows[0]["version"].ToString();
nwyuming = dt.Rows[0]["nwyuming"].ToString();
wwyuming = dt.Rows[0]["wwyuming"].ToString();
lan_big5 = dt.Rows[0]["lan_big5"].ToString();
}
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:28,代码来源:JpSite.cs
示例19: Getdocs
public DataTable Getdocs()
{
String sql = " select * from HyQzwd ";
DAO db = new DAO();
DataTable dt = db.GetDataTable(sql);
db.Close();
return dt;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:8,代码来源:HyQzwd.cs
示例20: getActive
public DataTable getActive(int count)
{
string cmdStr = " Select top " + count + " * from hy_activity where hy_ifsh='2' and hy_starttime <=getdate() and hy_endtime >=getdate() order by hy_addtime desc , hy_sort desc ";
DAO db = new DAO();
DataTable dt = db.GetDataTable(cmdStr);
db.Close();
db.Dispose();
return dt;
}
开发者ID:wjszxli,项目名称:xdjb,代码行数:9,代码来源:JpActivity.cs
注:本文中的TPortalClass.DAO类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论