Exemplo n.º 1
0
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        if (BudgetManage_Cost_MoreBudget.organization)
        {
            OrganizationMonthBudget.DelAll(BudgetManage_Cost_MoreBudget.id);
            this.SaveDataToViewState();
            System.Collections.Generic.List <OrganizationMonthBudget> list = this.ViewState["Budget"] as System.Collections.Generic.List <OrganizationMonthBudget>;
            using (System.Collections.Generic.List <OrganizationMonthBudget> .Enumerator enumerator = list.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    OrganizationMonthBudget current = enumerator.Current;
                    current.Add(current);
                }
                goto IL_B7;
            }
        }
        IndirectMonthBudget.DelAll(BudgetManage_Cost_MoreBudget.id);
        this.SaveDataToViewState();
        System.Collections.Generic.List <IndirectMonthBudget> list2 = this.ViewState["Budget"] as System.Collections.Generic.List <IndirectMonthBudget>;
        foreach (IndirectMonthBudget current2 in list2)
        {
            current2.Add(current2);
        }
IL_B7:
        base.RegisterScript("top.ui.winSuccess();;");
    }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 protected void BindGV()
 {
     if (this.ViewState["Budget"] == null)
     {
         if (BudgetManage_Cost_MoreBudget.organization)
         {
             System.Collections.Generic.List <OrganizationMonthBudget> all = OrganizationMonthBudget.GetAll(BudgetManage_Cost_MoreBudget.id);
             this.ViewState["Budget"] = all;
         }
         else
         {
             System.Collections.Generic.List <IndirectMonthBudget> all2 = IndirectMonthBudget.GetAll(BudgetManage_Cost_MoreBudget.id);
             all2 = IndirectMonthBudget.GetAll(BudgetManage_Cost_MoreBudget.id);
             this.ViewState["Budget"] = all2;
         }
     }
     this.gvBudget.DataSource = this.ViewState["Budget"];
     this.gvBudget.DataBind();
 }
Exemplo n.º 4
0
 private bool RemoveSearch(IndirectMonthBudget budget)
 {
     System.Collections.Generic.List <string> listFromJson = JsonHelper.GetListFromJson(this.hfldCheckedIds.Value);
     return(this.IsExist(budget.Id, listFromJson));
 }