Ejemplo n.º 1
0
        private void SelectAllContactInfo()
        {
            Response.Clear();
            EyouSoft.IBLL.CompanyStructure.ICompanyUser bll = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance();

            string strContactName = string.Empty;

            if (!String.IsNullOrEmpty(Utils.GetFormValue("ContactName")))   // 输入筛选
            {
                strContactName = Utils.GetFormValue("ContactName");
            }
            StringBuilder str = new StringBuilder();

            EyouSoft.Model.CompanyStructure.QueryParamsUser param = new EyouSoft.Model.CompanyStructure.QueryParamsUser();
            param.UserName    = strContactName;
            param.IsShowAdmin = true;
            IList <EyouSoft.Model.CompanyStructure.CompanyUserBase> list = bll.GetList(CompanyID, param);

            if (list != null && list.Count > 0)
            {
                foreach (EyouSoft.Model.CompanyStructure.CompanyUserBase model in list)
                {
                    str.Append(model.ContactInfo.ContactName + "~&&~" + model.ContactInfo.Tel + "~&&~" + model.ContactInfo.MQ + "~&&~" + model.UserName + "\n");
                }
            }
            list = null;
            bll  = null;
            Response.Write(str.ToString());
            Response.End();
        }
Ejemplo n.º 2
0
        protected void LoadSonUserList()
        {
            IList <EyouSoft.Model.CompanyStructure.CompanyUser> sonUserList = sonUserBll.GetList(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount);

            if (sonUserList.Count > 0)
            {
                sum_rpt_SonUserList.DataSource = sonUserList;
                sum_rpt_SonUserList.DataBind();
                PageBind();//设置分页
            }
            else
            {
                sum_noData.Style.Remove("display");
                this.sum_ExportPageInfo1.Visible = false;
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //是否登录
            if (!IsLogin)
            {
                EyouSoft.Security.Membership.UserProvider.RedirectLoginOpenTopPage("/Default.aspx", "对不起,你尚未登录!");
                return;
            }
            if (!CheckGrant(TravelPermission.系统设置_子账户管理, TravelPermission.系统设置_权限管理))
            {
                Utils.ResponseNoPermit();
                return;
            }
            sonUserBll = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance();
            string method = Utils.GetQueryStringValue("method");

            if (method == "checkAccount")
            {
                IsIn();
                return;
            }
            string id = Utils.GetQueryStringValue("sonuserid");

            if (id != "")
            {
                sonUserModel = sonUserBll.GetModel(id);
            }
            if (!Page.IsPostBack)
            {
                haveArea = SiteUserInfo.CompanyRole.HasRole(EyouSoft.Model.CompanyStructure.CompanyType.专线);
                if (id == "" || method == "copy")
                {
                    sus_txtNewPassword1.Attributes.Add("valid", "required|limit");
                    sus_txtNewPassword1.Attributes.Add("errmsg", "请填写密码|密码长度为6-16个字符");
                    sus_txtNewPassword1.Attributes.Add("custom", "SonUserSet.checkPass");
                    sus_txtNewPassword1.Attributes.Add("min", "6");
                    sus_txtNewPassword1.Attributes.Add("max", "16");
                }
                else
                {
                    sus_txtNewPassword1.Attributes.Add("valid", "limit");
                    sus_txtNewPassword1.Attributes.Add("errmsg", "密码长度为6-16个字符");
                    sus_txtNewPassword1.Attributes.Add("custom", "SonUserSet.checkPass");
                    sus_txtNewPassword1.Attributes.Add("min", "6");
                    sus_txtNewPassword1.Attributes.Add("max", "16");
                }
                BindDepartAndRole();                        //绑定部门和角色
                BindManageArea();                           //绑定经营区域
                if (method == "update" || method == "copy") //如果是修改或复制则加载初始数据
                {
                    LoadSonUser(method);
                }
            }
            if (Page.IsPostBack)
            {
                //获取子账户经营区域
                List <EyouSoft.Model.SystemStructure.AreaBase> areaList = new List <EyouSoft.Model.SystemStructure.AreaBase>();
                var keyList = Request.Form.AllKeys.Where(key => key.Contains("checkbox_Area_"));
                foreach (string k in keyList)
                {
                    EyouSoft.Model.SystemStructure.AreaBase area = new EyouSoft.Model.SystemStructure.AreaBase();
                    area.AreaId = int.Parse(Utils.GetFormValue(k));
                    areaList.Add(area);
                }
                if (method == "update")//修改子账户
                {
                    UpdateSonUser(areaList);
                }
                if (method == "add" || method == "copy")//添加子账户
                {
                    int SonUserNumLimit = 0;
                    IList <EyouSoft.Model.CompanyStructure.CompanyUser> sonUserList = sonUserBll.GetList(SiteUserInfo.CompanyID, 1, 1, ref recordCount);
                    EyouSoft.Model.CompanyStructure.CompanySetting      comSeting   = EyouSoft.BLL.CompanyStructure.CompanySetting.CreateInstance().GetModel(SiteUserInfo.CompanyID);
                    if (comSeting != null)
                    {
                        SonUserNumLimit = comSeting.OperatorLimit;
                    }
                    //if (recordCount == SonUserNumLimit)
                    //{
                    //    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script>;alert('对不起,你只能建"+SonUserNumLimit+"个账户!');if(window.parent.Boxy){window.parent.Boxy.getIframeDialog('" + Request.QueryString["iframeId"] + "').hide();}else{window.close();}</script>");
                    //    return;
                    //}
                    AddSonUser(areaList);
                }
            }
        }