private void CreateToplineProductGroup(BPSR_Topline topline, ToplineProductGroupViewModel current)
 {
     topline.BPSR_ProdGrp.Add(new BPSR_ProdGrp()
     {
         BPSR_ToplineID      = topline.BPSR_ToplineID,
         ProdGrpID           = current.ProdGrpID,
         ProdSubGrpID        = current.ProdSubGrpID,
         NetSales            = ConvertHelpers.ToMoney(current.NetSales),
         FranCalcRoyalty     = ConvertHelpers.ToMoney(current.FranCalcRoyalty),
         FranCalcAdvertising = ConvertHelpers.ToMoney(current.FranCalcAdvertising),
         TotalTickets        = ConvertHelpers.ToNumber(current.TotalTickets)
     });
 }
        private EditToplineViewModel BindEditToplineViewModel(BPSR_Topline topline, IEnumerable <ToplinePrdSubGrps_Result> availableToplinePrdSubGrps, bool isAdmin, bool isApprover)
        {
            var model = new EditToplineViewModel()
            {
                ToplineId    = topline.BPSR_ToplineID,
                StatusId     = topline.BPSR_StatusID,
                LocalStoreId = topline.LocalStoreID,

                NetSales            = FormatHelpers.FormatMoney(topline.NetSales),
                TotalTickets        = FormatHelpers.FormatNumber(topline.TotalTickets),
                FranCalcRoyalty     = FormatHelpers.FormatMoney(topline.FranCalcRoyalty),
                FranCalcAdvertising = FormatHelpers.FormatMoney(topline.FranCalcAdvertising),

                Title         = FormatTitle("Enter Sales", topline.LocalStoreID, topline.PeriodEndDate),
                ProductGroups = BindToplineProductsGroupViewModel(topline.BPSR_ProdGrp, availableToplinePrdSubGrps),

                IsApprove     = false,
                CanApprove    = this.CanApproveTopline(topline.BPSR_StatusID, isAdmin, isApprover),
                SalesTypeId   = topline.SalesTypeID,
                SalesTypeList = this.GetAvailableSalesTypeList(topline.SalesTypeID)
            };

            return(model);
        }