⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uppic.cs

📁 天织在线购物网站完整源码及文档 本网站是一套基于Web2.0思想设计、采用asp.net2.0开发的社区门户产品。它同时也是一套Web2.0全面解决方案
💻 CS
字号:
/********************************************************************************
** 作者:高亮
** 创始时间: 2007-12-22
** 描述:
**    主要用于后台管理员修改图片信息,…
** 表:
*********************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Data.SqlClient;
namespace background
{
    public class uppic
    {
        static String sql;
        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["TZroomConnectionString"].ConnectionString);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id">商品id号码</param>
        /// <param name="filename">要上传文件的名字</param>
        /// <param name="flag">上传文件对应的标记</param>
        /// <returns></returns>
        public bool uppicFile(String id,String filename,String flag) {
            String T_id = id;
            String T_name = filename;
            String T_flag = flag;
            switch (flag) { 
                case "linklogo":
                    sql = "update tb_GoodsInfo set GoodsLnkLogo='" + T_name + "'where GoodsID=" + T_id + "";
                    break;
                case "Brand":
                    sql = "update tb_GoodsInfo set GoodsBrand='" + T_name + "'where GoodsID=" + T_id + "";
                    break;
                case "Pic":
                    sql = "update tb_GoodsInfo set GoodsPic='" + T_name + "'where GoodsID=" + T_id + "";
                    break;
            }
            SqlCommand cmd = new SqlCommand(sql, conn);
            int Result = -1;
            try
            {
                conn.Open();
                Result = cmd.ExecuteNonQuery();
                if (Result != -1)
                {
                    return true;
                }
                else {
                    return false;
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally {
                conn.Close();
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -