减振器电子商务网站毕业论文(编辑修改稿)内容摘要:

ct(ProductModels pro) { string sql =INSERT product(proname,projieshao,proimg, 数据访问层( DAL) 业务逻辑层( BLL) 北京化工大学毕业设计(论文) 16 prodate,leixing,gid,yongliao,jiegou,jiegoutext,jishu) +VALUES(@proname,@projieshao,@proimg,@prodate,@leixing,@gid,@yongliao,@jiegou,@jiegoutext,@jishu)。 sql += SELECT @@IDENTITY。 [7] try { SqlParameter[] para=new SqlParameter[] { new SqlParameter(@proname,), new SqlParameter(@projieshao,), new SqlParameter(@proimg,), new SqlParameter(@prodate,), new SqlParameter(@leixing,), new SqlParameter(@gid,), new SqlParameter(@yongliao,), new SqlParameter(@jiegou,), new SqlParameter(@jiegoutext,), new SqlParameter(@jishu,), }。 int proId = (sql, para)。 return GetProById(proId)。 } catch (Exception e) { ()。 throw e。 } } //按 id号删除记录 public void Delproduct(int id) { string sql = DELETE product WHERE id=@id。 try { SqlParameter[] para = new SqlParameter[] { new SqlParameter(@id, id)}。 北京化工大学毕业设计(论文) 17 (sql, para)。 } catch (Exception e) { ()。 throw e。 }} //按类型删除记录 public static void DelProCId(int leixing) { string sql = DELETE Product WHERE leixing=@leixing。 try { SqlParameter[] para = new SqlParameter[] { new SqlParameter(@leixing, leixing) }。 (sql, para)。 } catch (Exception e) { ()。 throw e。 } } //更从商品记录 public static void UpdatePro(ProductModels pro) { string sql = UPDATE product SET + proname=@proname, + projieshao=@projieshao, + proimg=@proimg, + prodate=@prodate, + leixing=@leixing, + gid=@gid, + 北京化工大学毕业设计(论文) 18 yongliao=@yongliao, + jiegou=@jiegou, + jiegoutext=@jiegoutext, + jishu=@jishu + WHERE id=@id。 try { SqlParameter[] para=new SqlParameter[][6] { new SqlParameter(@proname,), new SqlParameter(@projieshao,), new SqlParameter(@proimg,), new SqlParameter(@prodate,), new SqlParameter(@leixing,), new SqlParameter(@gid,), new SqlParameter(@yongliao,), new SqlParameter(@jiegou,), new SqlParameter(@jiegoutext,), new SqlParameter(@jishu,), new SqlParameter(@id,), }。 (sql, para)。 } catch (Exception e) { ()。 throw e。 } } //根据 id号查询商品记录 public static ProductModels GetProById(int id) 北京化工大学毕业设计(论文) 19 { string sql = SELECT * FROM product WHERE id=@id。 try { SqlDataReader reader = (sql, new SqlParameter(@id, id))。 if(()) { ProductModels pro=new ProductModels()。 = (int) reader[id]。 = (string) reader[proname]。 = (string) reader[jiegou]。 = (int) reader[leixing]。 = (DateTime) reader[prodate]。 = (string) reader[proimg]。 = (string) reader[projieshao]。 = (string) reader[yongliao]。 ()。 return pro。 } else { ()。 return null。 }} catch (Exception e) { ()。 throw e。 } } //查询同一类型的商品并存入 DataTable[6]中 public static IListProductModels GetAllPro(int leixing) { string sql = SELECT * FROM product,proclass WHERE leixing=cid AND leixing=39。 +leixing+39。 ORDER BY prodate desc。 return GetProBySql(sql)。 北京化工大学毕业设计(论文) 20 } public static IListProductModels GetProBySql(string safeSql) { ListProductModels list = new ListProductModels()。 try { DataTable table = (safeSql)。 foreach (DataRow row in ) { ProductModels pro = new ProductModels()。 = (int) row[id]。 = (string) row[proname]。 = (string) row[projieshao]。 = (string) row[proimg]。 = (DateTime) row[prodate]。 = (int) row[leixing]。 = (int) row[gid]。 = (string) row[yongliao]。 = (string) row[jiegou]。 = (string) row[jiegoutext]。 = (string) row[jishu]。 = (string) row[ame]。 (pro)。 } return list。 } catch (Exception e) { ()。 throw e。 } } }} 北京化工大学毕业设计(论文) 21 业务逻辑层 页面 using。 using TanganModels。 using TanganDAL。 namespace TanganBLL { public static partial class ProductBLL { public static ProductModels AddPro(ProductModels pro) { return (pro)。 } pub。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。