public ActionResult Edit(string id, long currencyId, long periodId) { InvoiceModel model = InvoiceHelper.GetInvoice(id); SessionHelper.Calendar = CalendarHelper.GetCalendar(ReceivablePeriodHelper.GetReceivablePeriod(periodId.ToString()).CalendarId.ToString()); SessionHelper.PrecisionLimit = CurrencyHelper.GetCurrency(currencyId.ToString()).Precision; model.InvoiceDetail = InvoiceHelper.GetInvoiceDetail(id); model.CurrencyId = currencyId; model.SOBId = SessionHelper.SOBId; model.PeriodId = periodId; CustomerModel customer = CustomerHelper.GetCustomer(model.CustomerId.ToString()); CustomerSiteModel customerSite = CustomerHelper.GetCustomerSite(model.CustomerSiteId.ToString()); ///TODO: Plz check the code. model.Customers = new List <SelectListItem>(); model.Customers.Add(new SelectListItem { Value = customer.Id.ToString(), Text = customer.CustomerName }); model.CustomerSites = new List <SelectListItem>(); model.CustomerSites.Add(new SelectListItem { Value = customerSite.Id.ToString(), Text = customerSite.SiteName }); model.Currencies = CurrencyHelper.GetCurrencyList(SessionHelper.SOBId); //model.Periods = CalendarHelper.GetCalendarsList(SessionHelper.SOBId); model.Periods = ReceivablePeriodHelper.GetPeriodList(SessionHelper.SOBId); SessionHelper.Invoice = model; return(View(model)); }