Ejemplo n.º 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);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 protected void SaveData()
 {
     System.Collections.Generic.IDictionary <string, decimal> budgetAmount = this.GetBudgetAmount();
     if (this.year == "zzjg")
     {
         bool flag = OrganizationBudget.IsExistOrgan(this.prjId);
         if (flag)
         {
             this.UpdateOrganBudget(budgetAmount, this.prjId);
             return;
         }
         this.AddOrganBudget(budgetAmount, this.prjId);
         return;
     }
     else
     {
         bool flag = IndirectBudget.IsExistPrjId(this.prjId);
         if (flag)
         {
             this.UpdateBudget(budgetAmount, this.prjId);
             return;
         }
         this.AddBudget(budgetAmount, this.prjId);
         return;
     }
 }
Ejemplo n.º 3
0
        void IOrganizationService.Save(Organization organization)
        {
            var end   = DateTime.Now;
            var start = DateTime.Now;

            Debug.WriteLine("###Entering save service:: " + start);
            //try find current user as admin
            int userGuid = this.userService.CurrentUserId;

            var admin = this.personService.GetUserAsAdmin(userGuid);

            if (organization.Id == 0)
            {
                start = DateTime.Now;
                Debug.WriteLine("Insert org begin: " + start);
                //if not already admin, create a new one
                if (admin == null)
                {
                    organization.Admin        = new Admin();
                    organization.Admin.Person = this.personService.Get(userGuid);
                }
                //else, associated existing to the org
                else
                {
                    organization.Admin = admin;
                }
                //if not already a subscription, create a new one
                if (organization.Subscription == null)
                {
                    organization.Subscription = new Subscription();
                    OrganizationBudget priceTier = subscriptionService.GetPriceTier(organization.EIN);
                    //TODO: Change this to zero whenever paid features are added
                    organization.Subscription.Status    = SubscriptionStatus.ACTIVE;
                    organization.Subscription.PriceTier = priceTier;
                }
                this.organizationRepository.Insert(organization);

                //add user to administrator role (if new administrator)
                //this.userService.AddUserToRoles(user.UserName, "OrganizationAdmin");
                end = DateTime.Now;
                Debug.WriteLine("Insert org toal: " + end.Subtract(start));
                start = DateTime.Now;
                Debug.WriteLine("Email begin: " + start);
                this.emailHelper.SendOrganizationAdminWelcomeMail(organization.Admin.Person.FirstName, organization.Admin.Person.ContactInformation.Email1);
                end = DateTime.Now;
                Debug.WriteLine("Email toal: " + end.Subtract(start));
            }
            else
            {
                if (admin != null)
                {
                    this.organizationRepository.Update(organization);
                }
            }
            unitOfWork.Commit();
            end = DateTime.Now;
            Debug.WriteLine("###Complete save time: " + end.Subtract(start));
        }
Ejemplo n.º 4
0
 public void BindGv()
 {
     if (this.ddlYear.SelectedValue == "zzjg")
     {
         this.gvBudget.DataSource = OrganizationBudget.GetAllNotEReport(this.tvBudget.SelectedValue);
     }
     else
     {
         this.gvBudget.DataSource = IndirectBudget.GetAllNotEReport(this.tvBudget.SelectedValue);
     }
     this.gvBudget.DataBind();
 }
Ejemplo n.º 5
0
 public void BindGv()
 {
     if (this.year == "zzjg")
     {
         this.gvBudget.DataSource = OrganizationBudget.GetAllPass(this.prjId);
     }
     else
     {
         this.gvBudget.DataSource = IndirectBudget.GetAllPass(this.prjId);
     }
     this.gvBudget.DataBind();
 }
Ejemplo n.º 6
0
 protected void Bind(string id)
 {
     try
     {
         new System.Guid(id);
         this.gvBudget.DataSource = IndirectBudget.GetAll(id);
     }
     catch
     {
         this.gvBudget.DataSource = OrganizationBudget.GetAll(id);
         this.lblPrjOrgName.Text  = "组织机构名称";
     }
     this.gvBudget.DataBind();
 }
Ejemplo n.º 7
0
 protected void AddOrganBudget(System.Collections.Generic.IDictionary <string, decimal> dicBudAmount, string organizationBudgetId)
 {
     if (dicBudAmount.Count > 0)
     {
         foreach (string current in dicBudAmount.Keys)
         {
             System.Guid.NewGuid().ToString();
             string             empty = string.Empty;
             string             code  = current;
             decimal            num   = dicBudAmount[current];
             OrganizationBudget organizationBudget = OrganizationBudget.Create(System.Guid.NewGuid().ToString(), organizationBudgetId, code, num, num, BudgetManage_Cost_IndirectBudget.inputUser, System.DateTime.Now, empty);
             organizationBudget.Add(organizationBudget);
         }
     }
 }
Ejemplo n.º 8
0
 protected void DelDesktopNotifi()
 {
     if (this.ddlYear.SelectedValue == "zzjg")
     {
         if (!OrganizationBudget.isHaveEReport(this.tvBudget.SelectedValue))
         {
             OrganizationBudget.AddOrDelDesktopNotifications(this.tvBudget.SelectedValue, false);
             return;
         }
     }
     else
     {
         if (!IndirectBudget.isHaveEReport(this.tvBudget.SelectedValue))
         {
             IndirectBudget.AddOrDelDesktopNotifications(this.tvBudget.SelectedValue, false);
         }
     }
 }
Ejemplo n.º 9
0
 public void BindGv()
 {
     this.setWF();
     if (string.IsNullOrEmpty(this.prjId))
     {
         this.btnSave.Enabled = false;
     }
     this.hfldPrjId.Value     = this.prjId;
     this.hfldInputUser.Value = base.UserCode;
     if (this.year == "zzjg")
     {
         this.gvBudget.DataSource = OrganizationBudget.GetAll(this.prjId);
     }
     else
     {
         this.gvBudget.DataSource = IndirectBudget.GetAll(this.prjId);
     }
     this.gvBudget.DataBind();
     base.RegisterScript("keyPress()");
 }
Ejemplo n.º 10
0
 protected void UpdateOrganBudget(System.Collections.Generic.IDictionary <string, decimal> dicBudAmount, string organizationBudgetId)
 {
     if (dicBudAmount.Count > 0)
     {
         foreach (string current in dicBudAmount.Keys)
         {
             string             text = current;
             decimal            num  = dicBudAmount[current];
             OrganizationBudget byOrganAndCBSCode = OrganizationBudget.GetByOrganAndCBSCode(organizationBudgetId, text);
             if (byOrganAndCBSCode != null)
             {
                 byOrganAndCBSCode.AccountAmount = num;
                 byOrganAndCBSCode.Update(byOrganAndCBSCode);
             }
             else
             {
                 OrganizationBudget organizationBudget = OrganizationBudget.Create(System.Guid.NewGuid().ToString(), organizationBudgetId, text, num, num, BudgetManage_Cost_IndirectBudget.inputUser, System.DateTime.Now, string.Empty);
                 organizationBudget.Add(organizationBudget);
             }
         }
     }
 }
Ejemplo n.º 11
0
    protected void InitPage()
    {
        string text = base.Request["id"];
        string str  = string.Empty;

        try
        {
            System.Convert.ToInt32(text);
            str = OrganizationBudget.GetZZJGName(text);
            this.BindOrganGV();
        }
        catch
        {
            PrjInfoModel modelByPrjGuid = new PTPrjInfoBll().GetModelByPrjGuid(base.Request["id"]);
            if (modelByPrjGuid != null)
            {
                str = modelByPrjGuid.PrjName;
            }
            this.BindGV();
        }
        this.lblPoster.Text = str + "已上报的间接成本预算";
        this.DelClicked();
    }
Ejemplo n.º 12
0
        private CustomerPayment SetupOrg(int id)
        {
            var             organization = organizationService.Get(id);
            CustomerPayment viewModel    = null;

            if (organization != null && organization.HeadquartersContactInformation != null)
            {
                OrganizationBudget planTier = subscriptionService.GetPriceTier(organization);

                viewModel = new CustomerPayment
                {
                    OrganizationId   = id,
                    CardAddressCity  = organization.HeadquartersContactInformation.City,
                    CardAddressLine1 = organization.HeadquartersContactInformation.Address1,
                    CardAddressLine2 = organization.HeadquartersContactInformation.Address2,
                    CardAddressState = organization.HeadquartersContactInformation.State.Abbreviation,
                    CardAddressZip   = organization.HeadquartersContactInformation.ZipCode.ToString(),
                    PlanTier         = planTier,
                    CustomerId       = organization.Subscription.CustomerBillingId,
                    HasTrialed       = organization.Subscription.HasTrialed
                };
            }
            return(viewModel);
        }
Ejemplo n.º 13
0
 private static OrganizationBudget FindPriceTier(OrganizationBudget amount)
 {
     return amount;
 }
Ejemplo n.º 14
0
 protected void BindOrganGV()
 {
     this.gvBudget.DataSource = OrganizationBudget.GetAllReport(base.Request["id"]);
     this.gvBudget.DataBind();
 }
Ejemplo n.º 15
0
 private static OrganizationBudget FindPriceTier(OrganizationBudget amount)
 {
     return(amount);
 }