예제 #1
0
 public void DataBinds()
 {
     Hi.Model.BD_DisSalesMan sale = new Hi.BLL.BD_DisSalesMan().GetModel(KeyID);
     if (sale != null)
     {
         if (sale.CompID != CompID)
         {
             Response.Write("你无权限访问。");
             Response.End();
         }
         if (sale.ParentID > 0)
         {
             lblSMParent.InnerText = Common.GetDisSMValue(sale.ParentID, "SalesName").ToString();
         }
         SMtype = sale.SalesType.ToString();
         lblSMType.InnerText   = Enum.GetName(typeof(Enums.DisSMType), sale.SalesType);
         lblSaleName.InnerText = sale.SalesName;
         lblSaleCode.InnerText = sale.SalesCode;
         lblPhone.InnerText    = sale.Phone;
         lblEmail.InnerText    = sale.Email;
         lblRemark.InnerText   = sale.Remark;
         lblstate.InnerHtml    = sale.IsEnabled == 1 ? "启用" : "<i style='color:red'>禁用</i>";
         if (sale.IsEnabled == 0)
         {
             btnbd.Visible = false;
         }
     }
     else
     {
         Response.Write("业务员不存在。");
         Response.End();
     }
 }
예제 #2
0
    public void Bind()
    {
        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_DisSalesMan> LAdminuser = new Hi.BLL.BD_DisSalesMan().GetList(Pager.PageSize, Pager.CurrentPageIndex, "id", false, SearchWhere(), out pageCount, out Counts);

        this.Rpt_Distribute.DataSource = LAdminuser;
        this.Rpt_Distribute.DataBind();
        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
예제 #3
0
파일: DisInfo.aspx.cs 프로젝트: kkwkk/ybyzt
    public void SelectDisSM(string value)
    {
        List <Hi.Model.BD_DisSalesMan> DisM = new Hi.BLL.BD_DisSalesMan().GetList("", " isnull(dr,0)=0 and IsEnabled=1 and Compid=" + CompID + "" + (value == "" ? "" : " and SalesName like '%" + value + "%'") + "", "");

        if (DisM.Count > 0)
        {
            string json = "[";
            foreach (Hi.Model.BD_DisSalesMan model in DisM)
            {
                json += "{\"name\":\"" + model.SalesName + "\",\"id\":" + model.ID + ",\"type\":\"" + Enum.GetName(typeof(Enums.DisSMType), model.SalesType) + "\"},";
            }
            if (json[json.Length - 1] == ',')
            {
                json = json.Substring(0, json.Length - 1);
            }
            json += "]";
            Response.Write(json);
            Response.End();
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }
예제 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string Action = Request["Action"] + "";
         string Name   = Request["Value"] + "";
         //if (Action == "GetPhone")
         //{
         //    Response.Write(ExistsUserPhone(Name));
         //    Response.End();
         //}
         List <Hi.Model.BD_DisSalesMan> ll = new Hi.BLL.BD_DisSalesMan().GetList("SalesName,ID", "IsEnabled=1 and ISNULL(dr,0)=0 and CompID=" + CompID + "", "");
         if (ll != null && ll.Count > 0)
         {
             DisSalesMan.DataSource     = ll;
             DisSalesMan.DataTextField  = "SalesName";
             DisSalesMan.DataValueField = "ID";
             DisSalesMan.DataBind();
             DisSalesMan.Items.Insert(0, new ListItem("请选择", "-1"));
             DisSalesMan.SelectedIndex = 0;
         }
         Databinds();
         //绑定权限  RepeaterRoles
         List <Hi.Model.SYS_Role> LDis = new Hi.BLL.SYS_Role().GetList("", " CompID=" + CompID + " AND DisID=0 AND dr=0 AND IsEnabled=1 ", "Createdate", null);
         this.RepeaterRoles.DataSource = LDis;
         this.RepeaterRoles.DataBind();
     }
 }
예제 #5
0
 protected void btn_Del(object sender, EventArgs e)
 {
     Hi.Model.BD_DisSalesMan sale = new Hi.BLL.BD_DisSalesMan().GetModel(KeyID);
     if (sale != null)
     {
         sale.dr         = 1;
         sale.ts         = DateTime.Now;
         sale.modifyuser = UserID;
         if (new Hi.BLL.BD_DisSalesMan().Update(sale))
         {
             //JScript.AlertMsgMo(this, "操作成功", "function(){ window.location.href='SaleManList.aspx'; }");
             Response.Redirect("SaleManList.aspx");
         }
     }
 }
예제 #6
0
 public void Databinds()
 {
     Hi.Model.BD_DisSalesMan sale = new Hi.BLL.BD_DisSalesMan().GetModel(KeyID);
     if (sale != null)
     {
         try
         {
             if (sale.CompID != CompID)
             {
                 Response.Write("你无权限访问。");
                 Response.End();
             }
             if (sale.SalesType == ((int)Enums.DisSMType.业务员))
             {
                 ddlSMParent.SelectedValue = sale.ParentID.ToString();
             }
             txtSMType.SelectedValue = sale.SalesType.ToString();
             txtSaleName.Value       = sale.SalesName;
             txtSaleCode.Value       = sale.SalesCode;
             txtPhone.Value          = sale.Phone;
             txtEmail.Value          = sale.Email;
             txtRemark.Value         = sale.Remark;
             int status = sale.IsEnabled;
             this.rdoStatus1.Checked = (status != 1);
             this.rdoStatus0.Checked = (status == 1);
         }
         catch (Exception ex)
         {
         }
     }
     else
     {
         if (Request["posttype"] == "1")
         {
             first.Visible             = false;
             right.Style["margin-top"] = "0";
         }
     }
 }
예제 #7
0
파일: DisInfo.aspx.cs 프로젝트: kkwkk/ybyzt
 protected void btnSMBind_Click(object sender, EventArgs e)
 {
     if (HidSM.Value.ToInt(0) > 0)
     {
         List <Hi.Model.BD_DisSalesMan> models = new Hi.BLL.BD_DisSalesMan().GetList("id", " isnull(dr,0)=0 and IsEnabled=1 and Compid=" + CompID + "  and  ID=" + HidSM.Value.ToInt(0) + " ", "");
         if (models.Count == 0)
         {
             JScript.AlertMethod(this, "绑定的业务员不是合法有效的!", JScript.IconOption.错误, "function (){ location.href=location.href; }");
             return;
         }
         Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID);
         if (Dis != null)
         {
             Dis.SMID       = HidSM.Value.ToInt(0);
             Dis.modifyuser = UserID;
             Dis.ts         = DateTime.Now;
             if (new Hi.BLL.BD_Distributor().Update(Dis))
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "this", "<script>location.href=location.href;</script>");
             }
         }
     }
 }
예제 #8
0
    /// <summary>
    /// 绑定数据
    /// </summary>
    public void DataBinds()
    {
        #region 优化角色权限之前的代码
        //if (KeyID!=0)
        //{
        //    int pageCount = 0;
        //    int Counts = 0;
        //    string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on  SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 ";
        //    DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(1, 1, "SYS_CompUser.createdate", true, " SYS_CompUser.id,Address,SYS_CompUser.RoleId,UserName,SYS_CompUser.createdate,TrueName,Phone,Identitys,Email,SYS_CompUser.IsEnabled,SYS_CompUser.CompID ", JoinTableStr, " and SYS_CompUser.id=" + KeyID + " and SYS_CompUser.Compid=" + CompID + " and ctype=1 ", out pageCount, out Counts);
        //    if (LUser.Rows.Count>0 )
        //    {
        //        if (LUser.Rows[0]["IsEnabled"].ToString().ToInt(0) == 1)
        //        {
        //            libtnUse.Visible = false;
        //        }
        //        else
        //        {
        //            libtnDel.Visible = false;
        //        }
        //        //Hi.Model.SYS_Role ll = new Hi.BLL.SYS_Role().GetModel(LUser.Rows[0]["RoleId"].ToString().ToInt(0));
        //        lblTrueName.InnerText = LUser.Rows[0]["TrueName"].ToString();
        //        //lblSex.InnerText = User.Sex;
        //        lblPhone.InnerText = LUser.Rows[0]["Phone"].ToString();
        //        //lblTel.InnerText = User.Tel;
        //        lblIdentitys.InnerText = LUser.Rows[0]["Identitys"].ToString();
        //        lblIsEnabled.InnerText = LUser.Rows[0]["IsEnabled"].ToString().ToInt(0) == 1 ? "启用" : "禁用";
        //        lblEmail.InnerText = LUser.Rows[0]["Email"].ToString();
        //        //if (ll != null)
        //        //{
        //        //    lblRoleId.InnerText = ll.RoleName;
        //        //}
        //        //lblUserLoginName.InnerText = User.UserLoginName.ToString();
        //        lblUserName.InnerText = LUser.Rows[0]["UserName"].ToString();
        //        lblAddress.InnerText = LUser.Rows[0]["Address"].ToString();
        //    }
        //    else
        //    {
        //        JScript.AlertMethod(this, "用户不存在!", JScript.IconOption.错误, "function (){ if(window.parent.Layerclose){ window.parent.Layerclose(); } history.go(-1) ; }");
        //        return;
        //    }
        //}
        //else
        //{
        //    JScript.AlertMethod(this, "数据错误!", JScript.IconOption.错误, "function (){ if(window.parent.Layerclose){ window.parent.Layerclose(); }  history.go(-1) ; }");
        //    return;
        //}

        //if (KeyID!=0)
        //{
        //    Hi.Model.SYS_Users user = new Hi.BLL.SYS_Users().GetModel(KeyID);
        //    lblTrueName.InnerText =user.TrueName.ToString();
        //    //lblSex.InnerText = User.Sex;
        //    lblPhone.InnerText = user.Phone.ToString();
        //    //lblTel.InnerText = User.Tel;
        //    lblIdentitys.InnerText = user.Identitys.ToString();
        //    lblIsEnabled.InnerText = user.IsEnabled.ToString().ToInt(0) == 1 ? "启用" : "禁用";
        //    //if (user.Type.ToString().ToInt(0) == 3)
        //    //{
        //    //    lbltype.InnerText = "用户";
        //    //}
        //    //if (user.Type.ToString().ToInt(0) == 4)
        //    //{
        //    //    lbltype.InnerText = "管理员";
        //    //}
        //    lblEmail.InnerText = user.Email.ToString();
        //    //if (ll != null)
        //    //{
        //    //    lblRoleId.InnerText = ll.RoleName;
        //    //}
        //    //lblUserLoginName.InnerText = User.UserLoginName.ToString();
        //    lblUserName.InnerText = user.UserName.ToString();
        //    lblAddress.InnerText = user.Address.ToString();
        //}
        //else
        //{
        //    JScript.AlertMethod(this, "数据错误!", JScript.IconOption.错误, "function (){ if(window.parent.Layerclose){ window.parent.Layerclose(); }  history.go(-1) ; }");
        //    return;
        //}

        #endregion
        if (KeyID != 0)
        {
            //Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(KeyID);
            int    pageCount    = 0;
            int    Counts       = 0;
            string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on  SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 ";

            DataTable dt = new Hi.BLL.SYS_CompUser().GetList(1, 1, "SYS_CompUser.ID", true, "SYS_CompUser.DisID,SYS_CompUser.id,Address,SYS_CompUser.RoleId,UserName,SYS_CompUser.createdate,TrueName,Phone,Identitys,Email,SYS_CompUser.IsEnabled,SYS_CompUser.CompID,SYS_CompUser.UType,SYS_CompUser.DisSalesManID", JoinTableStr, " and SYS_CompUser.CompID=" + this.CompID + " and SYS_CompUser.UserID= " + KeyID, out pageCount, out Counts);
            if (dt != null && dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["IsEnabled"].ToString().ToInt(0) == 1)
                {
                    libtnUse.Visible    = false;
                    libtnDel.Visible    = true;
                    libtnDelete.Visible = false;
                }
                else
                {
                    libtnDel.Visible    = false;
                    libtnUse.Visible    = true;
                    libtnDelete.Visible = true;
                }

                //Hi.Model.SYS_Role ll = new Hi.BLL.SYS_Role().GetModel(dt.Rows[0]["RoleID"].ToString().ToInt(0));
                lblTrueName.InnerText = dt.Rows[0]["TrueName"].ToString();
                //lblSex.InnerText = User.Sex;
                lblPhone.InnerText = dt.Rows[0]["Phone"].ToString();
                //lblTel.InnerText = User.Tel;
                lblIdentitys.InnerText = dt.Rows[0]["Identitys"].ToString();
                lblIsEnabled.InnerText = dt.Rows[0]["IsEnabled"].ToString().ToInt(0) == 1 ? "启用" : "禁用";
                lblEmail.InnerText     = dt.Rows[0]["Email"].ToString();
                //if (ll != null)
                //{
                //    lblRoleId.InnerText = ll.RoleName;
                //}
                //lblUserLoginName.InnerText = User.UserLoginName.ToString();
                lblUserName.InnerText = dt.Rows[0]["UserName"].ToString();
                lblAddress.InnerText  = dt.Rows[0]["Address"].ToString();

                string UserType = dt.Rows[0]["UType"].ToString() == "1"? "代理商用户": dt.Rows[0]["UType"].ToString() == "2" ? "公共用户" : dt.Rows[0]["UType"].ToString() == "3" ? "厂商用户" : dt.Rows[0]["UType"].ToString() == "4" ? "厂商管理员" : dt.Rows[0]["UType"].ToString() == "5" ? "代理商管理员" : dt.Rows[0]["UType"].ToString() == "6" ? "企业销售员" : "无";
                if (dt.Rows[0]["UType"].ToString() == "6")
                {
                    Hi.Model.BD_DisSalesMan man = new Hi.BLL.BD_DisSalesMan().GetModel(Convert.ToInt32(dt.Rows[0]["DisSalesManID"].ToString()));
                    UserType += "(" + man.SalesName + ")";
                }
                UserTypes.InnerText = UserType;//绑定业务员类型
            }
            else
            {
                JScript.AlertMsgOne(this, "用户不存在!", JScript.IconOption.错误, 2500);
                return;
            }
        }
        else
        {
            JScript.AlertMsgOne(this, "数据错误!", JScript.IconOption.错误, 2500);
            return;
        }
    }
예제 #9
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (txtSMType.SelectedValue == ((int)Enums.DisSMType.业务员).ToString())
        {
            if (ddlSMParent.SelectedValue == "" || ddlSMParent.SelectedValue == "-1")
            {
                JScript.AlertMethod(this, "请选择业务经理!", JScript.IconOption.错误, "function (){ location.href=location.href; }");
                return;
            }
        }
        Hi.Model.BD_DisSalesMan sale = null;
        if (KeyID != 0)
        {
            sale           = new Hi.BLL.BD_DisSalesMan().GetModel(KeyID);
            sale.SalesType = Convert.ToInt32(txtSMType.SelectedValue);
            if (txtSMType.SelectedValue == ((int)Enums.DisSMType.业务员).ToString())
            {
                sale.ParentID = ddlSMParent.SelectedValue.ToInt(0);
            }
            else
            {
                sale.ParentID = 0;
            }
            sale.SalesName = Common.NoHTML(txtSaleName.Value.Trim());
            sale.SalesCode = Common.NoHTML(txtSaleCode.Value.Trim());
            sale.Phone     = Common.NoHTML(txtPhone.Value.Trim());
            sale.Email     = Common.NoHTML(txtEmail.Value.Trim());
            sale.Remark    = Common.NoHTML(txtRemark.Value.Trim());
            if (this.rdoStatus1.Checked)
            {
                sale.IsEnabled = 0;
            }
            else
            {
                sale.IsEnabled = 1;
            }

            sale.ts         = DateTime.Now;
            sale.modifyuser = UserID;
            if (new Hi.BLL.BD_DisSalesMan().Update(sale))
            {
                //JScript.AlertMsgMo(this, "操作成功", "function(){ window.location.href='SaleManInfo.aspx?KeyID=" + KeyID + "'; }");
                Response.Redirect("SaleManInfo.aspx?KeyID=" + KeyID + "");
            }
        }
        else
        {
            sale           = new Hi.Model.BD_DisSalesMan();
            sale.SalesType = Convert.ToInt32(txtSMType.SelectedValue);
            if (txtSMType.SelectedValue == ((int)Enums.DisSMType.业务员).ToString())
            {
                sale.ParentID = ddlSMParent.SelectedValue.ToInt(0);
            }
            else
            {
                sale.ParentID = 0;
            }
            sale.CompID    = CompID;
            sale.SalesName = Common.NoHTML(txtSaleName.Value.Trim());
            sale.SalesCode = Common.NoHTML(txtSaleCode.Value.Trim());
            sale.Phone     = Common.NoHTML(txtPhone.Value.Trim());
            sale.Email     = Common.NoHTML(txtEmail.Value.Trim());
            sale.Remark    = Common.NoHTML(txtRemark.Value.Trim());
            if (this.rdoStatus1.Checked)
            {
                sale.IsEnabled = 0;
            }
            else
            {
                sale.IsEnabled = 1;
            }

            //标准参数
            sale.CreateDate   = DateTime.Now;
            sale.CreateUserID = UserID;
            sale.ts           = DateTime.Now;
            sale.modifyuser   = UserID;
            int newuserid = 0;
            newuserid = new Hi.BLL.BD_DisSalesMan().Add(sale);
            if (newuserid > 0)
            {
                if (Request["posttype"] == "1")
                {
                    if (txtSMType.SelectedValue == ((int)Enums.DisSMType.业务员).ToString())
                    {
                        this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "msg", "<script>cancel('" + txtSaleName.Value.Trim() + " [业务员]'," + newuserid + ")</script>");
                    }
                    else
                    {
                        this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "msg", "<script>cancel('" + txtSaleName.Value.Trim() + " [业务经理]'," + newuserid + ")</script>");
                    }
                }
                else
                {
                    Response.Redirect("SaleManInfo.aspx?KeyID=" + newuserid);
                }
            }
        }
    }
예제 #10
0
파일: DisInfo.aspx.cs 프로젝트: kkwkk/ybyzt
    //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);
    //                        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", "AnnexDel(this,'Dis'," + KeyID + ",'" + file + "')");
    //                    //div.Controls.Add(img);
    //                    DFile.Controls.Add(div);
    //                }
    //            }
    //        }
    //    }
    //}

    public void DataBinds()
    {
        //Common.BindMan(this.rptUnit, this.CompID);//绑定单位下拉
        if (Request["type"] == "0")
        {
            btitle.InnerText = "代理商审核";
            lblbtnback.Attributes["onclick"] = "javascript:window.location.href='DisAuditList.aspx';";
            this.btitle.Attributes.Add("href", "../SysManager/DisAuditList.aspx");
        }
        else if (Request["type"] == "3")
        {
            Atitle.InnerText = "代理商管理员查询";
            lblbtnback.Attributes["onclick"] = "javascript:window.location.href='DisUserList.aspx';";
            this.btitle.Attributes.Add("href", "../SysManager/DisUserList.aspx");
        }
        else if (Request["type"] == "2")
        {
            Atitle.InnerText = "代理商信息维护";
            if (Request["nextstep"] != null && Request["nextstep"] == "1")
            {
                lblbtnback.Attributes["onclick"] = "javascript:window.location.href='DisList.aspx?nextstep=1';";
                this.btitle.Attributes.Add("href", "../SysManager/DisList.aspx?nextstep=1");
            }
            else
            {
                lblbtnback.Attributes["onclick"] = "javascript:window.location.href='DisList.aspx';";
                this.btitle.Attributes.Add("href", "../SysManager/DisList.aspx");
            }
        }
        else if (Request["type"] == "4")
        {
            Atitle.InnerText = "代理商信息维护";
            lblbtnback.Attributes["onclick"] = "javascript:window.location.href='DisEdit.aspx?KeyID=" + KeyID + "';";
        }
        Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID);
        if (Dis != null)
        {
            if (Dis.dr == 1)
            {
                if (Request.UrlReferrer != null)
                {
                    JScript.AlertMethod(this, "代理商不存在!", JScript.IconOption.错误, "function (){ history.go(-1); }");
                    Response.End();
                    return;
                }
                else
                {
                    Response.Write("数据错误。");
                    Response.End();
                }
            }
            LoginModel Lmodel = HttpContext.Current.Session["UserModel"] as LoginModel;
            //暂时屏蔽 edit by hgh  180125
            //if (Dis.CompID != Lmodel.CompID)
            //{
            //    if (Request.UrlReferrer != null)
            //    {
            //        JScript.AlertMethod(this, "代理商不存在!", JScript.IconOption.错误, "function (){ history.go(-1); }");
            //        Response.End();
            //        return;
            //    }
            //    else
            //    {
            //        Response.Write("代理商不存在!");
            //        Response.End();
            //    }
            //}

            if (Request["type"] == "3")
            {
                libtnAudit.Visible = false;
                libtnDel.Visible   = false;
                libtnEdit.Visible  = false;
                libtnUse.Visible   = false;
                libtnNUse.Visible  = false;
            }
            if (Request["type"] == "0")
            {
                libtnEdit.Visible = false;
                libtnUse.Visible  = false;
                libtnNUse.Visible = false;
            }

            lblDisName.Value = Dis.DisName;
            DisCode.Value    = Dis.DisCode;
            if (Dis.SMID > 0)
            {
                txtSaleMan.Value = Common.BindManName(Dis.SMID, CompID);
                Hi.Model.BD_DisSalesMan SMmodel = new Hi.BLL.BD_DisSalesMan().GetModel(Dis.SMID);
                if (SMmodel != null)
                {
                    //ddlSMType.SelectedValue = SMmodel.SalesType.ToString();
                    //lblSMName.InnerText = SMmodel.SalesName;
                }
            }
            //lblTyoeName.Value = Common.GetDisTypeNameById(Dis.DisTypeID);
            //lblAreaName.Value = Common.GetDisAreaNameById(Dis.AreaID);
            //lblLeading.InnerText = Dis.Leading;
            //lblLeadingPhone.InnerText = Dis.LeadingPhone;
            //lblDisLevel.Value = Dis.DisLevel;
            lblFax.Value = Dis.Fax;
            //lblTel.InnerText = Dis.Tel;
            //lblLicence.InnerText = Dis.Licence;
            lblPerson.Value  = Dis.Principal;
            lblPhone.Value   = Dis.Phone;
            lblAddress.Value = Dis.Province + Dis.City + Dis.Area + Dis.Address;
            lblZip.Value     = Dis.Zip;
            //lblFinancingRatio.InnerText = Dis.FinancingRatio.ToString("0.00") + " %";
            lblRemark.Value = Dis.Remark;
            //lblIsEnabled.InnerHtml = Dis.IsEnabled == 1 ? "启用" : "<i style='color:red;'>禁用</i>";
            //rdAuditYes.InnerHtml = Dis.IsCheck == 1 ? "是" : "<i style='color:red;'>否</i>";
            //rdCreditYes.InnerHtml = Dis.CreditType == 0 ? "<i style='color:red;'>否</i>" : "是";
            //lblCreditAmount.Value = Dis.CreditAmount.ToString("0.00") == "0.00" ? "没有限额" : Dis.CreditAmount.ToString("0.00");
            //if (Dis.CreditType == 0)
            //{
            //    this.spanCreditAmount.Style.Add("display", "none");
            //    this.lblCreditAmount.Style.Add("display", "none");
            //}
            //this.Integral.InnerHtml = Dis.Integral.ToString("0.00");
        }
        else
        {
            if (Request.UrlReferrer != null)
            {
                Response.Write("代理商不存在!");
                Response.End();
                return;
            }
            else
            {
                Response.Write("代理商不存在!");
                Response.End();
            }
            return;
        }
    }
예제 #11
0
    public void Databinds()
    {
        #region 更新角色权限前的代码
        //if (KeyID != 0)
        //{
        //    int pageCount = 0;
        //    int Counts = 0;
        //    string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on  SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 ";
        //    DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(1, 1, "SYS_CompUser.createdate", true, " SYS_CompUser.id,Users.id userid,Address,UserPwd, SYS_CompUser.RoleId,UserName,SYS_CompUser.createdate,TrueName,Phone,Identitys,Email,SYS_CompUser.IsEnabled,SYS_CompUser.CompID,Utype ", JoinTableStr, " and SYS_CompUser.id=" + KeyID + " and SYS_CompUser.Compid=" + CompID + " and ctype=1 ", out pageCount, out Counts);
        //    if (User != null)
        //    {
        //        try
        //        {
        //            ViewState["Userid"] = LUser.Rows[0]["userid"].ToString();
        //            txtTrueName.Value = LUser.Rows[0]["TrueName"].ToString(); ;
        //            txtPhone.Value = LUser.Rows[0]["Phone"].ToString();
        //            //txtTel.Value = User.Tel;
        //            txtIdentitys.Value = LUser.Rows[0]["Identitys"].ToString();
        //            txtAddress.Value = LUser.Rows[0]["Address"].ToString();
        //            txtEmail.Value = LUser.Rows[0]["Email"].ToString();
        //            txtUserName.Value = LUser.Rows[0]["UserName"].ToString();
        //            txtUserPwd.Attributes.Add("value", Util.md5("123456"));
        //            txtPwd.Attributes.Add("value", Util.md5("123456"));
        //            if (LUser.Rows[0]["IsEnabled"].ToString().ToInt(0) != 1)
        //            {
        //                rdEnabledNo.Checked = true;
        //                rdEnabledYes.Checked = false;
        //            }
        //            if (LUser.Rows[0]["Utype"].ToString() == "4")
        //            {
        //                txtPhone.Disabled = true;
        //                txtUserName.Disabled = true;
        //            }
        //        }
        //        catch (Exception ex)
        //        {
        //            Response.Write("获取信息异常!");
        //            Response.End();
        //        }
        //    }
        //    else
        //    {
        //        JScript.AlertMethod(this, "用户不存在!", JScript.IconOption.错误, "function (){ history.go(-1) ; }");
        //        return;
        //    }
        //}
        //else
        //{
        //    //新增操作
        //}
        #endregion
        if (KeyID != 0)
        {
            Hi.Model.SYS_Users user = new Hi.BLL.SYS_Users().GetModel(KeyID);
            if (user != null)
            {
                try
                {
                    txtTrueName.Value  = user.TrueName.ToString();;
                    txtPhone.Value     = user.Phone.ToString();
                    txtIdentitys.Value = user.Identitys.ToString();
                    txtAddress.Value   = user.Address.ToString();
                    txtEmail.Value     = user.Email.ToString();
                    txtUserName.Value  = user.UserName.ToString();
                    //txtUserPwd.Text = user.UserPwd.ToString();
                    //txtPwd.Text = user.UserPwd.ToString();
                    txtUserPwd.Attributes.Add("value", user.UserPwd.ToString());
                    txtPwd.Attributes.Add("value", user.UserPwd.ToString());
                    if (user.IsEnabled.ToString().ToInt(0) != 1)
                    {
                        rdEnabledNo.Checked  = true;
                        rdEnabledYes.Checked = false;
                    }

                    List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("*", "   userid=" + KeyID + " and Compid=" + CompID + " and ctype=1 ", "");
                    if (ListCompUser.Count > 0)
                    {
                        if (ListCompUser[0].DisSalesManID > 0)
                        {
                            DisSalesManID.Value = ListCompUser[0].DisSalesManID.ToString();

                            Radio2.Checked = true;
                            Radio1.Checked = false;
                            Hi.Model.BD_DisSalesMan man = new Hi.BLL.BD_DisSalesMan().GetModel(ListCompUser[0].DisSalesManID);
                            SalesManNames.InnerText   = "(业务员:" + man.SalesName + ")";
                            DisSalesMan.SelectedValue = ListCompUser[0].DisSalesManID.ToString();
                        }
                    }
                    if (ListCompUser[0].UType.ToString().ToInt(0) == 4)
                    {
                        txtPhone.Disabled    = true;
                        txtUserName.Disabled = true;
                        this.Radio1.Disabled = true;
                        this.Radio2.Disabled = true;
                    }
                }
                catch (Exception ex)
                {
                    Response.Write("获取信息异常!");
                    Response.End();
                }
            }
            else
            {
                JScript.AlertMethod(this, "用户不存在!", JScript.IconOption.错误, "function (){ history.go(-1) ; }");
                return;
            }
        }
    }