modify.cs
资源名称:yjal.rar [点击查看]
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:2k
源码类别:
Email客户端
开发平台:
Visual C++
- /********************************************************************************
- ** 作者:ebDoing
- ** 创始时间: 2008-10-22
- ** 描述:
- ** 主要用于后台管理员修改商品信息,…
- ** 表:
- *********************************************************************************/
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Data.SqlClient;
- using System.Configuration;
- namespace background
- {
- public class modify
- {
- SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["TZroomConnectionString"].ConnectionString);
- /// <summary>
- /// 商品信息管理
- /// </summary>
- /// <param name="id">商品ID号码</param>
- /// <param name="name">商品名字</param>
- /// <param name="by">商品标语</param>
- /// <param name="sc">商品市场价格</param>
- /// <param name="hy">商品会员价格</param>
- /// <param name="ms">商品描述</param>
- /// <param name="zl">商品重量</param>
- /// <returns></returns>
- public bool modifyPro(String id, String name, String by, double sc, double hy, String ms, double zl) {
- String T_id=id;
- String T_name = name;
- String T_by = by;
- double T_sc = sc;
- double T_hy = hy;
- String T_ms = ms;
- double T_zl = zl;
- String sql = "update tb_GoodsInfo set GoodsName='" + T_name + "', GoodsWeight=" + T_zl + ", GoodsDescription='" + T_ms + "', caption='" + T_by + "', MarketPrice=" + T_sc + ", MemberPrice=" + T_hy + " where GoodsID='" + T_id + "'";
- SqlCommand cmd = new SqlCommand(sql, conn);
- int Resule = -1;
- try
- {
- conn.Open();
- Resule = cmd.ExecuteNonQuery();
- if (Resule != -1)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- catch (Exception ex)
- {
- throw (ex);
- }
- finally
- {
- conn.Close();
- }
- }
- }
- }