コード例 #1
0
ファイル: MoreBudget.aspx.cs プロジェクト: zxl881203/src
 protected void btnAdd_Click(object sender, System.EventArgs e)
 {
     if (BudgetManage_Cost_MoreBudget.organization)
     {
         System.Collections.Generic.List <OrganizationMonthBudget> list = new System.Collections.Generic.List <OrganizationMonthBudget>();
         if (this.ViewState["Budget"] != null)
         {
             this.SaveDataToViewState();
             list = (this.ViewState["Budget"] as System.Collections.Generic.List <OrganizationMonthBudget>);
         }
         OrganizationMonthBudget item = OrganizationMonthBudget.Create(System.Guid.NewGuid().ToString(), BudgetManage_Cost_MoreBudget.id, 0m, System.DateTime.Now.Year, System.DateTime.Now.Month);
         list.Add(item);
         if (list.Count > 1)
         {
             this.btnSave.Enabled = false;
         }
         else
         {
             this.btnSave.Enabled = true;
         }
         this.ViewState["Budget"] = list;
     }
     else
     {
         System.Collections.Generic.List <IndirectMonthBudget> list2 = new System.Collections.Generic.List <IndirectMonthBudget>();
         if (this.ViewState["Budget"] != null)
         {
             this.SaveDataToViewState();
             list2 = (this.ViewState["Budget"] as System.Collections.Generic.List <IndirectMonthBudget>);
         }
         IndirectMonthBudget item2 = IndirectMonthBudget.Create(System.Guid.NewGuid().ToString(), BudgetManage_Cost_MoreBudget.id, 0m, System.DateTime.Now.Year, System.DateTime.Now.Month);
         list2.Add(item2);
         if (list2.Count > 1)
         {
             this.btnSave.Enabled = false;
         }
         else
         {
             this.btnSave.Enabled = true;
         }
         this.ViewState["Budget"] = list2;
     }
     this.BindGV();
 }