Exemple #1
0
    public void BindGv()
    {
        this.aspNetPageBudget.PageSize    = NBasePage.pagesize;
        this.aspNetPageBudget.RecordCount = ResourceTemp.GetResourceTemCount(this.prjId);
        int num = this.aspNetPageBudget.CurrentPageIndex;

        if (num > this.aspNetPageBudget.PageCount)
        {
            num--;
        }
        //System.Collections.Generic.List<ResourceTemp> resourceTempByPrj = ResourceTemp.GetResourceTempByPrj(this.prjId, NBasePage.pagesize, num);
        DataTable dt = ResourceTemp.GetResourceTempByPrj_DT(this.prjId, NBasePage.pagesize, num);

        this.gvBudget.DataSource = dt;//resourceTempByPrj;

        this.gvBudget.DataBind();
        if (this.hfldIsWBSRelevance.Value == "0")
        {
            this.gvBudget.Columns[2].Visible = false;
        }
    }
Exemple #2
0
    protected void btnDel_Click(object sender, System.EventArgs e)
    {
        System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>();
        string value = this.hfldPurchaseChecked.Value;

        if (value.Contains('['))
        {
            list = JsonHelper.GetListFromJson(value);
        }
        else
        {
            list.Add(value);
        }
        try
        {
            ResourceTemp.DelResMapping(list);
        }
        catch
        {
        }
        this.BindGv();
    }
Exemple #3
0
 protected void btnBindResource_Click(object sender, System.EventArgs e)
 {
     if (this.hfldType.Value == "task")
     {
         if (!string.IsNullOrEmpty(this.hfldTaskId.Value))
         {
             ResourceTemp byId = ResourceTemp.GetById(this.hfldPurchaseChecked.Value.ToString());
             byId.BudTask = BudTask.GetById(this.hfldTaskId.Value.Trim());
             string inputUser = PageHelper.QueryUser(this, base.UserCode);
             ResourceTemp.Delete(byId, inputUser, this.hfldIsWBSRelevance.Value);
             this.BindGv();
             BudTaskService budTaskService = new BudTaskService();
             budTaskService.UpdateTotal2(this.hfldTaskId.Value.Trim());
         }
     }
     else
     {
         if (this.hfldType.Value == "resource" && !string.IsNullOrEmpty(this.hfldResourceIds.Value))
         {
             ResourceTemp byId2 = ResourceTemp.GetById(this.hfldPurchaseChecked.Value.ToString());
             byId2.ResourceId = this.hfldResourceIds.Value.Trim();
             byId2.BudTask    = BudTask.GetById(this.hfldTaskId.Value);
             string inputUser2 = PageHelper.QueryUser(this, base.UserCode);
             if (this.hfldIsWBSRelevance.Value == "1")
             {
                 byId2.BudTask = BudTask.GetById(this.hfldTaskId.Value);
             }
             ResourceTemp.Delete(byId2, inputUser2, this.hfldIsWBSRelevance.Value);
             this.BindGv();
             BudTaskService budTaskService2 = new BudTaskService();
             budTaskService2.UpdateTotal2(this.hfldTaskId.Value.Trim());
         }
     }
     this.hfldTaskId.Value            = "";
     this.hfldResourceIds.Value       = "";
     this.SelectResource1.ResourceId  = string.Empty;
     this.SelectResource1.ResTempType = string.Empty;
 }