/// <summary>
    /// 商户搜索配置导航 添加信息
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button_SaveSH_Click(object sender, EventArgs e)
    {
        //查询表中是否有记录,有责update,无则添加
        string sql     = "select count(*) from [Business_Suosuo] where businessuid='" + Session["uid"].ToString() + "'";
        string records = DB.FindString(sql);

        // 添加
        if (Convert.ToInt32(records) == 0)
        {
            string[] huozhui = FileUpload_Image.FileName.Split('.');
            string   file    = GetGuid.Guid() + "." + huozhui[1];
            FileUpload_Image.SaveAs(Server.MapPath("../material") + "\\" + file);
            string addsql = "insert into [Business_Suosuo](Businessmc,Businessimg,Businessaddress,tel,jianjie,xianshiyouhui,businessuid) values('" + TextBox_Businessmc.Text.Trim() + "','" + file + "','" + TextBox_address.Text.Trim() + "','" + TextBox_tel.Text.Trim() + "','" + TextBox_jj.Text.Trim() + "','" + DropDownList_yh.Text + "','" + Session["uid"].ToString() + "')";
            DB.execnonsql(addsql);
            Response.AddHeader("Refresh", "0");
        }
        else// 编辑
        {
            if (FileUpload_Image.FileName != "")
            {
                string[] huozhui = FileUpload_Image.FileName.Split('.');
                string   file    = GetGuid.Guid() + "." + huozhui[1];
                FileUpload_Image.SaveAs(Server.MapPath("../material") + "\\" + file);
                string addsql = "update  [Business_Suosuo] set Businessmc='" + TextBox_Businessmc.Text.Trim() + "',Businessimg='" + file + "',Businessaddress='" + TextBox_address.Text.Trim() + "',tel='" + TextBox_tel.Text.Trim() + "',jianjie='" + TextBox_jj.Text.Trim() + "',xianshiyouhui='" + DropDownList_yh.Text + "'  where businessuid='" + Session["uid"].ToString() + "'";
                DB.execnonsql(addsql);
                Response.AddHeader("Refresh", "0");
            }
            else
            {
                string addsql = "update  [Business_Suosuo] set Businessmc='" + TextBox_Businessmc.Text.Trim() + "',Businessaddress='" + TextBox_address.Text.Trim() + "',tel='" + TextBox_tel.Text.Trim() + "',jianjie='" + TextBox_jj.Text.Trim() + "',xianshiyouhui='" + DropDownList_yh.Text + "'  where businessuid='" + Session["uid"].ToString() + "'";
                DB.execnonsql(addsql);
                Response.AddHeader("Refresh", "0");
            }
        }
    }
    protected void Button_submit_Click(object sender, EventArgs e)
    {
        //查询表中是否有记录,有责update,无则添加
        string sql     = "select count(*) from [Business_Index] where businessuid='" + Session["uid"].ToString() + "'";
        string records = DB.FindString(sql);

        // 添加
        if (Convert.ToInt32(records) == 0)
        {
            string[] huozhui = FileUpload_shouye.FileName.Split('.');
            string   file    = GetGuid.Guid() + "." + huozhui[1];
            FileUpload_shouye.SaveAs(Server.MapPath("../material") + "\\" + file);
            string[] huozhui1 = FileUpload_shijing.FileName.Split('.');
            string   file1    = GetGuid.Guid() + "." + huozhui1[1];
            FileUpload_shijing.SaveAs(Server.MapPath("../material") + "\\" + file1);
            string addsql = "insert into [Business_Index]([image],[bgimage],[jianjie],[zhuying],[biaoqian],[baiducodes],[shanghuneirong],[businessuid]) values('" + file + "','" + file1 + "','" + TextBox_jianjie.Text.Trim() + "','" + TextBox_zhuying.Text.Trim() + "','" + TextBox_biaoqian.Text.Trim() + "','" + TextBox_baidu.Text + "','" + CKEditorControl1.Text + "','" + Session["uid"].ToString() + "')";
            DB.execnonsql(addsql);
            Response.AddHeader("Refresh", "0");
        }
        else
        {
            if (FileUpload_shouye.FileName != "" && FileUpload_shijing.FileName != "")
            {
                string[] huozhui = FileUpload_shouye.FileName.Split('.');
                string   file    = GetGuid.Guid() + "." + huozhui[1];
                FileUpload_shouye.SaveAs(Server.MapPath("../material") + "\\" + file);
                string[] huozhui1 = FileUpload_shijing.FileName.Split('.');
                string   file1    = GetGuid.Guid() + "." + huozhui1[1];
                FileUpload_shijing.SaveAs(Server.MapPath("../material") + "\\" + file1);
                string addsql = "update [Business_Index] set [image]='" + file + "',[bgimage]='" + file1 + "',[jianjie]='" + TextBox_jianjie.Text.Trim().Replace("'", "") + "',[zhuying]='" + TextBox_zhuying.Text.Trim().Replace("'", "") + "',[biaoqian]='" + TextBox_biaoqian.Text.Trim().Replace("'", "") + "',[baiducodes]='" + TextBox_baidu.Text + "',[shanghuneirong]='" + CKEditorControl1.Text.Replace("'", "") + "' where [businessuid]='" + Session["uid"].ToString() + "'";
                DB.execnonsql(addsql);
                Response.AddHeader("Refresh", "0");
            }
            if (FileUpload_shijing.FileName == "" && FileUpload_shouye.FileName != "")
            {
                string[] huozhui = FileUpload_shouye.FileName.Split('.');
                string   file    = GetGuid.Guid() + "." + huozhui[1];
                FileUpload_shouye.SaveAs(Server.MapPath("../material") + "\\" + file);
                string addsql = "update [Business_Index] set [image]='" + file + "',[jianjie]='" + TextBox_jianjie.Text.Trim().Replace("'", "") + "',[zhuying]='" + TextBox_zhuying.Text.Trim().Replace("'", "") + "',[biaoqian]='" + TextBox_biaoqian.Text.Trim().Replace("'", "") + "',[baiducodes]='" + TextBox_baidu.Text + "',[shanghuneirong]='" + CKEditorControl1.Text.Replace("'", "") + "' where [businessuid]='" + Session["uid"].ToString() + "'";
                DB.execnonsql(addsql);
                Response.AddHeader("Refresh", "0");
            }
            if (FileUpload_shouye.FileName == "" && FileUpload_shijing.FileName != "")
            {
                string[] huozhui1 = FileUpload_shijing.FileName.Split('.');
                string   file1    = GetGuid.Guid() + "." + huozhui1[1];
                FileUpload_shijing.SaveAs(Server.MapPath("../material") + "\\" + file1);
                string addsql = "update [Business_Index] set [bgimage]='" + file1 + "',[jianjie]='" + TextBox_jianjie.Text.Trim().Replace("'", "") + "',[zhuying]='" + TextBox_zhuying.Text.Trim().Replace("'", "") + "',[biaoqian]='" + TextBox_biaoqian.Text.Trim().Replace("'", "") + "',[baiducodes]='" + TextBox_baidu.Text + "',[shanghuneirong]='" + CKEditorControl1.Text.Replace("'", "") + "' where [businessuid]='" + Session["uid"].ToString() + "'";
                DB.execnonsql(addsql);
                Response.AddHeader("Refresh", "0");
            }
            if (FileUpload_shouye.FileName == "" && FileUpload_shijing.FileName == "")
            {
                string addsql = "update [Business_Index] set [jianjie]='" + TextBox_jianjie.Text.Trim().Replace("'", "") + "',[zhuying]='" + TextBox_zhuying.Text.Trim().Replace("'", "") + "',[biaoqian]='" + TextBox_biaoqian.Text.Trim().Replace("'", "") + "',[baiducodes]='" + TextBox_baidu.Text + "',[shanghuneirong]='" + CKEditorControl1.Text.Replace("'", "") + "' where [businessuid]='" + Session["uid"].ToString() + "'";
                DB.execnonsql(addsql);
                Response.AddHeader("Refresh", "0");
            }
        }
    }
    /// <summary>
    /// 注册按钮的实现
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button1_Click(object sender, EventArgs e)
    {
        string bsql = "select count(*) from [Member_info] where Memberuid='" + TextBox1.Text.Trim() + "'";
        string flag = DB.FindString(bsql);

        if (Convert.ToInt32(flag) > 0)
        {
            MessageBox.Show(this, TextBox1.Text.Trim() + ",该商户名称已经存在.请使用其他名称");
            TextBox1.Focus();
            return;
        }
        else
        {
            if (CheckBox_xieyi.Checked)
            {
                //IpHelper.GetUserIp()
                string sql    = "insert into [Member_info](Memberuid,Memberpwd,Email,Mobile,IP,createtime,Memberid) values('" + TextBox1.Text.Trim() + "','" + TextBox2.Text.Trim() + "','" + TextBox3.Text.Trim() + "','" + TextBox4.Text.Trim() + "','" + IpHelper.GetUserIp() + "','" + DateTime.Now.ToString() + "','" + GetGuid.Guid() + "')";
                int    result = DbHelperOleDb.ExecuteSql(sql);
                if (result > 0)
                {
                    Session["Meber_uid"] = this.TextBox1.Text;
                    MessageBox.Show(this, "会员注册成功!");
                    Response.Redirect("../WebMember/Page_MemberInfo.aspx");
                }
            }
            else
            {
                MessageBox.Show(this, "您必须同意协议,才可以进行下一步.");
            }
        }
    }
    /// <summary>
    /// 商家申请注册,后台管理进行审核。
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button_submit_Click(object sender, EventArgs e)
    {
        string bsql = "select count(*) from [Business_Info] where Businessuid='" + TextBox_zhanghu.Text.Trim() + "'";
        string flag = DB.FindString(bsql);

        if (Convert.ToInt32(flag) > 0)
        {
            MessageBox.Show(this, TextBox_zhanghu.Text.Trim() + ",该商户名称已经存在.请使用其他名称");
            TextBox_zhanghu.Focus();
            return;
        }
        else
        {
            if (CheckBox_xieyi.Checked)
            {
                string youhui = "";
                if (RadioButton_true.Checked)
                {
                    youhui = "1";
                }
                else
                {
                    youhui = "0";
                }
                string shanghuleibie = "";
                for (int i = 0; i < RadioButtonList1.Items.Count; i++)
                {
                    if (RadioButtonList1.Items[i].Selected)
                    {
                        shanghuleibie = RadioButtonList1.Items[i].Value;
                    }
                }
                string sql    = "insert into [Business_Info](Businessid,Businessuid,Businesspwd,BusinessName,BusinessTel,Businessphone,BusinessGroup,BusinessAddress1,BusinessAddress2,BusinessYH,ip,createtime,shenhe) values('" + GetGuid.Guid() + "','" + TextBox_zhanghu.Text.Trim() + "','" + TextBox_mima.Text.Trim() + "','" + TextBox_shanghumingcheng.Text.Trim() + "','" + TextBox_dianhua.Text.Trim() + "','" + TextBox_shouji.Text.Trim() + "','" + shanghuleibie + "','" + DropDownList_dizhi.Text.Trim() + "','" + DropDownList2.Text.Trim() + "','" + youhui + "','" + IpHelper.GetUserIp() + "','" + DateTime.Now.ToString() + "','待审核')";
                int    result = DbHelperOleDb.ExecuteSql(sql);
                if (result > 0)
                {
                    MessageBox.Show(this, "商户注册成功!请您等待管理员进行审核.");

                    Response.Redirect("../Page_Main.aspx");
                }
            }
            else
            {
                MessageBox.Show(this, "您必须同意协议,才可以进行下一步.");
            }
        }
    }
Exemple #5
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string sql = "INSERT INTO Web_Pages(createtime,pageid,pagetitle,pagecontent) VALUES('" + DateTime.Now.ToString() + "','" + GetGuid.Guid() + "','" + TextBox1.Text.Trim() + "','" + CKEditor1.Text + "')";

        DB.execnonsql(sql);
    }