public ActionResult Create([Bind(Include = "Id,Name,Surname,Email,PhoneNumbersI,PhoneNumbersII,DateOfStart,About,DepartmentId,TitleId")] Employee employee) { if (ModelState.IsValid) { EB.Create(employee); return(RedirectToAction("Index")); } ViewBag.Id = new SelectList(AIB.GetAll(), "Id", "Username", employee.Id); ViewBag.DepartmentId = new SelectList(DB1.GetAll(), "ID", "DepartmentName"); ViewBag.TitleId = new SelectList(TB.GetAll(), "ID", "TitleName"); return(View(employee)); }
public PensionFundContract CreateCompleteEntry(Fund fund, Company company, Employee employee) { Validate(fund, company, employee); var assetDictionary = GetAssetAllocationDictionary(fund); var pensionFund = PensionFundBusiness.Create(fund.Name); var pensionFundWallet = WalletBusiness.Create(); var pensionFundOption = PensionFundOptionBusiness.Create(pensionFundWallet.Address, fund.Fee, fund.LatePaymentFee, pensionFund.Id); var companyWallet = WalletBusiness.Create(); var domainCompany = CompanyBusiness.Create(companyWallet.Address, company.Name, company.BonusFee, company.MaxBonusFee, pensionFundOption.Address, company.VestingRules); var employeeWallet = WalletBusiness.Create(); var domainEmployee = EmployeeBusiness.Create(employeeWallet.Address, employee.Name, employee.Salary, employee.ContributionPercentage, domainCompany.Address); var pensionFundContract = PensionFundContractBusiness.Create(pensionFundOption.Address, domainCompany.Address, domainEmployee.Address, pensionFundOption.Fee, pensionFundOption.LatePenalty, domainCompany.MaxSalaryBonusRate, domainEmployee.Contribution, domainCompany.BonusRate, domainEmployee.Salary, assetDictionary, company.VestingRules.ToDictionary(bonus => bonus.Period, bonus => bonus.Percentage)); foreach (var asset in assetDictionary) { PensionFundReferenceContractBusiness.Create(pensionFundContract.TransactionHash, asset.Key, asset.Value); } return(pensionFundContract); }