Example #1
0
 public void DataBindLink()
 {
     Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID);
     if (Dis != null)
     {
         if (!string.IsNullOrEmpty(Dis.pic))
         {
             string[] files = Dis.pic.Split(new char[] { ',' });
             foreach (string file in files)
             {
                 if (!string.IsNullOrEmpty(file))
                 {
                     LinkButton linkFile = new LinkButton();
                     linkFile.Click += new EventHandler(Download_Click);
                     if (file.LastIndexOf("_") != -1)
                     {
                         string text = file.Substring(0, file.LastIndexOf("_")) + Path.GetExtension(file);
                         linkFile.Text = text;
                     }
                     else
                     {
                         string text = file.Substring(0, file.LastIndexOf("-")) + Path.GetExtension(file);
                         linkFile.Text = text;
                     }
                     linkFile.Style.Add("margin-right", "15px");
                     linkFile.Style.Add("text-decoration", "underline");
                     linkFile.Attributes.Add("fileName", file);
                     DFile.Controls.Add(linkFile);
                 }
             }
         }
     }
 }
Example #2
0
    /// <summary>
    /// 验证代理商名字是否重复
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="str"></param>
    /// <param name="index"></param>
    /// <param name="Tran"></param>
    /// <returns></returns>
    public string DisExistsAttribute(string name, string value, string str, DataRow dr, DataTable dt)
    {
        if (string.IsNullOrEmpty(value))
        {
            return(value);
        }
        List <Hi.Model.BD_Distributor> Dis = new Hi.BLL.BD_Distributor().GetList("", " " + name + "='" + value + "' and CompID=" + CompID + " and isnull(dr,0)=0 ", "");

        if (Dis.Count > 0)
        {
            dr["chkstr"] = value + str + "已存在";
            // Eroor = true;
            // TitleError += "Excel行号为:&nbsp;<i error>" + (index + TitleIndex + 1) + "</i> &nbsp;&nbsp;的数据有误。" + str + "已存在,请修改后重新导入。<br/>";
            //throw new ApplicationException("");
        }
        else
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i]["disname"].ToString() == value.Trim())
                {
                    dr["chkstr"] = value + str + "Excel已存在";
                    return(value);
                }
            }
        }
        return(value);
    }
Example #3
0
    public string DelType(string id)
    {
        string json = string.Empty;

        if (!string.IsNullOrEmpty(id))
        {
            List <Hi.Model.BD_DisType> List = new Hi.BLL.BD_DisType().GetList(null, " CompID=" + CompID + " and isnull(dr,0)=0  and  ParentId=" + id, null);
            if (List.Count > 0)
            {
                return("{\"result\":false,\"code\":\"此类别下还有子级类别,请先删除子级类别!\"}");
            }
            List <Hi.Model.BD_Distributor> Dis = new Hi.BLL.BD_Distributor().GetList(null, " CompID=" + CompID + " and isnull(dr,0)=0  and   DisTypeID=" + id, null);
            if (Dis.Count > 0)
            {
                return("{\"result\":false,\"code\":\"此分类已被使用,不允许删除!\"}");
            }
            List <Hi.Model.BD_DisPrice> disp = new Hi.BLL.BD_DisPrice().GetList(null, " CompID=" + CompID + " and type=" + 1 + " and( One=" + id + " or two=" + id + " or three=" + id + ") and dr=0", null);
            if (disp.Count > 0)
            {
                return("{\"result\":false,\"code\":\"此区域下有代理商价格,不允许删除!\"}");
            }

            Hi.Model.BD_DisType type = new Hi.BLL.BD_DisType().GetModel(id.ToInt(0));
            type.dr         = 1;
            type.ts         = DateTime.Now;
            type.modifyuser = UserID;
            if (new Hi.BLL.BD_DisType().Update(type))
            {
                return("{\"result\":true,\"code\":\"操作成功\"}");
            }
        }
        return(json);
    }
Example #4
0
    public void DataBinds()
    {
        int pageCount = 0;
        int Counts    = 0;

        if (this.txtPageSize.Value.ToString() != "")
        {
            if (this.txtPageSize.Value.Trim().Length >= 5)
            {
                Pager.PageSize         = 100;
                this.txtPageSize.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPageSize.Value.Trim().ToInt(0);
            }
        }

        //List<Hi.Model.BD_Distributor> LUser = new Hi.BLL.BD_Distributor().GetList(Pager.PageSize, Pager.CurrentPageIndex, "Createdate", false, SearchWhere(), out pageCount, out Counts);

        const string joinTableStr = " BD_Distributor A left join SYS_CompUser cu on A.ID=cu.DisID";
        DataTable    LUser        = new Hi.BLL.BD_Distributor().GetList(Pager.PageSize, Pager.CurrentPageIndex, "A.Createdate", true, string.Join(",", typeof(Hi.Model.BD_Distributor).GetProperties().Select(p => "A." + p.Name)), joinTableStr, SearchWhere(), out pageCount, out Counts);



        this.Rpt_Distribute.DataSource = LUser;

        this.Rpt_Distribute.DataBind();
        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
        //this.Org.SelectedValue = this.OrgID == 0 ? Org.SelectedValue : this.OrgID.ToString();
    }
Example #5
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        List <Hi.Model.BD_Distributor> dis = new Hi.BLL.BD_Distributor().GetList("", " Compid=" + CompID + "", "");

        foreach (Hi.Model.BD_Distributor model in dis)
        {
            new Hi.BLL.BD_Distributor().Delete(model.ID);
            List <Hi.Model.BD_DisAddr> Daddr = new Hi.BLL.BD_DisAddr().GetList("", " disid='" + model.ID + "'", "");
            foreach (Hi.Model.BD_DisAddr mo in Daddr)
            {
                new Hi.BLL.BD_DisAddr().Delete(mo.ID);
            }
            List <Hi.Model.SYS_Users> user = new Hi.BLL.SYS_Users().GetList("", " disid='" + model.ID + "' and type=5", "");
            foreach (Hi.Model.SYS_Users mo in user)
            {
                new Hi.BLL.SYS_Users().Delete(mo.ID);
            }
        }
        List <Hi.Model.BD_DisType> Dtype = new Hi.BLL.BD_DisType().GetList("", " Compid=" + CompID + "", "");

        foreach (Hi.Model.BD_DisType model in Dtype)
        {
            new Hi.BLL.BD_DisType().Delete(model.ID);
        }
    }
Example #6
0
 //修改支付密码
 protected void A_Save(object sender, EventArgs e)
 {
     if (paypwd1.Value == "123456")
     {
         ClientScript.RegisterStartupScript(GetType(), "", "<script>layerCommon.alert('新支付密码不能为默认密码', IconOption.错误);</script>");
         return;
     }
     if (paypwd1.Value == paypwd2.Value)
     {
         Hi.Model.BD_Distributor dis = new Hi.BLL.BD_Distributor().GetModel(this.DisID);
         dis.Paypwd     = Util.md5(paypwd1.Value);
         dis.ts         = DateTime.Now;
         dis.modifyuser = this.UserID;
         if (new Hi.BLL.BD_Distributor().Update(dis))
         {
             spanpaypwd.Attributes.CssStyle.Value = "display:none;";
             ClientScript.RegisterStartupScript(GetType(), "", "<script>layerCommon.alert('恭喜您,您的支付密码已经修改成功!', IconOption.笑脸);</script>");
             divpaypwd.Attributes.Add("style", "display:none");
             zzc.Attributes.Add("style", "display:none");
             return;
         }
         else
         {
             spanpaypwd.Attributes.CssStyle.Value = "display:inline-block;color:Red;";
             spanpaypwd.InnerText = "修改失败请重试!";
             return;
         }
     }
     else
     {
         spanpaypwd.Attributes.CssStyle.Value = "display:inline-block;color:Red;";
         spanpaypwd.InnerText = "两次输入的密码不一致!";
         return;
     }
 }
Example #7
0
    /// <summary>
    /// 转账汇款审核
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSh_Click(object sender, EventArgs e)
    {
        string shId = this.hidShId.Value;

        //调用model,对属性进行赋值
        Hi.Model.PAY_PrePayment shModel = new Hi.BLL.PAY_PrePayment().GetModel(Convert.ToInt32(shId));
        shModel.AuditState = 2;
        //调用修改方法
        Hi.BLL.PAY_PrePayment shUpdate = new Hi.BLL.PAY_PrePayment();
        bool shUp = shUpdate.Update(shModel);

        if (shUp == bool.Parse("true"))
        {
            int hidShIds = shModel.DisID;
            Hi.BLL.PAY_PrePayment prePayModel = new Hi.BLL.PAY_PrePayment();
            //sum代理商全部录入,冲正以及审核通过的转账汇款金额
            decimal sums = prePayModel.sums(hidShIds, shModel.CompID);
            //修改代理商的企业钱包金额
            //调用model,对属性进行赋值
            Hi.Model.BD_Distributor disSumModel = new Hi.BLL.BD_Distributor().GetModel(Convert.ToInt32(hidShIds));
            disSumModel.DisAccount = sums;
            disSumModel.ID         = shModel.ID;
            //调用修改方法
            Hi.BLL.BD_Distributor disupdate = new Hi.BLL.BD_Distributor();
            bool disup = disupdate.Update(disSumModel);
            if (disup)
            {
                JScript.AlertMethod(this, "审核成功", JScript.IconOption.笑脸, "function (){ location.replace('" + ("PayExamineList.aspx") + "'); }");
            }
        }
    }
Example #8
0
    /// <summary>
    /// 代理商列表显示
    /// </summary>
    public void Bind()
    {
        //查询代理商
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = string.Empty;


        if (ViewState["strwhere"] != null)
        {
            strwhere += ViewState["strwhere"].ToString();
        }


        if (this.txtPager.Value.Trim().ToString() != "")
        {
            if (this.txtPager.Value.Trim().Length >= 5)
            {
                Pager.PageSize      = 100;
                this.txtPager.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPager.Value.Trim().ToInt(0);
            }
        }
        List <Hi.Model.BD_Distributor> dis = new Hi.BLL.BD_Distributor().GetList(Pager.PageSize, Pager.CurrentPageIndex, "shortindex", true, strwhere, out pageCount, out Counts);

        this.rptDis.DataSource = dis;
        this.rptDis.DataBind();

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Example #9
0
 protected void AddMessAge(object sender, EventArgs e)
 {
     Hi.Model.DIS_Suggest    suggest = new Hi.Model.DIS_Suggest();
     Hi.Model.BD_Distributor dis     = new Hi.BLL.BD_Distributor().GetModel(DisID);
     if (dis != null)
     {
         suggest.Title      = Common.NoHTML(txtTitle.Value);
         suggest.DisUserID  = this.UserID;
         suggest.Remark     = Common.NoHTML(txtRemark.Value);
         suggest.CreateDate = DateTime.Now;
         suggest.CompID     = this.CompID;
         suggest.Stype      = 0;
         suggest.DisID      = this.DisID;
         suggest.IsAnswer   = 0;
         suggest.ts         = DateTime.Now;
         suggest.dr         = 0;
         suggest.modifyuser = this.UserID;
         if (new Hi.BLL.DIS_Suggest().Add(suggest) > 0)
         {
             Response.Redirect("MessAgeList.aspx");
         }
         else
         {
             JScript.AlertMsgOne(this, "添加失败!", JScript.IconOption.错误);
         }
     }
 }
Example #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     hidCompId.Value = CompID.ToString();
     if (!IsPostBack)
     {
         DataBinds();
         if (KeyID != 0)
         {
             List <Hi.Model.BD_Distributor> Ldis = new Hi.BLL.BD_Distributor().GetList("", "auditstate=2 and isnull(IsEnabled,0)=1  and isnull(dr,0)=0 and SMID = " + KeyID + " and CompID=" + CompID, "");
             if (Ldis.Count > 0)
             {
                 tbdis.Attributes["style"] = "display:block;";
             }
             else
             {
                 tbdis.Attributes["style"] = "display:none;";
             }
             Rpt_Dis.DataSource = Ldis;
             Rpt_Dis.DataBind();
             for (int i = 0; i < Ldis.Count; i++)
             {
                 hidselectDis.Value += Ldis[i].ID + ",";
             }
             hidselectDis.Value = hidselectDis.Value.TrimEnd(',');
         }
     }
 }
Example #11
0
    public void DataBinds()
    {
        int pageCount = 0;
        int Counts    = 0;

        if (this.txtPageSize.Value.ToString() != "")
        {
            if (this.txtPageSize.Value.Trim().Length >= 5)
            {
                Pager.PageSize         = 100;
                this.txtPageSize.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPageSize.Value.Trim().ToInt(0);
            }
        }
        // List<Hi.Model.BD_Distributor> LDis = new Hi.BLL.BD_Distributor().GetList(Pager.PageSize, Pager.CurrentPageIndex, "Createdate", false, SearchWhere()+date, out pageCount, out Counts);

        DataTable LDis = new Hi.BLL.BD_Distributor().getDataTable(Pager.PageSize, Pager.CurrentPageIndex, SearchWhere() + date, out pageCount, out Counts, Pager.RecordCount);

        this.Rpt_Distribute.DataSource = LDis;
        this.Rpt_Distribute.DataBind();
        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Example #12
0
 protected void btn_NUse(object sender, EventArgs e)
 {
     Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(KeyID);
     comp.IsEnabled  = 0;
     comp.ts         = DateTime.Now;
     comp.modifyuser = UserID;
     if (new Hi.BLL.BD_Company().Update(comp))
     {
         //List<Hi.Model.SYS_Users> user = new Hi.BLL.SYS_Users().GetList("", " isnull(dr,0)=0 and compid=" + KeyID + "", "");
         //foreach (Hi.Model.SYS_Users model1 in user)
         //{
         //    model1.IsEnabled = 0;
         //    model1.ts = DateTime.Now;
         //    model1.modifyuser = UserID;
         //    new Hi.BLL.SYS_Users().Update(model1);
         //}
         List <Hi.Model.BD_Distributor> dis = new Hi.BLL.BD_Distributor().GetList("", " isnull(dr,0)=0 and compid=" + KeyID + "", "");
         foreach (Hi.Model.BD_Distributor model2 in dis)
         {
             model2.IsEnabled  = 0;
             model2.ts         = DateTime.Now;
             model2.modifyuser = UserID;
             new Hi.BLL.BD_Distributor().Update(model2);
         }
         JScript.AlertMsgMo(this, "用户禁用成功", "function(){ window.location.href='CompList.aspx'; }");
     }
 }
Example #13
0
    protected void btn_Use(object sender, EventArgs e)
    {
        Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID);
        if (Dis != null)
        {
            List <Hi.Model.SYS_CompUser> luser = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and DisID=" + KeyID + " and Utype in (1,5) and Ctype=2 and CompID=" + this.CompID, "");

            foreach (Hi.Model.SYS_CompUser model in luser)
            {
                model.IsEnabled  = 1;
                model.ts         = DateTime.Now;
                model.modifyuser = Common.UserID();
                new Hi.BLL.SYS_CompUser().Update(model);
            }

            if (Request["nextstep"] + "" == "1")
            {
                Response.Redirect("DisList.aspx?nextstep=1");
            }
            else
            {
                Response.Redirect("DisInfo.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey) + "&type=2");
            }
        }
    }
Example #14
0
    public void DataBinds()
    {
        List <Hi.Model.BD_Distributor> LDis = new Hi.BLL.BD_Distributor().GetList("", SearchWhere(), "Createdate desc");

        this.Rpt_Dis.DataSource = LDis;
        this.Rpt_Dis.DataBind();
        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$(function(){     $(\"#CB_SelAll\").trigger(\"click\");})</script>");
    }
Example #15
0
    /// <summary>
    /// 保存
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        SqlTransaction Tran = null;

        try
        {
            Tran = DBUtility.SqlHelper.CreateStoreTranSaction();
            object disId   = Request["disId"];   //代理商id
            object goodsId = Request["goodsId"]; //商品Id
            if (disId != null && goodsId != null)
            {
                for (int i = 0; i < disId.ToString().Split(',').Length; i++)
                {
                    for (int z = 0; z < goodsId.ToString().Split(',').Length; z++)
                    {
                        List <Hi.Model.BD_GoodsAreas> l = new Hi.BLL.BD_GoodsAreas().GetList("", "isnull(dr,0)=0 and compId=" + this.CompID + " and disId=" + disId.ToString().Split(',')[i] + " and goodsId=" + goodsId.ToString().Split(',')[z], "", Tran);
                        if (l.Count == 0)
                        {
                            Hi.Model.BD_GoodsAreas  model  = new Hi.Model.BD_GoodsAreas();
                            Hi.Model.BD_Distributor model2 = new Hi.BLL.BD_Distributor().GetModel(Convert.ToInt32(disId.ToString().Split(',')[i]), Tran);
                            Hi.Model.BD_Goods       model3 = new Hi.BLL.BD_Goods().GetModel(Convert.ToInt32(goodsId.ToString().Split(',')[z]), Tran);
                            model.CompID     = this.CompID;
                            model.areaID     = model2.AreaID;
                            model.GoodsID    = Convert.ToInt32(goodsId.ToString().Split(',')[z]);
                            model.CategoryID = model3.CategoryID;
                            model.ts         = DateTime.Now;
                            model.dr         = 0;
                            model.modifyuser = this.UserID;
                            model.DisID      = Convert.ToInt32(disId.ToString().Split(',')[i]);
                            new Hi.BLL.BD_GoodsAreas().Add(model, Tran);
                        }
                        else
                        {
                            continue;
                        }
                    }
                }
            }
            Tran.Commit();
            Response.Redirect("GoodsAreaList.aspx");
        }
        catch (Exception ex)
        {
            if (Tran != null)
            {
                if (Tran.Connection != null)
                {
                    Tran.Rollback();
                }
            }
            JScript.AlertMethod(this, "保存失败了", JScript.IconOption.错误, "function(){location.href='GoodsAreaList.aspx';}");
            return;
        }
        finally
        {
            DBUtility.SqlHelper.ConnectionClose();
        }
    }
Example #16
0
    protected void btn_Del(object sender, EventArgs e)
    {
        Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID);
        if (Dis != null)
        {
            //if (Dis.AuditState == 2 && Dis.IsEnabled == 1)
            //{
            //    JScript.AlertMsgOne(this, "已审核未被禁用的代理商不允许删除!", JScript.IconOption.错误);
            //    return;
            //}
            //Dis.dr = 1;
            //Dis.ts = DateTime.Now;
            //Dis.modifyuser = Common.UserID();

            List <int> ListUserid              = new List <int>();
            List <int> ListDelUserid           = new List <int>();
            List <Hi.Model.SYS_CompUser> luser = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and DisID=" + KeyID + " and Utype in (1,5) and Ctype=2 and CompID=" + this.CompID, "");

            foreach (Hi.Model.SYS_CompUser model in luser)
            {
                if (model.IsAudit == 2 && model.IsEnabled == 1)
                {
                    JScript.AlertMsgOne(this, "已审核未被禁用的代理商不允许删除!", JScript.IconOption.错误);
                    return;
                }

                if (!ListUserid.Contains(model.UserID))
                {
                    List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("id", " dr=0 and Userid=" + model.UserID + " and CompID=" + this.CompID, "");
                    if (ListCompUser.Count == 1)
                    {
                        ListDelUserid.Add(model.UserID);
                    }
                    ListUserid.Add(model.UserID);
                }
                model.dr         = 1;
                model.ts         = DateTime.Now;
                model.modifyuser = Common.UserID();
                new Hi.BLL.SYS_CompUser().Update(model);
            }
            if (ListDelUserid.Count > 0)
            {
                List <Hi.Model.SYS_Users> ListUsers = new Hi.BLL.SYS_Users().GetList("", " dr=0 and id in(" + string.Join(",", ListDelUserid) + ")", "");
                foreach (Hi.Model.SYS_Users model in ListUsers)
                {
                    model.dr         = 1;
                    model.ts         = DateTime.Now;
                    model.modifyuser = Common.UserID();
                    new Hi.BLL.SYS_Users().Update(model);
                }
            }
            //string Phone = Common.GetDis(Dis.ID, "Phone");
            //string msg = "您所注册的代理商:" + Dis.DisName + "已注销![ " + Common.GetCompValue(CompID, "CompName") + " ]";
            //Common.GetPhone(Phone, msg);
            JScript.AlertMethod(this, "删除成功!", JScript.IconOption.错误, "function(){ window.location.href='DisList.aspx'; }");
        }
    }
Example #17
0
 public void DataBindLink()
 {
     Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(this.DisID);
     if (Dis != null)
     {
         if (!string.IsNullOrEmpty(Dis.pic))
         {
             string[] files = Dis.pic.Split(new char[] { ',' });
             foreach (string file in files)
             {
                 if (!string.IsNullOrEmpty(file))
                 {
                     LinkButton linkFile = new LinkButton();
                     linkFile.Click += new EventHandler(Download_Click);
                     if (file.LastIndexOf("_") != -1)
                     {
                         string text = file.Substring(0, file.LastIndexOf("_")) + Path.GetExtension(file);
                         if (text.Length < 15)
                         {
                             linkFile.Text = text;
                         }
                         else
                         {
                             linkFile.Text = text.Substring(0, 15) + "...";
                         }
                         linkFile.Attributes.Add("title", text);
                     }
                     else
                     {
                         string text = file.Substring(0, file.LastIndexOf("-")) + Path.GetExtension(file);
                         if (text.Length < 15)
                         {
                             linkFile.Text = text;
                         }
                         else
                         {
                             linkFile.Text = text.Substring(0, 15) + "...";
                         }
                         linkFile.Attributes.Add("title", text);
                     }
                     linkFile.Style.Add("margin-right", "5px");
                     linkFile.Style.Add("text-decoration", "underline");
                     linkFile.Attributes.Add("fileName", file);
                     HtmlGenericControl div = new HtmlGenericControl("div");
                     div.Controls.Add(linkFile);
                     //HtmlImage img = new HtmlImage();
                     //img.Src = "../images/icon_del.png";
                     //img.Attributes.Add("title", "删除附件");
                     //img.Attributes.Add("onclick", "ConFirmDelteAnnex(this,'Dis'," + this.DisID + ",'" + file + "')");
                     //div.Controls.Add(img);
                     DFile.Controls.Add(div);
                 }
             }
         }
     }
 }
Example #18
0
    public void Bind(string Id)
    {
        Hi.Model.BD_Distributor disModel = new Hi.BLL.BD_Distributor().GetModel(Id.ToInt(0));

        if (disModel != null)
        {
            this.txtuserphone.Value = Phone;
            this.txtusername.Value  = disModel.Principal;
        }
    }
Example #19
0
    protected void btn_Save1(object sender, EventArgs e)
    {
        Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(this.DisID);
        if (Dis != null)
        {
            if (Common.DisExistsAttribute("DisName", txtDisName.Value.Trim(), this.CompID.ToString(), this.DisID.ToString()))
            {
                JScript.AlertMsgOne(this, "代理商已存在!", JScript.IconOption.错误, 2500);
                return;
            }
            Dis.Province     = Common.NoHTML(hidProvince.Value.Trim());
            Dis.City         = Common.NoHTML(hidCity.Value.Trim());
            Dis.Area         = Common.NoHTML(hidArea.Value.Trim());
            Dis.DisName      = Common.NoHTML(txtDisName.Value.Trim());
            Dis.Licence      = Common.NoHTML(txtLicence.Value.Trim());
            Dis.Tel          = Common.NoHTML(txtTel.Value.Trim());
            Dis.Principal    = Common.NoHTML(txtname.Value);
            Dis.Phone        = Common.NoHTML(txtnamephone.Value);
            Dis.Zip          = Common.NoHTML(txtZip.Value.Trim());
            Dis.Fax          = Common.NoHTML(txtFax.Value.Trim());
            Dis.Address      = Common.NoHTML(txtAddress.Value.Trim());
            Dis.Leading      = Common.NoHTML(txtLeading.Value.Trim());
            Dis.LeadingPhone = Common.NoHTML(txtLeadingPhone.Value.Trim());
            if (!string.IsNullOrEmpty(HidFfileName.Value))
            {
                if (Dis.pic == "")
                {
                    Dis.pic = Common.NoHTML(HidFfileName.Value);
                }
                else
                {
                    Dis.pic += "," + Common.NoHTML(HidFfileName.Value);
                }
            }
            Dis.ts         = DateTime.Now;
            Dis.modifyuser = this.UserID;
            if (new Hi.BLL.BD_Distributor().Update(Dis))
            {
                List <Hi.Model.SYS_CompUser> user2 = new Hi.BLL.SYS_CompUser().GetList("UserID", "  isnull(dr,0)=0 and  disId='" + this.DisID + "' and utype=5", "");
                if (user2.Count > 0)
                {
                    Hi.Model.SYS_Users u = new Hi.BLL.SYS_Users().GetModel(user2[0].UserID);

                    if (u != null)
                    {
                        u.ts         = DateTime.Now;
                        u.modifyuser = this.UserID;
                        u.TrueName   = Common.NoHTML(txtUserTrueName.Value);
                        new Hi.BLL.SYS_Users().Update(u);
                    }
                }
                Response.Redirect("PhoneEdit.aspx?type=hf");
            }
        }
    }
Example #20
0
    public void DisDataBind()
    {
        int pageCount = 0;
        int Counts    = 0;
        List <Hi.Model.BD_Distributor> LDis = new Hi.BLL.BD_Distributor().GetList(Pager.PageSize, Pager.CurrentPageIndex, "Createdate", false, " and isnull(dr,0)=0 and CompID=" + KeyID + "", out pageCount, out Counts);

        this.Rpt_Distribute.DataSource = LDis;
        this.Rpt_Distribute.DataBind();
        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Example #21
0
    public void Databind()
    {
        Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(this.DisID);
        if (Dis != null)
        {
            hidProvince.Value     = Dis.Province;
            hidCity.Value         = Dis.City;
            hidArea.Value         = Dis.Area;
            txtDisName.Value      = Dis.DisName;
            txtLicence.Value      = Dis.Licence;
            txtTel.Value          = Dis.Tel;
            txtname.Value         = Dis.Principal;
            txtnamephone.Value    = Dis.Phone;
            txtZip.Value          = Dis.Zip;
            txtFax.Value          = Dis.Fax;
            txtAddress.Value      = Dis.Address;
            txtLeading.Value      = Dis.Leading;
            txtLeadingPhone.Value = Dis.LeadingPhone;
            List <Hi.Model.SYS_CompUser> user2 = new Hi.BLL.SYS_CompUser().GetList("", "  isnull(dr,0)=0 and  disId='" + this.DisID + "' and utype=5", "");
            if (user2.Count > 0)
            {
                Hi.Model.SYS_Users u = new Hi.BLL.SYS_Users().GetModel(user2[0].UserID);

                if (u != null)
                {
                    //List<Hi.Model.SYS_Users> u = new Hi.BLL.SYS_Users().GetList("", "  isnull(dr,0)=0 and  DisID='" + this.DisID + "' and type=5", "");
                    //if (u.Count > 0)
                    //{
                    txtUsername.Disabled  = true;
                    txtUserPhone.Disabled = true;
                    txtUsername.Value     = u.UserName;
                    txtUserPhone.Value    = u.Phone;
                    txtUserTrueName.Value = u.TrueName;
                }
            }
            else
            {
                List <Hi.Model.SYS_Users> users = new Hi.BLL.SYS_Users().GetList("", " DisID='" + this.DisID + "'", "");

                if (users.Count > 0)
                {
                    //List<Hi.Model.SYS_Users> u = new Hi.BLL.SYS_Users().GetList("", "  isnull(dr,0)=0 and  DisID='" + this.DisID + "' and type=5", "");
                    //if (u.Count > 0)
                    //{
                    txtUsername.Disabled  = true;
                    txtUserPhone.Disabled = true;
                    txtUsername.Value     = users[0].UserName;
                    txtUserPhone.Value    = users[0].Phone;
                    txtUserTrueName.Value = users[0].TrueName;
                }
            }
        }
    }
Example #22
0
    protected void btn_NUse(object sender, EventArgs e)
    {
        Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID);
        string    sql    = "select * from SYS_CompUser where ISNULL(dr,0)=0 and DisID=" + KeyID;
        DataTable userDT = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0];

        if (userDT.Rows.Count > 0)
        {
            SqlTransaction Tran = null;
            try
            {
                Tran = DBUtility.SqlHelper.CreateStoreTranSaction();
                for (int i = 0; i < userDT.Rows.Count; i++)
                {
                    Hi.Model.SYS_CompUser user = new Hi.BLL.SYS_CompUser().GetModel(Convert.ToInt32(userDT.Rows[i]["ID"].ToString()));
                    user.IsEnabled  = 0;
                    user.ts         = DateTime.Now;
                    user.modifyuser = UserID;
                    new Hi.BLL.SYS_CompUser().Update(user, Tran);
                }
                Tran.Commit();
            }
            catch
            {
                if (Tran != null)
                {
                    if (Tran.Connection != null)
                    {
                        Tran.Rollback();
                    }
                    JScript.AlertMethod(this, "操作失败!", JScript.IconOption.错误, "function(){ window.location.href=window.location.href; }");
                }
            }
        }
        if (Dis != null)
        {
            Dis.IsEnabled  = 0;
            Dis.ts         = DateTime.Now;
            Dis.modifyuser = UserID;
            if (new Hi.BLL.BD_Distributor().Update(Dis))
            {
                if (Request["nextstep"] + "" == "1")
                {
                    Response.Redirect("DisList.aspx?nextstep=1");
                }
                else
                {
                    Response.Redirect("DisInfo.aspx?KeyID=" + KeyID.ToString() + "&type=2");
                }
            }
        }
    }
Example #23
0
    /// <summary>
    /// 数据绑定
    /// </summary>
    public void DataBinds()
    {
        int pageCount = 0;
        int Counts    = 0;
        //List<Hi.Model.BD_Distributor> LDis = new Hi.BLL.BD_Distributor().GetList(Pager.PageSize, Pager.CurrentPageIndex, "Createdate", false, SearchWhere(), out pageCount, out Counts);

        DataTable LDis = new Hi.BLL.BD_Distributor().getDataTable(Pager.PageSize, Pager.CurrentPageIndex, SearchWhere(), out pageCount, out Counts, Pager.RecordCount);

        this.Rpt_Distribute.DataSource = LDis;
        this.Rpt_Distribute.DataBind();
        Pager.RecordCount = LDis.Rows.Count;
        page = Pager.CurrentPageIndex.ToString();
    }
Example #24
0
    public int Fanli  = 0; //是否启用返利
    protected void Page_Load(object sender, EventArgs e)
    {
        object obj = Request["action"];

        if (obj != null)
        {
            if (obj.ToString() == "dislist")
            {
                string compid = Request["compId"] + "";
                string disid  = Request["disId"] + "";
                Response.Write(disBing(compid, disid));
                Response.End();
            }
        }
        if (!IsPostBack)
        {
            DataTable dt = Common.BindDisList(this.CompID.ToString());//代理商绑定
            if (dt != null)
            {
                this.rptDisList.DataSource = dt;
                this.rptDisList.DataBind();
            }
            this.hidType2.Value  = Request.QueryString["type"] + "";//2 再次购买
            this.hidKeyId.Value  = KeyID.ToString();
            this.hidCompId.Value = this.CompID.ToString();
            Fanli = OrderInfoType.rdoOrderAudit("订单支付返利是否启用", CompID).ToInt(0);
            this.hidFanl.Value = Fanli.ToString();                                         //是否启用返利
            IsInve             = OrderInfoType.rdoOrderAudit("商品是否启用库存", CompID).ToInt(0); //是否启用库存
            //代理商列表
            List <Hi.Model.BD_Distributor> list = new Hi.BLL.BD_Distributor().GetList("ID,DisName", "isnull(dr,0)=0 and compid=" + this.CompID, "");
            this.divDisList.InnerText = ConvertJson.ToJson(Common.FillDataTable(list));
            if (KeyID != 0)
            {
                if (Request.QueryString["type"] + "" != "2")
                {
                    Hi.Model.DIS_Order model = new Hi.BLL.DIS_Order().GetModel(KeyID);
                    //判断订单是否可以修改  企业下单订单已审未支付,代理商下单企业不能修改
                    if (model.OState > (int)Enums.OrderState.待审核)
                    {
                        JScript.AlertAndRedirect("订单已被其他人修改,请刷新后再重新操作!", "orderdetail.aspx?top=1&KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey));
                        return;
                    }
                }
                else
                {
                    this.hidType.Value = Request.QueryString["type"] + "";
                }
                Bind();
            }
        }
    }
Example #25
0
    /// <summary>
    /// 代理商列表显示
    /// </summary>
    public void Bind()
    {
        //查询代理商
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = string.Empty;
        string IDlist    = string.Empty;//销售经理下属 员工ID集合

        if (DisSalesManID != 0)
        {
            if (Common.GetDisSalesManType(DisSalesManID.ToString(), out IDlist))
            {
                //销售经理
                strwhere = "and ID in(select ID from BD_Distributor where smid in(" + IDlist + "))";
            }
            else
            {
                strwhere = "and ID in(select ID from BD_Distributor where smid = " + DisSalesManID + ")";
            }
        }

        strwhere += " and dr=0 and AuditState=2 and CompID =" + CompID;

        if (ViewState["strwhere"] != null)
        {
            strwhere += ViewState["strwhere"].ToString();
        }

        if (this.txtPager.Value.Trim().ToString() != "")
        {
            if (this.txtPager.Value.Trim().Length >= 5)
            {
                Pager.PageSize      = 100;
                this.txtPager.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPager.Value.Trim().ToInt(0);
            }
        }



        List <Hi.Model.BD_Distributor> dis = new Hi.BLL.BD_Distributor().GetList(Pager.PageSize, Pager.CurrentPageIndex, "shortindex", true, strwhere, out pageCount, out Counts);

        this.rptDis.DataSource = dis;
        this.rptDis.DataBind();

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Example #26
0
    public void DataBinds()
    {
        txtDisAreaBox.CompID = Compid;
        txtDisType.CompID    = Compid;

        int pageCount = 0;
        int Counts    = 0;
        List <Hi.Model.BD_Distributor> LDis = new Hi.BLL.BD_Distributor().GetList(Pager.PageSize, Pager.CurrentPageIndex, "Createdate", false, SearchWhere(), out pageCount, out Counts);

        this.Rpt_Dis.DataSource = LDis;
        this.Rpt_Dis.DataBind();
        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Example #27
0
    public void DataBinds()
    {
        if (KeyID != 0)
        {
            Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID);
            if (Dis != null)
            {
                lblDisName.InnerText = Dis.DisName;
                //lblTyoeName.InnerText = Common.GetDisTypeNameById(Dis.DisTypeID);
                //lblAreaName.InnerText = Common.GetDisAreaNameById(Dis.AreaID);
                //lblDisLevel.InnerText = Dis.DisLevel;
                lblLeading.InnerText      = Dis.Leading;
                lblLeadingPhone.InnerText = Dis.LeadingPhone;
                lblFax.InnerText          = Dis.Fax;
                lblTel.InnerText          = Dis.Tel;
                lblLicence.InnerText      = Dis.Licence;
                lblPerson.InnerText       = Dis.Principal;
                lblPhone.InnerText        = Dis.Phone;
                lblAddress.InnerText      = Dis.Address;
                lblZip.InnerText          = Dis.Zip;
                lblRemark.InnerText       = Dis.Remark;
                lblIsEnabled.InnerHtml    = Dis.IsEnabled == 1 ? "启用" : "<i style='color:red;'>禁用</i>";

                if (Dis.IsEnabled == 1)
                {
                    libtnNUse.Visible = true;
                    libtnUse.Visible  = false;
                }
                else
                {
                    libtnUse.Visible  = true;
                    libtnNUse.Visible = false;
                }

                //rdAuditYes.InnerHtml = Dis.IsCheck == 1 ? "是" : "<i style='color:red;'>否</i>";
                //rdCreditYes.InnerHtml = Dis.CreditType == 0 ? "<i style='color:red;'>否</i>" : "是";
            }
            else
            {
                JScript.AlertMsg(this, "代理商不存在!");
                return;
            }
        }
        else
        {
            JScript.AlertMsg(this, "数据错误!");
            return;
        }
    }
Example #28
0
    /// <summary>
    /// 根据区域id得到代理商
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public string GetDisList(string areaId)
    {
        string aredIdList = Common.DisAreaId(Convert.ToInt32(areaId), this.CompID);//递归得到区域id
        List <Hi.Model.BD_Distributor> ll = new Hi.BLL.BD_Distributor().GetList("ID,DisName", "isnull(dr,0)=0 and compId=" + this.CompID + " and areaId in(" + aredIdList + ")", "");

        if (ll.Count > 0)
        {
            DataTable dt2 = Common.FillDataTable <Hi.Model.BD_Distributor>(ll);
            if (dt2.Rows.Count != 0)
            {
                return(ConvertJson.ToJson(dt2));
            }
        }
        return("[{}]");
    }
Example #29
0
    /// <summary>
    /// 查询代理商
    /// </summary>
    public void GetDis(int Id)
    {
        List <Hi.Model.BD_Distributor> li = new Hi.BLL.BD_Distributor().GetList("", " CompID=" + Id + "and isnull(AuditState,0)=2 and isnull(IsEnabled,0)=1 and isnull(dr,0)=0", "Id desc");

        if (li != null)
        {
            if (li.Count > 0)
            {
                foreach (Hi.Model.BD_Distributor item in li)
                {
                    Dislist.Add(item);
                }
            }
        }
    }
Example #30
0
    protected void Btn_Dis(object sender, EventArgs e)
    {
        List <Hi.Model.BD_Distributor> Ldis = new Hi.BLL.BD_Distributor().GetList("", "isnull(dr,0)=0 and id in (" + hidselectDis.Value + ")", "");

        if (Ldis.Count > 0)
        {
            tbdis.Attributes["style"] = "display:block;";
        }
        else
        {
            tbdis.Attributes["style"] = "display:none;";
        }
        Rpt_Dis.DataSource = Ldis;
        Rpt_Dis.DataBind();
    }