Exemple #1
0
 protected void UpdateAccountAndState(System.Collections.Generic.IDictionary <string, decimal> dicBudAmount, string prjId, string state)
 {
     if (dicBudAmount.Count > 0)
     {
         System.Collections.Generic.List <string> listFromJson = JsonHelper.GetListFromJson(this.hfldCheckeds.Value);
         foreach (string current in dicBudAmount.Keys)
         {
             string  text          = current;
             decimal accountAmount = dicBudAmount[current];
             if (listFromJson.Contains(text))
             {
                 if (this.ddlYear.SelectedValue == "zzjg")
                 {
                     OrganizationBudget byId = OrganizationBudget.GetById(text);
                     byId.State         = state;
                     byId.AccountAmount = accountAmount;
                     byId.Update(byId);
                 }
                 else
                 {
                     IndirectBudget byId2 = IndirectBudget.GetById(text);
                     byId2.AccountAmount = accountAmount;
                     byId2.State         = state;
                     byId2.Update(byId2);
                 }
             }
         }
     }
 }
Exemple #2
0
 protected void UpdateBudget(System.Collections.Generic.IDictionary <string, decimal> dicBudAmount, string prjId)
 {
     if (dicBudAmount.Count > 0)
     {
         foreach (string current in dicBudAmount.Keys)
         {
             string         text = current;
             decimal        num  = dicBudAmount[current];
             IndirectBudget byPrjIdAndCBSCode = IndirectBudget.GetByPrjIdAndCBSCode(prjId, text);
             if (byPrjIdAndCBSCode != null)
             {
                 byPrjIdAndCBSCode.AccountAmount = num;
                 byPrjIdAndCBSCode.Update(byPrjIdAndCBSCode);
             }
             else
             {
                 IndirectBudget indirectBudget = IndirectBudget.Create(System.Guid.NewGuid().ToString(), prjId, text, num, num, BudgetManage_Cost_IndirectBudget.inputUser, System.DateTime.Now, string.Empty);
                 indirectBudget.Add(indirectBudget);
             }
         }
     }
 }