Exemplo n.º 1
0
    private void InitAspNetPager()
    {
        System.DateTime arg_05_0 = System.DateTime.Now;
        this.txtCode.Text                  = string.Empty;
        this.txtName.Text                  = string.Empty;
        this.txtSpecification.Text         = string.Empty;
        this.txtModelNumber.Text           = string.Empty;
        this.AspNetPager1.PageSize         = this.pagesize3;
        this.AspNetPager1.CurrentPageIndex = 1;
        if (string.IsNullOrEmpty(this.trvwResourceType.SelectedValue))
        {
            using (pm2Entities pm2Entities = new pm2Entities())
            {
                string typeId = (
                    from t in pm2Entities.Res_ResourceType
                    where t.ResourceTypeCode == this.dropResourceType.SelectedValue
                    select t.ResourceTypeId).FirstOrDefault <string>();
                cn.justwin.BLL.Resource resource = new cn.justwin.BLL.Resource();
                this.AspNetPager1.RecordCount = resource.GetResourceCount(typeId, string.Empty, string.Empty, string.Empty, string.Empty);
                goto IL_1B3;
            }
        }
        cn.justwin.BLL.Resource resource2 = new cn.justwin.BLL.Resource();
        this.AspNetPager1.RecordCount = resource2.GetResourceCoutByResourceType(this.trvwResourceType.SelectedValue, this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.txtSpecification.Text.Trim(), this.txtModelNumber.Text.Trim());
IL_1B3:
        System.DateTime arg_1B8_0 = System.DateTime.Now;
    }
Exemplo n.º 2
0
    private void InitResource()
    {
        if (string.IsNullOrEmpty(this.trvwResourceType.SelectedValue))
        {
            using (pm2Entities pm2Entities = new pm2Entities())
            {
                string typeId = (
                    from t in pm2Entities.Res_ResourceType
                    where t.ResourceTypeCode == this.dropResourceType.SelectedValue
                    select t.ResourceTypeId).FirstOrDefault <string>();
                cn.justwin.BLL.Resource resource = new cn.justwin.BLL.Resource();
                //DataTable resource2 = resource.GetResource(typeId, this.pagesize3, this.AspNetPager1.CurrentPageIndex, this.txtCode.Text.Trim(), this.txtName.Text.Trim());
                //this.AspNetPager1.RecordCount = resource.GetResourceCount(typeId, this.txtCode.Text.Trim(), this.txtName.Text.Trim());
                DataTable resource2 = resource.GetResource(typeId, this.pagesize3, this.AspNetPager1.CurrentPageIndex, this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.txtSpecification.Text.Trim(), this.txtModelNumber.Text.Trim());
                this.AspNetPager1.RecordCount = resource.GetResourceCount(typeId, this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.txtSpecification.Text.Trim(), this.txtModelNumber.Text.Trim());
                this.gvwResource.DataSource   = resource2;
                this.gvwResource.DataBind();
                return;
            }
        }
        cn.justwin.BLL.Resource resource3 = new cn.justwin.BLL.Resource();
        DataTable resourceByRerourceType  = resource3.GetResourceByRerourceType(this.trvwResourceType.SelectedValue, this.pagesize3, this.AspNetPager1.CurrentPageIndex, this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.txtSpecification.Text.Trim(), this.txtModelNumber.Text.Trim());

        this.AspNetPager1.RecordCount = resource3.GetResourceCoutByResourceType(this.trvwResourceType.SelectedValue, this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.txtSpecification.Text.Trim(), this.txtModelNumber.Text.Trim());
        this.gvwResource.DataSource   = resourceByRerourceType;
        this.gvwResource.DataBind();
    }