private List <DataList> SubordinateList(Pagination pagination, Guid id)
        {
            var condition = new SubordinateQueryParameter();

            condition.Superior         = id;
            condition.RelationshipType = RelationshipType.Organization;
            if (!string.IsNullOrWhiteSpace(txtUserName.Text))
            {
                condition.UserNo = this.txtUserName.Text.Trim();
            }
            if (!string.IsNullOrWhiteSpace(this.txtAbberviateName.Text))
            {
                condition.AbbreviateName = this.txtAbberviateName.Text.Trim();
            }
            if (!string.IsNullOrWhiteSpace(this.txtStartDate.Text))
            {
                condition.RegisterTimeStart = DateTime.Parse(this.txtStartDate.Text);
            }
            if (!string.IsNullOrWhiteSpace(this.txtEndDate.Text))
            {
                condition.RegisterTimeEnd = DateTime.Parse(this.txtEndDate.Text).AddDays(1).AddMilliseconds(-3);
            }
            var spreadingList = CompanyService.GetAllSubordinates(condition, pagination).Select(item => new DataList
            {
                Type             = "内部机构",
                AbbreviateName   = item.AbbreviateName,
                City             = AddressShow.GetCity(item.City),
                Contact          = item.Contact,
                ContactCellphone = item.ContactPhone,
                Admin            = item.UserNo,
                RegisterTime     = item.RegisterTime.ToString("yyyy-MM-dd HH:mm:ss")
            }).ToList();

            return(spreadingList);
        }
Exemple #2
0
        private SubordinateQueryParameter getSearchParameter()
        {
            var param = new SubordinateQueryParameter();

            if (!string.IsNullOrWhiteSpace(txtAbbreviateName.Text))
            {
                param.AbbreviateName = txtAbbreviateName.Text.Trim();
            }
            if (!string.IsNullOrWhiteSpace(txtUserName.Text))
            {
                param.UserNo = txtUserName.Text.Trim();
            }
            if (!string.IsNullOrWhiteSpace(txtContact.Text))
            {
                param.Contact = txtContact.Text.Trim();
            }
            param.Superior = CompanyId;
            if (!string.IsNullOrEmpty(ddlAccountType.SelectedValue))
            {
                param.AccountType = (AccountBaseType)byte.Parse(ddlAccountType.SelectedValue);
            }

            if (!string.IsNullOrWhiteSpace(ddlStatus.SelectedValue.Trim()))
            {
                param.Enabled = ddlStatus.SelectedValue == "1";
            }
            if (!string.IsNullOrWhiteSpace(this.ddlRelationType.SelectedValue))
            {
                param.RelationshipType = (RelationshipType)int.Parse(this.ddlRelationType.SelectedValue);
            }
            return(param);
        }