Exemple #1
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values["pid"]);

        if (BLL.pagesManager.Delete(id) != 1)
        {
            AJAXManager.Alert(this.UpdatePanel1, "删除失败");
        }
        else
        {
            AJAXManager.Alert(this.UpdatePanel1, "删除成功");
            bind();
        }
    }
Exemple #2
0
    protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string state = e.CommandName;

        if (state == "state")
        {
            int id = Convert.ToInt32(GridView2.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["bgid"].ToString());
            if (id != 0)
            {
                basic_goods fx = BLL.basic_goodsManager.SearchByID(id);
                fx.bgstate = fx.bgstate == "1" ? "2" : "1";
                if (fx.bgstate == "2")
                {
                    //fx.bgdate = DateTime.Now;
                }
                if (BLL.basic_goodsManager.Update(fx) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    bind_goods();
                }
            }
        }
        else if (state == "iskey")
        {
            int id = Convert.ToInt32(GridView2.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["bgid"].ToString());
            if (id != 0)
            {
                basic_goods fx = BLL.basic_goodsManager.SearchByID(id);
                fx.bgkey = fx.bgkey == "1" ? "2" : "1";
                //fx.bgdate = DateTime.Now;
                if (BLL.basic_goodsManager.Update(fx) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    bind_goods();
                }
                //AJAXManager.Alert(UpdatePanel1, "test");
                //AJAXManager.Js(UpdatePanel1, "to_zhifubao('" + fx.fx_zhifubao + "','" + fx.fx_num + "')");
            }
        }
    }
Exemple #3
0
    protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string state = e.CommandName;

        if (state == "state")
        {
            int id = Convert.ToInt32(GridView3.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["fx_id"].ToString());
            if (id != 0)
            {
                fanxian fx = BLL.fanxianManager.SearchByfx_id(id);
                fx.fx_state = fx.fx_state == "1" ? "2" : (fx.fx_state == "2" ? "3" : "1");
                if (fx.fx_state == "2")
                {
                    fx.fx_date2 = DateTime.Now;
                }
                if (BLL.fanxianManager.Update(fx) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    bind_fanxian();
                }
            }
        }
        else if (state == "fanxian")
        {
            int id = Convert.ToInt32(GridView3.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["fx_id"].ToString());
            if (id != 0)
            {
                fanxian fx = BLL.fanxianManager.SearchByfx_id(id);
                fx.fx_state = "2";
                fx.fx_date2 = DateTime.Now;
                if (BLL.fanxianManager.Update(fx) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    bind_fanxian();
                }
                //AJAXManager.Alert(UpdatePanel1, "test");
                //AJAXManager.Js(UpdatePanel1, "to_zhifubao('" + fx.fx_zhifubao + "','" + fx.fx_num + "')");
            }
        }
    }
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TextBox txt_remark = GridView1.Rows[e.RowIndex].FindControl("txt_remark") as TextBox;

        int     id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values["aid"]);
        address sa = BLL.addressManager.SearchByaid(id);

        sa.aremark = txt_remark.Text.Trim();
        if (BLL.addressManager.Update(sa) != 1)
        {
            AJAXManager.Alert(this.UpdatePanel1, "修改失败");
        }
        else
        {
            GridView1.EditIndex = -1;
            bind();
        }
    }
 //重新排序
 protected void btn_sort_Click(object sender, EventArgs e)
 {
     try
     {
         IList <yh_corekeys> list = BLL.yh_corekeysManager.SearchAll();
         int num = 1;
         foreach (yh_corekeys ck in list)
         {
             ck.cksort = num.ToString();
             BLL.yh_corekeysManager.Update(ck);
             num++;
         }
         AJAXManager.Alert(this.UpdatePanel1, "排序成功");
         bind();
     }
     catch {
         AJAXManager.Alert(this.UpdatePanel1, "排序失败,请联系张建");
     }
 }
Exemple #6
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string cmd = e.CommandName;

        if (cmd == "state")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["aid"].ToString());
            if (id != 0)
            {
                Admins dp = BLL.AdminsManager.SearchByaid(id);
                dp.astate = dp.astate == "1" ? "2" : "1";
                if (BLL.AdminsManager.Update(dp) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    bind();
                }
            }
        }
        else if (cmd == "type")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["aid"].ToString());
            if (id != 0)
            {
                Admins dp = BLL.AdminsManager.SearchByaid(id);
                if (dp.atype != "3")
                {
                    dp.atype = dp.atype == "1" ? "2" : "1";
                    if (BLL.AdminsManager.Update(dp) != 1)
                    {
                        AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                    }
                    else
                    {
                        bind();
                    }
                }
            }
        }
    }
 //重新排序
 protected void btn_sort_Click(object sender, EventArgs e)
 {
     try
     {
         IList <huashu> list = BLL.huashuManager.SearchAll("");
         int            num  = 1;
         foreach (huashu dp in list)
         {
             dp.hsort = num;
             BLL.huashuManager.Update(dp);
             num++;
         }
         AJAXManager.Alert(UpdatePanel1, "排序成功");
     }
     catch
     {
         AJAXManager.Alert(UpdatePanel1, "排序失败,请联系张建");
     }
     bind();
 }
Exemple #8
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TextBox txt_account = GridView1.Rows[e.RowIndex].FindControl("txt_account") as TextBox;
        TextBox txt_count   = GridView1.Rows[e.RowIndex].FindControl("txt_count") as TextBox;

        int           id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values["nid"]);
        shuadan_names sa = BLL.shuadan_namesManager.SearchBynid(id);

        sa.nname  = txt_account.Text.Trim();
        sa.ncount = txt_count.Text.Trim();
        if (BLL.shuadan_namesManager.Update(sa) != 1)
        {
            AJAXManager.Alert(this.UpdatePanel1, "修改失败");
        }
        else
        {
            GridView1.EditIndex = -1;
            bind();
        }
    }
Exemple #9
0
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (AJAXManager.GridView_ondblclick(e))
        {
            try
            {
                string     State    = GridView1.DataKeys[e.Row.RowIndex].Values["astate"].ToString();
                LinkButton lb_state = e.Row.FindControl("lb_state") as LinkButton;
                string     _type    = GridView1.DataKeys[e.Row.RowIndex].Values["atype"].ToString();
                LinkButton lb_type  = e.Row.FindControl("lb_type") as LinkButton;

                if (State == "1")
                {
                    lb_state.Text      = "启用";
                    lb_state.ForeColor = System.Drawing.Color.Blue;
                }
                else if (State == "2")
                {
                    lb_state.Text      = "禁用";
                    lb_state.ForeColor = System.Drawing.Color.Red;
                }

                if (_type == "1")
                {
                    lb_type.Text      = "员工";
                    lb_type.ForeColor = System.Drawing.Color.Blue;
                }
                else if (_type == "2")
                {
                    lb_type.Text      = "主管";
                    lb_type.ForeColor = System.Drawing.Color.Green;
                }
                else if (_type == "3")
                {
                    lb_type.Text      = "经理";
                    lb_type.ForeColor = System.Drawing.Color.Red;
                }
            }
            catch (Exception ex) { Common.ErrorLog.WriteEntry(ex); }
        }
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string state = e.CommandName;

        if (state == "state")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["orid"].ToString());
            if (id != 0)
            {
                basic_order_record sh = BLL.basic_order_recordManager.SearchByID(id);
                sh.orprepare1 = (sh.orprepare1 == "1" ? "2" : "1");
                if (BLL.basic_order_recordManager.Update(sh) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    GridView1.EditIndex = -1;
                    bind();
                }
            }
        }
        else if (state == "maijiaxiu")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["orid"].ToString());
            if (id != 0)
            {
                basic_order_record sh = BLL.basic_order_recordManager.SearchByID(id);
                sh.ormaijiaxiu = (sh.ormaijiaxiu == "1" ? "2" : "1");
                if (BLL.basic_order_recordManager.Update(sh) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    GridView1.EditIndex = -1;
                    bind();
                }
            }
        }
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string state = e.CommandName;

        if (state == "state")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["spid"].ToString());
            if (id != 0)
            {
                shuadan_pingjia sa = BLL.shuadan_pingjiaManager.SearchByspid(id);
                sa.spstate = sa.spstate == "1" ? "2" : "1";
                if (BLL.shuadan_pingjiaManager.Update(sa) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    GridView1.EditIndex = -1;
                    bind();
                }
            }
        }
        else if (state == "type")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["spid"].ToString());
            if (id != 0)
            {
                shuadan_pingjia sa = BLL.shuadan_pingjiaManager.SearchByspid(id);
                sa.sptype = sa.sptype == "1" ? "2" : (sa.sptype == "2" ? "3" : "1");
                if (BLL.shuadan_pingjiaManager.Update(sa) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    GridView1.EditIndex = -1;
                    bind();
                }
            }
        }
    }
Exemple #12
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TextBox txt_name = GridView1.Rows[e.RowIndex].FindControl("txt_name") as TextBox;
        TextBox txt_sort = GridView1.Rows[e.RowIndex].FindControl("txt_sort") as TextBox;

        int   id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values["pid"]);
        pages dp = BLL.pagesManager.SearchByID(id);

        dp.pname = string.IsNullOrEmpty(txt_name.Text) ? "" : txt_name.Text.Trim();
        dp.psort = string.IsNullOrEmpty(txt_sort.Text) ? 0 : Convert.ToInt32(txt_sort.Text.Trim());

        if (BLL.pagesManager.Update(dp) != 1)
        {
            AJAXManager.Alert(this.UpdatePanel1, "修改失败");
        }
        else
        {
            GridView1.EditIndex = -1;
            bind();
        }
    }
Exemple #13
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TextBox txt_account = GridView1.Rows[e.RowIndex].FindControl("txt_account") as TextBox;
        TextBox txt_pwd     = GridView1.Rows[e.RowIndex].FindControl("txt_pwd") as TextBox;

        int    id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values["aid"]);
        Admins dp = BLL.AdminsManager.SearchByaid(id);

        dp.aaccount  = string.IsNullOrEmpty(txt_account.Text) ? "" : txt_account.Text.Trim();
        dp.apassword = string.IsNullOrEmpty(txt_pwd.Text) ? "" : txt_pwd.Text.Trim();

        if (BLL.AdminsManager.Update(dp) != 1)
        {
            AJAXManager.Alert(this.UpdatePanel1, "修改失败");
        }
        else
        {
            GridView1.EditIndex = -1;
            bind();
        }
    }
Exemple #14
0
 //重新排序
 protected void btn_sort_Click(object sender, EventArgs e)
 {
     //System.Threading.Thread.Sleep(1000);
     try
     {
         IList <pages> list = BLL.pagesManager.SearchAll();
         int           num  = 1;
         foreach (pages dp in list)
         {
             dp.psort = num;
             BLL.pagesManager.Update(dp);
             num++;
         }
         AJAXManager.Alert(UpdatePanel1, "排序成功");
     }
     catch
     {
         AJAXManager.Alert(UpdatePanel1, "排序失败,请联系张建");
     }
     bind();
 }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string state = e.CommandName;

        if (state == "state")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["hid"].ToString());
            if (id != 0)
            {
                huashu dp = BLL.huashuManager.SearchByID(id);
                dp.hstate = dp.hstate == "1" ? "2" : "1";
                if (BLL.huashuManager.Update(dp) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    bind();
                }
            }
        }
    }
Exemple #16
0
    protected void GridView4_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TextBox    txt_name   = GridView4.Rows[e.RowIndex].FindControl("txt_name") as TextBox;
        TextBox    txt_remark = GridView4.Rows[e.RowIndex].FindControl("txt_remark") as TextBox;
        int        id         = Convert.ToInt32(GridView4.DataKeys[e.RowIndex].Values["btid"]);
        basic_task sh         = basic_taskManager.SearchByID(id);

        sh.btname    = txt_name.Text.Trim();
        sh.btcontent = txt_remark.Text.Trim();



        if (BLL.basic_taskManager.Update(sh) != 1)
        {
            AJAXManager.Alert(this.UpdatePanel1, "修改失败");
        }
        else
        {
            GridView4.EditIndex = -1;
            bind_task();
        }
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string state = e.CommandName;

        if (state == "state")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["ckid"].ToString());
            if (id != 0)
            {
                yh_corekeys ck = BLL.yh_corekeysManager.SearchByckid(id);
                ck.ckstate = ck.ckstate == "1" ? "2" : "1";
                if (BLL.yh_corekeysManager.Update(ck) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    GridView1.EditIndex = -1;
                    bind();
                }
            }
        }
    }
Exemple #18
0
    protected void GridView4_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string state = e.CommandName;

        if (state == "state")
        {
            int id = Convert.ToInt32(GridView4.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["btid"].ToString());
            if (id != 0)
            {
                basic_task sh = BLL.basic_taskManager.SearchByID(id);
                sh.btstate = (sh.btstate == "1" ? "2" : "1");
                if (BLL.basic_taskManager.Update(sh) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    GridView4.EditIndex = -1;
                    bind_task();
                }
            }
        }
    }
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TextBox txt_name   = GridView1.Rows[e.RowIndex].FindControl("txt_name") as TextBox;
        TextBox txt_remark = GridView1.Rows[e.RowIndex].FindControl("txt_remark") as TextBox;
        TextBox txt_sort   = GridView1.Rows[e.RowIndex].FindControl("txt_sort") as TextBox;

        int         id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values["ckid"]);
        yh_corekeys ck = BLL.yh_corekeysManager.SearchByckid(id);

        ck.ckname   = string.IsNullOrEmpty(txt_name.Text) ? "" : txt_name.Text.Trim();
        ck.ckremark = string.IsNullOrEmpty(txt_name.Text) ? "" : txt_remark.Text.Trim();
        ck.cksort   = string.IsNullOrEmpty(txt_sort.Text) ? "" : txt_sort.Text.Trim();

        if (BLL.yh_corekeysManager.Update(ck) != 1)
        {
            AJAXManager.Alert(this.UpdatePanel1, "修改失败");
        }
        else
        {
            GridView1.EditIndex = -1;
            bind();
        }
    }
Exemple #20
0
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (AJAXManager.GridView_ondblclick(e))
        {
            try
            {
                string sdastate = GridView1.DataKeys[e.Row.RowIndex].Values["sdastate"].ToString();
                //string sdastate_phone = GridView1.DataKeys[e.Row.RowIndex].Values["sdastate_phone"].ToString();
                LinkButton lb_state = e.Row.FindControl("lb_state") as LinkButton;
                //LinkButton lb_state_phone = e.Row.FindControl("lb_state_phone") as LinkButton;



                if (sdastate == "0")
                {
                    lb_state.Text      = "未使用";
                    lb_state.ForeColor = System.Drawing.Color.Blue;
                }
                else if (sdastate == "1")
                {
                    lb_state.Text      = "已使用";
                    lb_state.ForeColor = System.Drawing.Color.Red;
                }
                //if (sdastate_phone == "0")
                //{
                //    lb_state_phone.Text = "未使用";
                //    lb_state_phone.ForeColor = System.Drawing.Color.Blue;
                //}
                //else if (sdastate_phone == "1")
                //{
                //    lb_state_phone.Text = "已使用";
                //    lb_state_phone.ForeColor = System.Drawing.Color.Red;
                //}
            }
            catch (Exception ex) { Common.ErrorLog.WriteEntry(ex); }
        }
    }
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (AJAXManager.GridView_ondblclick(e))
        {
            try
            {
                string     State    = GridView1.DataKeys[e.Row.RowIndex].Values["ckstate"].ToString();
                string     gtid     = GridView1.DataKeys[e.Row.RowIndex].Values["gtid"].ToString();
                LinkButton lb_state = e.Row.FindControl("lb_state") as LinkButton;

                Label lbl_goodstype = e.Row.FindControl("lbl_goodstype") as Label;

                if (State == "1")
                {
                    lb_state.Text      = "启用";
                    lb_state.ForeColor = System.Drawing.Color.Blue;
                }
                else if (State == "2")
                {
                    lb_state.Text      = "禁用";
                    lb_state.ForeColor = System.Drawing.Color.Red;
                }

                IList <yh_goodstype> list = BLL.yh_goodstypeManager.GetList(true);
                foreach (yh_goodstype g in list)
                {
                    if (g.gtid.ToString() == gtid)
                    {
                        lbl_goodstype.Text      = g.gtanme;
                        lbl_goodstype.ForeColor = System.Drawing.Color.Green;
                        break;
                    }
                }
            }
            catch (Exception ex) { Common.ErrorLog.WriteEntry(ex); }
        }
    }
Exemple #22
0
    protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TextBox txt_name   = GridView2.Rows[e.RowIndex].FindControl("txt_name") as TextBox;
        TextBox txt_update = GridView2.Rows[e.RowIndex].FindControl("txt_update") as TextBox;
        TextBox txt_remark = GridView2.Rows[e.RowIndex].FindControl("txt_remark") as TextBox;

        int         id = Convert.ToInt32(GridView2.DataKeys[e.RowIndex].Values["bgid"]);
        basic_goods fx = BLL.basic_goodsManager.SearchByID(id);

        if (string.IsNullOrEmpty(txt_name.Text))
        {
            AJAXManager.Alert(this.UpdatePanel1, "请输入商品名称");
            return;
        }
        DateTime _dt = new DateTime();

        if (!DateTime.TryParse(txt_update.Text, out _dt))
        {
            AJAXManager.Alert(this.UpdatePanel1, "请输入正确的上架时间");
            return;
        }

        fx.bgname   = txt_name.Text.Trim();
        fx.bgupdate = _dt;
        fx.bgremark = txt_remark.Text.Trim();
        //fx.bgdate = DateTime.Now;

        if (BLL.basic_goodsManager.Update(fx) != 1)
        {
            AJAXManager.Alert(this.UpdatePanel1, "修改失败");
        }
        else
        {
            GridView2.EditIndex = -1;
            bind_goods();
        }
    }
Exemple #23
0
    protected void GridView3_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        //try
        //{
        if (AJAXManager.GridView_ondblclick(e))
        {
            try
            {
                string     State      = GridView3.DataKeys[e.Row.RowIndex].Values["fx_state"].ToString();
                string     dianpu     = GridView3.DataKeys[e.Row.RowIndex].Values["dpid"].ToString();
                string     fxid       = GridView3.DataKeys[e.Row.RowIndex].Values["fx_id"].ToString();
                string     price      = GridView3.DataKeys[e.Row.RowIndex].Values["fx_num"].ToString();
                LinkButton lb_state   = e.Row.FindControl("lb_state") as LinkButton;
                Label      lbl_dianpu = e.Row.FindControl("lbl_dianpu") as Label;


                if (State == "1")
                {
                    lb_state.Text      = "未返现";
                    lb_state.ForeColor = System.Drawing.Color.Blue;
                }
                else if (State == "2")
                {
                    lb_state.Text      = "已处理";
                    lb_state.ForeColor = System.Drawing.Color.Green;
                }
                else if (State == "3")
                {
                    lb_state.Text      = "有问题";
                    lb_state.ForeColor = System.Drawing.Color.Red;
                }
                IList <dianpu> list = BLL.dianpuManager.GetList(false);
                foreach (dianpu dp in list)
                {
                    if (dp.dpid.ToString() == dianpu)
                    {
                        lbl_dianpu.Text      = dp.dpname;
                        lbl_dianpu.ForeColor = System.Drawing.Color.Green;
                        //if (dp.dpremark.IndexOf("淘宝") > 0)
                        //{
                        //    lb_account.NavigateUrl = "http://www.taobao.com/webww/ww.php?ver=3&touid=" + lb_account.Text + "&siteid=cntaobao&status=1&charset=utf-8";
                        //    lb_account.ForeColor = System.Drawing.Color.Blue;
                        //}
                        break;
                    }
                }

                //判断是否是编辑状态
                if (GridView3.EditIndex != e.Row.RowIndex)
                {
                    //Label lbl_zhifubao = e.Row.FindControl("lbl_zhifubao") as Label;
                    LinkButton lb_zhifubao = e.Row.FindControl("lb_zhifubao") as LinkButton;

                    HyperLink lb_account = e.Row.FindControl("lb_account") as HyperLink;
                    lb_account.NavigateUrl = "http://www.taobao.com/webww/ww.php?ver=3&touid=" + lb_account.Text + "&siteid=cntaobao&status=1&charset=utf-8";
                    lb_account.ForeColor   = System.Drawing.Color.Blue;

                    //支付宝打款
                    try
                    {
                        object obj = GridView3.DataKeys[e.Row.RowIndex].Values["fx_zhifubao"];
                        if (obj != null)
                        {
                            string zhifubao = obj.ToString();
                            if (!string.IsNullOrEmpty(zhifubao) && !string.IsNullOrEmpty(price))
                            {
                                //判断返现次数
                                int n = BLL.fanxianManager.SearchNum(zhifubao, "", 0, new DateTime(), new DateTime(), new DateTime(), new DateTime());
                                lb_zhifubao.ForeColor = System.Drawing.Color.Red;
                                if (n > 1)
                                {
                                    lb_zhifubao.ForeColor = System.Drawing.Color.Silver;
                                    lb_zhifubao.Font.Bold = true;
                                    lb_zhifubao.ToolTip   = "该支付宝已经返现" + n.ToString() + "次,请留意!";
                                }

                                //添加返现功能
                                string js = n > 1 ? "alert('该用户已经返现" + n.ToString() + "次,确定要继续返现么?');to_zhifubao('" + zhifubao + "','" + price + "');" : "to_zhifubao('" + zhifubao + "','" + price + "');";
                                lb_zhifubao.Attributes["onclick"] = js;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Common.ErrorLog.WriteEntry(ex);
                    }
                }
            }
            catch (Exception ex)
            {
                Common.ErrorLog.WriteEntry(ex);
            }
        }
    }
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (AJAXManager.GridView_ondblclick(e))
        {
            try
            {
                string State  = GridView1.DataKeys[e.Row.RowIndex].Values["orprepare1"].ToString();
                string dianpu = GridView1.DataKeys[e.Row.RowIndex].Values["dpid"].ToString();
                //string orid = GridView1.DataKeys[e.Row.RowIndex].Values["orid"].ToString();
                //string bgid = GridView1.DataKeys[e.Row.RowIndex].Values["bgid"].ToString();
                string ormaijiaxiu = GridView1.DataKeys[e.Row.RowIndex].Values["ormaijiaxiu"].ToString();
                //string orqq = GridView1.DataKeys[e.Row.RowIndex].Values["orqq"].ToString();
                //string orwangwang = GridView1.DataKeys[e.Row.RowIndex].Values["orwangwang"].ToString();


                LinkButton lb_state     = e.Row.FindControl("lb_state") as LinkButton;
                LinkButton lb_maijiaxiu = e.Row.FindControl("lb_maijiaxiu") as LinkButton;
                Label      lbl_dianpu   = e.Row.FindControl("lbl_dianpu") as Label;

                //状态
                if (State == "1")
                {
                    lb_state.Text      = "已评价";
                    lb_state.ForeColor = System.Drawing.Color.Blue;
                }
                else if (State == "2")
                {
                    lb_state.Text      = "未评价";
                    lb_state.ForeColor = System.Drawing.Color.Red;
                    lb_state.Font.Bold = true;
                }
                //买家秀
                if (ormaijiaxiu == "1")
                {
                    lb_maijiaxiu.Text      = "是";
                    lb_maijiaxiu.ForeColor = System.Drawing.Color.Red;
                    lb_maijiaxiu.Font.Bold = true;
                }
                else if (ormaijiaxiu == "2")
                {
                    lb_maijiaxiu.Text      = "否";
                    lb_maijiaxiu.ForeColor = System.Drawing.Color.Blue;
                }

                //店铺
                dianpu dp = dianpuManager.GetInList(dianpu);
                if (dp != null)
                {
                    lbl_dianpu.Text      = dp.dpname;
                    lbl_dianpu.ForeColor = System.Drawing.Color.Green;
                }


                //判断是否是编辑状态
                if (GridView1.EditIndex != e.Row.RowIndex)
                {
                    HyperLink lb_wangwang = e.Row.FindControl("lb_wangwang") as HyperLink;
                    lb_wangwang.NavigateUrl = "http://www.taobao.com/webww/ww.php?ver=3&touid=" + lb_wangwang.Text + "&siteid=cntaobao&status=1&charset=utf-8";
                    lb_wangwang.ForeColor   = System.Drawing.Color.Blue;
                    HyperLink lb_qq = e.Row.FindControl("lb_qq") as HyperLink;
                    lb_qq.NavigateUrl = "tencent://message/?uin=" + lb_qq.Text + "&Site=我的网站&Menu=yes";
                    lb_qq.ForeColor   = System.Drawing.Color.Blue;
                }
            }
            catch (Exception ex) { Common.ErrorLog.WriteEntry(ex); }
        }
    }
Exemple #25
0
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        //try
        //{
        if (AJAXManager.GridView_ondblclick(e))
        {
            object obj_gimg      = GridView1.DataKeys[e.Row.RowIndex].Values["gimg"];
            object obj_gimg2     = GridView1.DataKeys[e.Row.RowIndex].Values["gimg2"];
            object obj_gurl      = GridView1.DataKeys[e.Row.RowIndex].Values["gurl"];
            object obj_gurl2     = GridView1.DataKeys[e.Row.RowIndex].Values["gurl2"];
            object obj_gprice1   = GridView1.DataKeys[e.Row.RowIndex].Values["gprice1"];
            object obj_gprice2   = GridView1.DataKeys[e.Row.RowIndex].Values["gprice2"];
            object obj_gurl_yuan = GridView1.DataKeys[e.Row.RowIndex].Values["gurl_yuan"];

            string gimg      = obj_gimg == null ? "" : obj_gimg.ToString();
            string gimg2     = obj_gimg2 == null ? "" : obj_gimg2.ToString();
            string gurl      = obj_gurl == null ? "" : obj_gurl.ToString();
            string gurl2     = obj_gurl2 == null ? "" : obj_gurl2.ToString();
            string gprice1   = obj_gprice1 == null ? "" : obj_gprice1.ToString();
            string gprice2   = obj_gprice2 == null ? "" : obj_gprice2.ToString();
            string gurl_yuan = obj_gurl_yuan == null ? "" : obj_gurl_yuan.ToString();


            HyperLink hl_state_img_tb  = e.Row.FindControl("hl_state_img_tb") as HyperLink;
            HyperLink hl_state_img_mgj = e.Row.FindControl("hl_state_img_mgj") as HyperLink;
            HyperLink hl_price_tb      = e.Row.FindControl("hl_price_tb") as HyperLink;
            HyperLink hl_price_mgj     = e.Row.FindControl("hl_price_mgj") as HyperLink;
            HyperLink hl_url_yuan      = e.Row.FindControl("hl_url_yuan") as HyperLink;

            if (!string.IsNullOrEmpty(gimg))
            {
                hl_state_img_tb.Text        = "有图";
                hl_state_img_tb.NavigateUrl = "~/OA/upload/" + gimg;
                hl_state_img_tb.ForeColor   = System.Drawing.Color.Blue;
            }
            if (!string.IsNullOrEmpty(gimg2))
            {
                hl_state_img_mgj.Text        = "有图";
                hl_state_img_mgj.NavigateUrl = "~/OA/upload/" + gimg2;
                hl_state_img_mgj.ForeColor   = System.Drawing.Color.Blue;
            }



            object     obj_gstate1        = GridView1.DataKeys[e.Row.RowIndex].Values["gstate1"];
            object     obj_gstate2        = GridView1.DataKeys[e.Row.RowIndex].Values["gstate2"];
            object     obj_gstate3        = GridView1.DataKeys[e.Row.RowIndex].Values["gstate3"];
            object     obj_important      = GridView1.DataKeys[e.Row.RowIndex].Values["g_standby1"];
            string     gstate1            = obj_gstate1 == null ? "" : obj_gstate1.ToString();
            string     gstate2            = obj_gstate2 == null ? "" : obj_gstate2.ToString();
            string     gstate3            = obj_gstate3 == null ? "" : obj_gstate3.ToString();
            string     gstate_important   = obj_important == null ? "" : obj_important.ToString();
            LinkButton lb_state_up        = e.Row.FindControl("lb_state_up") as LinkButton;
            LinkButton lb_state_img       = e.Row.FindControl("lb_state_img") as LinkButton;
            LinkButton lb_state_yh        = e.Row.FindControl("lb_state_yh") as LinkButton;
            LinkButton lb_state_important = e.Row.FindControl("lb_state_important") as LinkButton;
            //判断是否是编辑状态
            if (GridView1.EditIndex != e.Row.RowIndex)
            {
                hl_price_tb.Text = string.IsNullOrEmpty(gprice1) ? "暂无" : gprice1;
                if (!string.IsNullOrEmpty(gurl))
                {
                    hl_price_tb.NavigateUrl = Manager.AddString_Http(gurl);
                    hl_price_tb.ForeColor   = System.Drawing.Color.Blue;
                }
                hl_price_mgj.Text = string.IsNullOrEmpty(gprice2) ? "暂无" : gprice2;
                if (!string.IsNullOrEmpty(gurl2))
                {
                    hl_price_mgj.NavigateUrl = Manager.AddString_Http(gurl2);
                    hl_price_mgj.ForeColor   = System.Drawing.Color.Blue;
                }
                hl_url_yuan.Text = string.IsNullOrEmpty(gurl_yuan) ? "暂无" : "点击可查看";
                if (!string.IsNullOrEmpty(gurl_yuan))
                {
                    hl_url_yuan.NavigateUrl = Manager.AddString_Http(gurl_yuan);
                    hl_url_yuan.ForeColor   = System.Drawing.Color.Blue;
                }
            }
            try
            {
                if (gstate1 == "1")
                {
                    lb_state_img.Text      = "未上传";
                    lb_state_img.ForeColor = System.Drawing.Color.Red;
                }
                else if (gstate1 == "2")
                {
                    lb_state_img.Text      = "已上传";
                    lb_state_img.ForeColor = System.Drawing.Color.Green;
                }

                if (gstate2 == "1")
                {
                    lb_state_up.Text      = "未上架";
                    lb_state_up.ForeColor = System.Drawing.Color.Red;
                }
                else if (gstate2 == "2")
                {
                    lb_state_up.Text      = "已上架";
                    lb_state_up.ForeColor = System.Drawing.Color.Green;
                }

                if (gstate3 == "1")
                {
                    lb_state_yh.Text      = "未优化";
                    lb_state_yh.ForeColor = System.Drawing.Color.Red;
                }
                else if (gstate3 == "2")
                {
                    lb_state_yh.Text      = "已优化";
                    lb_state_yh.ForeColor = System.Drawing.Color.Green;
                }
                if (gstate_important == "2")
                {
                    lb_state_important.Text      = "是";
                    lb_state_important.ForeColor = System.Drawing.Color.Red;
                }
                else
                {
                    lb_state_important.Text      = "否";
                    lb_state_important.ForeColor = System.Drawing.Color.Green;
                }
            }
            catch (Exception ex)
            {
                Common.ErrorLog.WriteEntry(ex);
            }
        }
        //}
        //catch (Exception ex)
        //{
        //    Common.ErrorLog.WriteEntry(ex);
        //}
    }
Exemple #26
0
    protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        //try
        //{
        if (AJAXManager.GridView_ondblclick(e))
        {
            try
            {
                string   State    = GridView2.DataKeys[e.Row.RowIndex].Values["bgstate"].ToString();
                string   dpid     = GridView2.DataKeys[e.Row.RowIndex].Values["dpid"].ToString();
                string   bgid     = GridView2.DataKeys[e.Row.RowIndex].Values["bgid"].ToString();
                string   hdid     = GridView2.DataKeys[e.Row.RowIndex].Values["hdid"].ToString();
                string   bgkey    = GridView2.DataKeys[e.Row.RowIndex].Values["bgkey"].ToString();
                string   opid     = GridView2.DataKeys[e.Row.RowIndex].Values["opid"].ToString();
                string   bgupdate = GridView2.DataKeys[e.Row.RowIndex].Values["bgupdate"].ToString();
                DateTime up_date  = new DateTime();
                DateTime.TryParse(bgupdate, out up_date);

                LinkButton lb_state    = e.Row.FindControl("lb_state") as LinkButton;
                LinkButton lb_key      = e.Row.FindControl("lb_key") as LinkButton;
                Label      lbl_dianpu  = e.Row.FindControl("lbl_dianpu") as Label;
                Label      lbl_order   = e.Row.FindControl("lbl_order") as Label;
                Label      lbl_huodong = e.Row.FindControl("lbl_huodong") as Label;


                //补单
                int temp_order   = basic_order_planManager.GetNumInPlan(up_date, Convert.ToInt32(opid));
                int _order_count = BLL.basic_order_recordManager.SearchNum("", Convert.ToInt32(bgid), 0, 0, "", "", DateTime.Now, DateTime.Now);
                int res_count    = temp_order - _order_count;
                if (res_count > 0)
                {
                    lbl_order.Text      = "需补 " + (temp_order - _order_count).ToString() + " 单";
                    lbl_order.ForeColor = System.Drawing.Color.Red;
                    lbl_order.Font.Bold = true;
                }
                else
                {
                    lbl_order.Text      = "无";
                    lbl_order.ForeColor = System.Drawing.Color.Black;
                }

                //活动提示
                basic_huodong hd           = basic_huodongManager.SearchByID(Convert.ToInt32(hdid));
                int           temp_huodong = Manager.DateDiff_GetInt(DateTime.Now, up_date) + 1;
                if (temp_huodong == hd.hdone || temp_huodong == hd.hdtwo)
                {
                    lbl_huodong.Text      = "今日" + hd.hddate1.ToString("HH:mm") + "报名";
                    lbl_huodong.ForeColor = System.Drawing.Color.Red;
                    lbl_huodong.Font.Bold = true;
                }
                else
                {
                    lbl_huodong.Text      = "无";
                    lbl_huodong.ForeColor = System.Drawing.Color.Black;
                }


                //状态
                if (State == "1")
                {
                    lb_state.Text      = "启用";
                    lb_state.ForeColor = System.Drawing.Color.Red;
                    //lb_state.Font.Bold = true;
                }
                else if (State == "2")
                {
                    lb_state.Text      = "禁用";
                    lb_state.ForeColor = System.Drawing.Color.Blue;
                }

                //是否重点
                if (bgkey == "1")
                {
                    lb_key.Text      = "是";
                    lb_key.ForeColor = System.Drawing.Color.Red;
                    lb_key.Font.Bold = true;
                }
                else if (bgkey == "2")
                {
                    lb_key.Text      = "否";
                    lb_key.ForeColor = System.Drawing.Color.Blue;
                }

                //店铺
                dianpu dp = BLL.dianpuManager.GetInList(dpid);
                if (dp != null)
                {
                    lbl_dianpu.Text      = dp.dpname;
                    lbl_dianpu.ForeColor = System.Drawing.Color.Green;
                    //    lb_account.NavigateUrl = "http://www.taobao.com/webww/ww.php?ver=3&touid=" + lb_account.Text + "&siteid=cntaobao&status=1&charset=utf-8";
                }


                //判断是否是编辑状态
                if (GridView2.EditIndex != e.Row.RowIndex)
                {
                    //LinkButton lb_zhifubao = e.Row.FindControl("lb_zhifubao") as LinkButton;

                    //HyperLink lb_account = e.Row.FindControl("lb_account") as HyperLink;
                    //lb_account.NavigateUrl = "http://www.taobao.com/webww/ww.php?ver=3&touid=" + lb_account.Text + "&siteid=cntaobao&status=1&charset=utf-8";
                    //lb_account.ForeColor = System.Drawing.Color.Blue;
                }
            }
            catch (Exception ex)
            {
                Common.ErrorLog.WriteEntry(ex);
            }
        }
    }
Exemple #27
0
    protected void btn_save_Click(object sender, EventArgs e)
    {
        try
        {
            DateTime dt      = DateTime.Now;
            string   account = txt_account.Text.Trim();
            string   because = txt_yuanyin.Text.Trim();
            string   name    = txt_name.Text.Trim();
            string   phone   = txt_phone.Text.Trim();
            string   remark  = txt_remark.Text.Trim();
            string   state   = ddl_state.SelectedValue.ToString();
            string   dianpu  = ddl_dianpu.SelectedValue != null?ddl_dianpu.SelectedValue.ToString() : "";

            string code    = txt_ordercode.Text.Trim();
            string ytphone = txt_kdphone.Text.Trim();
            string kdcode  = txt_kdcode.Text.Trim();


            shouhou sh = new shouhou();

            if (!string.IsNullOrEmpty(id))
            {
                sh = BLL.shouhouManager.SearchByshid(Convert.ToInt32(id));
            }

            //if (string.IsNullOrEmpty(name))
            //{
            //    Manager.Alert("请输入买家姓名");
            //    Manager.TextBox_Select(txt_name);
            //    return;
            //}
            if (string.IsNullOrEmpty(account))
            {
                AJAXManager.Alert(UpdatePanel1, "请输入买家账号");
                Manager.TextBox_Select(txt_account);
                return;
            }
            //if (string.IsNullOrEmpty(phone))
            //{
            //    Manager.Alert("请输入买家电话号码");
            //    Manager.TextBox_Select(txt_phone);
            //    return;
            //}
            //if (string.IsNullOrEmpty(code))
            //{
            //    Manager.Alert("请输入订单号码");
            //    Manager.TextBox_Select(txt_ordercode);
            //    return;
            //}
            if (string.IsNullOrEmpty(dianpu))
            {
                AJAXManager.Alert(UpdatePanel1, "请选择店铺");
                ddl_dianpu.Focus();
                return;
            }



            sh.shaccount   = account;
            sh.dpid        = Convert.ToInt32(dianpu);
            sh.shname      = name;
            sh.shordercode = code;
            sh.shphone     = phone;
            sh.shremark    = remark;
            sh.shstate     = state;
            sh.shyuanyin   = because;
            sh.shdate      = dt;
            sh.shytphone   = ytphone;
            sh.shkdcode    = kdcode;

            int res;
            if (string.IsNullOrEmpty(id))
            {
                res = BLL.shouhouManager.Insert(sh);
                bind();
            }
            else
            {
                res = BLL.shouhouManager.Update(sh);
            }
            if (res == 1)
            {
                AJAXManager.Alert(UpdatePanel1, "保存成功");
                if (string.IsNullOrEmpty(id))
                {
                    clear();
                }
            }
            else
            {
                AJAXManager.Alert(UpdatePanel1, "保存失败");
            }
        }
        catch (Exception ex)
        {
            AJAXManager.Alert(UpdatePanel1, ex.ToString());
        }
    }
Exemple #28
0
    protected void btn_save_Click(object sender, EventArgs e)
    {
        try
        {
            DateTime dt        = DateTime.Now;
            string   gname     = txt_name.Text.Trim();
            string   gtitle    = txt_title.Text.Trim();
            string   gurl      = txt_url.Text.Trim();
            string   gurl2     = txt_url2.Text.Trim();
            string   gimg      = "";
            string   gimg2     = "";
            string   gstate1   = ddl_state_img.SelectedValue;
            string   gstate2   = ddl_state_up.SelectedValue;
            string   gstate3   = ddl_state_yh.SelectedValue;
            string   gremark1  = txt_remark.Text.Trim();
            int      gtid      = int.Parse(ddl_goodstype.SelectedValue);
            string   gprice1   = txt_price1.Text.Trim();
            string   gprice2   = txt_price2.Text.Trim();
            string   gurl_yuan = txt_url_yuan.Text.Trim();
            string   gprice    = txt_price.Text.Trim();
            string   important = ddl_important.SelectedValue;

            goods g = new goods();

            if (!string.IsNullOrEmpty(id))
            {
                g     = BLL.goodsManager.SearchBygid(Convert.ToInt32(id));
                gimg  = g.gimg;
                gimg2 = g.gimg2;
            }
            else
            {
                g.gdate = dt;
            }

            if (string.IsNullOrEmpty(gname))
            {
                //Manager.Alert("请输入商品简称", Page);
                AJAXManager.Alert(UpdatePanel1, "请输入商品简称");
                Manager.TextBox_Select(txt_name);
                return;
            }
            if (gtid == 0)
            {
                //Manager.Alert("请选择店铺", Page);
                AJAXManager.Alert(UpdatePanel1, "请选择店铺");
                ddl_goodstype.Focus();
                return;
            }
            if (fu_img.HasFile && fu_img2.HasFile)
            {
                //Manager.Alert("暂时不能同时上传两个图片,请单独上传!", Page);
                AJAXManager.Alert(UpdatePanel1, "暂时不能同时上传两个图片,请单独上传!");
                return;
            }
            else
            {
                if (fu_img.HasFile)
                {
                    gimg = Manager.UpImage(fu_img, Request.PhysicalApplicationPath + "OA\\upload\\", Page);
                    if (string.IsNullOrEmpty(gimg))
                    {
                        //Manager.Alert("淘宝图片上传失败,请稍后再试", Page);
                        AJAXManager.Alert(UpdatePanel1, "淘宝图片上传失败,请稍后再试");
                        return;
                    }
                }
                if (fu_img2.HasFile)
                {
                    gimg2 = Manager.UpImage(fu_img2, Request.PhysicalApplicationPath + "OA\\upload\\", Page);
                    if (string.IsNullOrEmpty(gimg2))
                    {
                        //Manager.Alert("淘宝图片上传失败,请稍后再试", Page);
                        AJAXManager.Alert(UpdatePanel1, "淘宝图片上传失败,请稍后再试");
                        return;
                    }
                }
            }

            g.gdate1       = gstate1 == "2" ? dt : new DateTime();
            g.gdate2       = gstate2 == "2" ? dt : new DateTime();
            g.gdate3       = gstate3 == "2" ? dt : new DateTime();
            g.gimg         = gimg;
            g.gimg2        = gimg2;
            g.gname        = gname;
            g.gprice1      = gprice1;
            g.gprice2      = gprice2;
            g.gremark1     = gremark1;
            g.gstate1      = gstate1;
            g.gstate2      = gstate2;
            g.gstate3      = gstate3;
            g.gtid         = gtid;
            g.gtitle       = gtitle;
            g.gurl         = gurl;
            g.gurl2        = gurl2;
            g.gurl_yuan    = gurl_yuan;
            g.g_price_yuan = gprice;
            g.g_standby1   = important;


            int res;
            if (string.IsNullOrEmpty(id))
            {
                res = BLL.goodsManager.Insert(g);
            }
            else
            {
                res = BLL.goodsManager.Update(g);
            }
            if (res == 1)
            {
                //Manager.Alert("保存成功", Page);
                AJAXManager.Alert(UpdatePanel1, "保存成功");
                clear();
            }
            else
            {
                //Manager.Alert("保存失败", Page);
                AJAXManager.Alert(UpdatePanel1, "保存失败");
            }
        }
        catch (Exception ex)
        {
            //Manager.Alert(ex.ToString(), Page);
            AJAXManager.Alert(UpdatePanel1, ex.ToString());
        }
        //Manager.page_href_reload(Page);
    }
Exemple #29
0
    protected void btn_quickadd_Click(object sender, EventArgs e)
    {
        string str  = txt_quickadd.Text.Trim();
        string temp = str;

        if (string.IsNullOrEmpty(str))
        {
            return;
        }
        str = Regex.Replace(str, @"[\n\r]", "");
        str = Regex.Replace(str, @"\s+", "");
        str = str.Replace(" ", "");
        int    orderid_1;
        int    orderid_2;
        string orderid = string.Empty;
        int    account_1;
        int    account_2;
        string account = string.Empty;
        int    name_1;
        int    name_2;
        string name = string.Empty;
        int    phone_1;
        int    phone_2;
        string phone = string.Empty;
        int    kdcode_1;
        int    kdcode_2;
        string kdcode = string.Empty;

        txt_quickadd.Text = str;

        try
        {
            if (str.IndexOf("蘑菇街") > -1)
            {
                //蘑菇街的
                orderid_1 = str.IndexOf("订单编号:");
                orderid_2 = str.IndexOf("成交时间:");
                if (orderid_1 > -1 && orderid_2 > -1 && orderid_2 > orderid_1)
                {
                    orderid = str.Substring(orderid_1 + 5, orderid_2 - orderid_1 - 5);
                }
                account_1 = str.IndexOf("买家:");
                account_2 = str.IndexOf("当前状态:");
                if (account_1 > -1 && account_2 > -1 && account_2 > account_1)
                {
                    account = str.Substring(account_1 + 3, account_2 - account_1 - 3);
                }
                name_1 = str.IndexOf("收货人:");
                name_2 = str.IndexOf("收货地址:");
                if (name_1 > -1 && name_2 > -1 && name_2 > name_1)
                {
                    name = str.Substring(name_1 + 4, name_2 - name_1 - 4);
                }
                phone_1 = str.IndexOf("联系电话:");
                phone_2 = str.IndexOf("修改地址", phone_1) > -1 ? str.IndexOf("修改地址", phone_1) : str.IndexOf("备注", phone_1);
                if (phone_1 > -1 && phone_2 > -1 && phone_2 > phone_1)
                {
                    phone = str.Substring(phone_1 + 5, phone_2 - phone_1 - 5);
                }
                kdcode_1 = str.IndexOf("快递单号:");
                kdcode_2 = str.IndexOf("修改", kdcode_1) > -1 ? str.IndexOf("修改", kdcode_1) : str.IndexOf("物流跟踪:");
                if (kdcode_1 > -1 && kdcode_2 > -1 && kdcode_2 > kdcode_1)
                {
                    kdcode = str.Substring(kdcode_1 + 5, kdcode_2 - kdcode_1 - 5);
                }

                foreach (dianpu dp in dplist)
                {
                    if (dp.dpname.IndexOf("蘑菇街") > -1)
                    {
                        ddl_dianpu.SelectedValue = dp.dpid.ToString();
                        break;
                    }
                }
            }
            else if (str.IndexOf("淘宝") > -1)
            {
                //淘宝的
                orderid_1 = str.IndexOf("订单编号:");
                orderid_2 = str.IndexOf("创建时间:");
                if (orderid_1 > -1 && orderid_2 > -1 && orderid_2 > orderid_1)
                {
                    orderid = str.Substring(orderid_1 + 5, orderid_2 - orderid_1 - 5);
                }
                account_1 = str.IndexOf("如果期间买家(");
                account_2 = str.IndexOf(")没有");
                if (account_1 > -1 && account_2 > -1 && account_2 > account_1)
                {
                    account = str.Substring(account_1 + 7, account_2 - account_1 - 7);
                }
                name_1 = str.IndexOf("收货地址:");
                name_2 = str.IndexOf(",", name_1);
                if (name_1 > -1 && name_2 > -1 && name_2 > name_1)
                {
                    name = str.Substring(name_1 + 5, name_2 - name_1 - 5);
                }
                phone_1 = name_2;
                phone_2 = str.IndexOf(",", name_2 + 1);
                if (phone_1 > -1 && phone_2 > -1 && phone_2 > phone_1)
                {
                    phone = str.Substring(phone_1 + 1, phone_2 - phone_1 - 1);
                }
                kdcode_1 = str.IndexOf("运单号:");
                kdcode_2 = str.IndexOf("查看物流信息");
                if (kdcode_1 > -1 && kdcode_2 > -1 && kdcode_2 > kdcode_1)
                {
                    kdcode = str.Substring(kdcode_1 + 4, kdcode_2 - kdcode_1 - 4);
                }
                //Manager.Alert(name_2.ToString(),);
                string dpname = str.Substring(str.IndexOf("手机版") + 3, str.IndexOf("淘宝网首页") - str.IndexOf("手机版") - 3);
                foreach (dianpu dp in dplist)
                {
                    if (dp.dpname.IndexOf(dpname) > -1)
                    {
                        ddl_dianpu.SelectedValue = dp.dpid.ToString();
                        break;
                    }
                }
            }
            else
            {
                AJAXManager.Alert(UpdatePanel1, "无法识别,请手动填写");
                Manager.TextBox_Select(txt_quickadd);
                return;
            }
            txt_account.Text   = account;
            txt_kdcode.Text    = kdcode;
            txt_phone.Text     = phone;
            txt_name.Text      = name;
            txt_ordercode.Text = orderid;
            txt_yuanyin.Focus();
        }
        catch (Exception ex)
        {
            AJAXManager.Alert(UpdatePanel1, ex.ToString());
        }
    }
Exemple #30
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string state = e.CommandName;

        if (state == "state_up")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["gid"].ToString());
            if (id != 0)
            {
                goods g = BLL.goodsManager.SearchBygid(id);
                g.gstate2 = g.gstate2 == "1" ? "2" : "1";
                if (g.gstate2 == "2")
                {
                    g.gdate2 = DateTime.Now;
                }
                if (BLL.goodsManager.Update(g) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    bind();
                }
            }
        }
        if (state == "state_img")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["gid"].ToString());
            if (id != 0)
            {
                goods g = BLL.goodsManager.SearchBygid(id);
                g.gstate1 = g.gstate1 == "1" ? "2" : "1";
                if (g.gstate1 == "2")
                {
                    g.gdate1 = DateTime.Now;
                }
                if (BLL.goodsManager.Update(g) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    bind();
                }
            }
        }
        if (state == "state_yh")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["gid"].ToString());
            if (id != 0)
            {
                goods g = BLL.goodsManager.SearchBygid(id);
                g.gstate3 = g.gstate3 == "1" ? "2" : "1";
                if (g.gstate3 == "2")
                {
                    g.gdate3 = DateTime.Now;
                }
                if (BLL.goodsManager.Update(g) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    bind();
                }
            }
        }
        if (state == "state_important")
        {
            int id = Convert.ToInt32(GridView1.DataKeys[((e.CommandSource as LinkButton).NamingContainer as GridViewRow).RowIndex].Values["gid"].ToString());
            if (id != 0)
            {
                goods g = BLL.goodsManager.SearchBygid(id);
                g.g_standby1 = g.g_standby1 == "1" ? "2" : "1";
                if (BLL.goodsManager.Update(g) != 1)
                {
                    AJAXManager.Alert(this.UpdatePanel1, "修改失败");
                }
                else
                {
                    bind();
                }
            }
        }
    }