CSWDAL/DALImage.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CSWModel;
using System.Data;
using DBUtility;
namespace CSWDAL
{
public class DALImage
{
public static List<ModelImage> LoadInfo()
{
string strsql = "select * from csw_image where id=1";
ModelImage mimage = new ModelImage();
List<ModelImage> lt = new List<ModelImage>();
DataSet ds = new AcsHelper().ExecuteDataSet(strsql);
if (ds.Tables[0].Rows.Count > 0)
{
mimage.img1 = ds.Tables[0].Rows[0][1].ToString();
mimage.img1_title = ds.Tables[0].Rows[0][2].ToString();
mimage.img1_contents = ds.Tables[0].Rows[0][3].ToString();
mimage.img1_url = ds.Tables[0].Rows[0][4].ToString();
mimage.img2 = ds.Tables[0].Rows[0][5].ToString();
mimage.img2_title = ds.Tables[0].Rows[0][6].ToString();
mimage.img2_contents = ds.Tables[0].Rows[0][7].ToString();
mimage.img2_url = ds.Tables[0].Rows[0][8].ToString();
mimage.img3 = ds.Tables[0].Rows[0][9].ToString();
mimage.img3_title = ds.Tables[0].Rows[0][10].ToString();
mimage.img3_contents = ds.Tables[0].Rows[0][11].ToString();
mimage.img3_url = ds.Tables[0].Rows[0][12].ToString();
}
lt.Add(mimage);
return lt;
}
public static bool UpdateImage(ModelImage mimage)
{
StringBuilder strsql = new StringBuilder();
strsql.Append("update csw_image set img1='" + mimage.img1 + "',img1_url='"+mimage.img1_url+"',");
strsql.Append("img1_title='"+mimage.img1_title+"',img1_contents='"+mimage.img1_contents+"',");
strsql.Append("img2='" + mimage.img2 + "',img2_url='" + mimage.img2_url + "',img2_title='" + mimage.img2_title + "',img2_contents='" + mimage.img2_contents + "',");
strsql.Append("img3='" + mimage.img3 + "',img3_url='" + mimage.img3_url + "',img3_title='" + mimage.img3_title + "',img3_contents='" + mimage.img3_contents + "' ");
strsql.Append(" where id=1");
int reVaue = new AcsHelper().ExecuteNonQuery(strsql.ToString());
if (reVaue > 0)
{
return true;
}
else
{
return false;
}
}
}
后面还有 1 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
