Example #1
0
    /// <summary>
    /// 增加和修改
    /// </summary>
    protected void Bu_Click()
    {
        string Number = this.lblID.Text;

        if (string.IsNullOrEmpty(Number))
        {
            Number = Useid.Number("e_goods_cate", 8, "C");
        }
        string Grade = "0";

        if (this.DropDupid.SelectedValue != "0")
        {
            int F = 0;
            int.TryParse(LGrade.Text, out F);
            F     = F + 1;
            Grade = F.ToString();
        }
        string[] Text  = { "upid", "Grade" };
        string[] Value = { this.DropDupid.SelectedValue, Grade };
        if (!string.IsNullOrEmpty(this.lblID.Text))
        {
            if (UpdateClass.fromUpdate("e_goods_cate", "title|sitetitle|Keywords|Description", "CloseS|Reded|top", Text, Value, this.form1, " [Number]='" + this.lblID.Text + "'"))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("修改操作出错");
            }
        }
        else
        {
            int stat = config.Sort_max("select max(Stat) from [e_goods_cate] where [upid]='" + this.DropDupid.SelectedValue + "'");
            Text  = new string[] { "upid", "Number", "Stat", "Grade" };
            Value = new string[] { this.DropDupid.SelectedValue, Number, stat.ToString(), Grade };
            if (AddClass.fromAdd("e_goods_cate", "title|sitetitle|Keywords|Description", "CloseS|Reded|top", Text, Value, this.form1))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("添加操作出错");
            }
        }
    }
Example #2
0
    /// <summary>
    /// 增加和修改
    /// </summary>
    protected void Bu_Click()
    {
        string Number = this.lblID.Text;
        string Grade  = "0";

        if (this.DropDupid.SelectedValue != "0")
        {
            int F = 0;
            int.TryParse(LGrade.Text, out F);
            F     = F + 1;
            Grade = F.ToString();
        }
        string[] Text  = { "upid", "Grade" };
        string[] Value = { this.DropDupid.SelectedValue, Grade };
        if (string.IsNullOrEmpty(Number))
        {
            Number = Useid.Number("e_helplist", 4, "H");
        }
        if (!string.IsNullOrEmpty(this.lblID.Text))
        {
            if (UpdateClass.fromUpdate("e_helplist", "title", "CloseS", Text, Value, this.form1, " [Number]='" + this.lblID.Text + "'"))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("修改操作出错");
            }
        }
        else
        {
            string upid = this.DropDupid.SelectedValue;
            int    stat = config.Sort_max("select max(Stat) from [e_helplist] where upid='" + upid + "'");
            Text  = new string[] { "upid", "Grade", "Number", "Stat" };
            Value = new string[] { upid, Grade, Number, stat.ToString() };
            if (AddClass.fromAdd("e_helplist", "title", "CloseS", Text, Value, this.form1))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("添加操作出错");
            }
        }
    }
Example #3
0
    /// <summary>
    /// 写入分类数据
    /// </summary>
    private void addCate()
    {
        string[] title    = { "电脑配件", "手机配件", "数码影音", "家用电器", "办公打印", "网络产品", "外设产品", "服务产品" };
        string[] descript = { "CPU|主板|显卡|硬盘|SSD固态硬盘|内存|机箱|电源|显示器|刻录机/光驱|声卡/扩展卡|散热器",
                              "电池/移动电源|蓝牙耳机|充电器/数据线|手机耳机|贴膜|存储卡|保护套|车载iPhone配件|创意配件|便携/无线音箱|手机饰品",
                              "数码相机|单电/微单相机|单反相机|拍立得|运动相机|摄像机|镜头|户外器材|影棚器材|冲印服务|数码相框|耳机/耳麦|音箱/音响|麦克风|MP3/MP4",
                              "平板电视|空调|冰箱|洗衣机|家庭影院|DVD|迷你音响|电话机|热水器|电风扇|净化器|电压力锅|电饭锅|咖啡机",
                              "投影机|多功能一体机|打印机|传真设备|验钞/点钞机|扫描设备|复合机|碎纸机|考勤机|收款/POS机|会议音频视频",
                              "路由器|网卡|交换机|网络存储|4G/3G上网|网络盒子",
                              "鼠标|键盘|游戏设备|U盘移动硬盘|摄像头|线缆电玩|手写板|外置盒|UPS|插座",
                              "上门服务|远程服务|电脑软件" };
        string   num = string.Empty, upid = num;

        for (int i = 0; i < title.Length; i++)
        {
            num = Useid.Number("e_goods_cate", 8, "C");
            string[] key   = { "Number", "title", "Stat", "Grade" };
            string[] value = { num, title[i], i + 1 + "", "0" };
            if (!AddClass.fromAdd("e_goods_cate", key, value))
            {
                Write("写入数据失败!");
            }
        }

        for (int j = 0; j < descript.Length; j++)
        {
            string[] descriptArr = descript[j].Split('|');
            for (int n = 0; n < descriptArr.Length; n++)
            {
                num  = Useid.Number("e_goods_cate", 8, "C");
                upid = DBHelp.fr_string("select [Number] from [e_goods_cate] where [Stat] ='" + (j + 1) + "'");

                string[] key   = { "Number", "upid", "title", "Stat", "Grade" };
                string[] value = { num, upid, descriptArr[n], n + 1 + "", "1" };
                AddClass.fromAdd("e_goods_cate", key, value);
            }
        }

        Write("写入数据成功!");
    }