/// <summary> ///根据Sql语句返回集合 /// </summary> private IList <Tbl_Disk> getTbl_DisksBySql(string Sql) { IList <Tbl_Disk> list = new List <Tbl_Disk>(); DataSet ds = DBHelper.ExecuteDataset(this.connection, CommandType.Text, Sql); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { Tbl_Disk tbl_disk = new Tbl_Disk(); tbl_disk.ID = Convert.ToInt32(dr["ID"]); tbl_disk.D_Class = Convert.ToString(dr["D_Class"]); tbl_disk.D_Title = Convert.ToString(dr["D_Title"]); tbl_disk.D_File = Convert.ToString(dr["D_File"]); tbl_disk.Remark = Convert.ToString(dr["Remark"]); tbl_disk.DealUser = Convert.ToString(dr["DealUser"]); tbl_disk.DealFlag = Convert.ToInt32(dr["DealFlag"]); tbl_disk.DealTime = Convert.ToDateTime(dr["DealTime"]); tbl_disk.AddDate = Convert.ToDateTime(dr["AddDate"]); list.Add(tbl_disk); } } return(list); }
public int AddTbl_Disk(Tbl_Disk tbl_disk) { string Sql = "insert into [Tbl_Disk] ([D_Class],[D_Title],[D_File],[Remark],[DealUser],[DealFlag],[DealTime],[AddDate]) values (@D_Class,@D_Title,@D_File,@Remark,@DealUser,@DealFlag,@DealTime,@AddDate)"; SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@D_Class", tbl_disk.D_Class), new SqlParameter("@D_Title", tbl_disk.D_Title), new SqlParameter("@D_File", tbl_disk.D_File), new SqlParameter("@Remark", tbl_disk.Remark), new SqlParameter("@DealUser", tbl_disk.DealUser), new SqlParameter("@DealFlag", tbl_disk.DealFlag), new SqlParameter("@DealTime", tbl_disk.DealTime), new SqlParameter("@AddDate", tbl_disk.AddDate) }; return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, Sql, sp)); }
public int UpdateTbl_DiskById(Tbl_Disk tbl_disk) { string Sql = "update [Tbl_Disk] set [D_Class]=@D_Class,[D_Title]=@D_Title,[D_File]=@D_File,[Remark]=@Remark,[DealUser]=@DealUser,[DealFlag]=@DealFlag,[DealTime]=@DealTime,[AddDate]=@AddDate where [ID]=@ID"; SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@D_Class", tbl_disk.D_Class), new SqlParameter("@D_Title", tbl_disk.D_Title), new SqlParameter("@D_File", tbl_disk.D_File), new SqlParameter("@Remark", tbl_disk.Remark), new SqlParameter("@DealUser", tbl_disk.DealUser), new SqlParameter("@DealFlag", tbl_disk.DealFlag), new SqlParameter("@DealTime", tbl_disk.DealTime), new SqlParameter("@AddDate", tbl_disk.AddDate), new SqlParameter("@ID", tbl_disk.ID) }; return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, Sql, sp)); }
public static int UpdateTbl_Disk(Tbl_Disk tbl_disk) { WebCommon.Public.WriteLog("修改共享资源"); return(new Tbl_DiskService().UpdateTbl_DiskById(tbl_disk)); }
public static int AddTbl_Disk(Tbl_Disk tbl_disk) { WebCommon.Public.WriteLog("添加共享资源"); return(new Tbl_DiskService().AddTbl_Disk(tbl_disk)); }