private static IBudgetInfo BuildBudgetInfo(IBudgetAccount budgetAccount, short year, short month) { NullGuard.NotNull(budgetAccount, nameof(budgetAccount)); IBudgetInfo budgetInfo = new BudgetInfo(budgetAccount, year, month, 0M, 0M); budgetInfo.AddAuditInformation(budgetAccount.CreatedDateTime.ToUniversalTime(), budgetAccount.CreatedByIdentifier, budgetAccount.ModifiedDateTime.ToUniversalTime(), budgetAccount.ModifiedByIdentifier); return(budgetInfo); }
public ActionResult Create(FormCollection collection) { var model = new BudgetInfo(); this.TryUpdateModel <BudgetInfo>(model); this.ProjectService.SaveBudget(model); return(this.RefreshParent()); }
private static IBudgetInfo BuildBudgetInfo(IBudgetAccount budgetAccount, short year, short month, IBudgetInfo copyFromBudgetInfo) { NullGuard.NotNull(budgetAccount, nameof(budgetAccount)) .NotNull(copyFromBudgetInfo, nameof(copyFromBudgetInfo)); IBudgetInfo budgetInfo = new BudgetInfo(budgetAccount, year, month, copyFromBudgetInfo.Income, copyFromBudgetInfo.Expenses); budgetInfo.AddAuditInformation(copyFromBudgetInfo.CreatedDateTime.ToUniversalTime(), copyFromBudgetInfo.CreatedByIdentifier, copyFromBudgetInfo.ModifiedDateTime.ToUniversalTime(), copyFromBudgetInfo.ModifiedByIdentifier); return(budgetInfo); }
/// <summary> /// Get basic budget info. /// </summary> /// <returns>The overview.</returns> public BudgetInfo GetOverview() { BudgetInfo budget = new BudgetInfo(); economyManager.GetIncomeAndExpenses( (ItemClass)ScriptableObject.CreateInstance("ItemClass"), out budget.totalIncome, out budget.totalExpenses); budget.currentCash = economyManager.LastCashAmount; return(budget); }
internal static IBudgetInfo ToDomain(this BudgetInfoModel budgetInfoModel, IBudgetAccount budgetAccount) { NullGuard.NotNull(budgetInfoModel, nameof(budgetInfoModel)) .NotNull(budgetAccount, nameof(budgetAccount)); IBudgetInfo budgetInfo = new BudgetInfo(budgetAccount, budgetInfoModel.YearMonth.Year, budgetInfoModel.YearMonth.Month, budgetInfoModel.Income, budgetInfoModel.Expenses); budgetInfoModel.CopyAuditInformationTo(budgetInfo); budgetInfo.SetDeletable(budgetInfoModel.Deletable); return(budgetInfo); }
public ActionResult Create(FormCollection collection) { var model = new ProjectBasedata(); model.PSDate = DateTime.Now.ToString("yyyy/MM/dd"); model.PEdate = DateTime.Now.ToString("yyyy/MM/dd"); this.TryUpdateModel <ProjectBasedata>(model); this.ProjectService.SaveProjectBasedata(model); var labor = new LaborCost(); labor.ProjectID = model.ID; labor.ProjectName = model.PName; this.TryUpdateModel <LaborCost>(labor); this.ProjectService.SaveLaborCost(labor); var material = new MaterialCost(); material.ProjectID = model.ID; material.ProjectName = model.PName; this.TryUpdateModel <MaterialCost>(material); this.ProjectService.SaveMaterialCost(material); var machine = new MachineryCost(); machine.ProjectID = model.ID; machine.ProjectName = model.PName; this.TryUpdateModel <MachineryCost>(machine); this.ProjectService.SaveMachineryCost(machine); var measure = new Measure(); measure.ProjectID = model.ID; measure.ProjectName = model.PName; this.TryUpdateModel <Measure>(measure); this.ProjectService.SaveMeasure(measure); var overhead = new Overhead(); overhead.ProjectID = model.ID; overhead.ProjectName = model.PName; this.TryUpdateModel <Overhead>(overhead); this.ProjectService.SaveOverhead(overhead); var budgetinfo = new BudgetInfo(); budgetinfo.ProjectID = model.ID; budgetinfo.ProjectName = model.PName; this.TryUpdateModel <BudgetInfo>(budgetinfo); this.ProjectService.SaveBudget(budgetinfo); return(this.RefreshParent()); }
/// <summary> /// Send all budget info to client. /// </summary> protected void SendAll() { BudgetInfo budget = this.GetOverview(); budget.loans = this.GetLoans().ToArray(); budget.economy = new Economy { incomesAndExpenses = this.GetIncomesAndExpenses(), taxRates = this.GetTaxRates(), budgetRates = this.GetBudgetRates(), }; SendJson(budget); }
public void SaveBudget(BudgetInfo budget) { using (var dbContext = new ProjectDbContext()) { if (budget.ID > 0) { dbContext.Update <BudgetInfo>(budget); } else { dbContext.Insert <BudgetInfo>(budget); } } }
protected override void SetRowFormat(DataGridViewRow row) { if (row.IsNewRow) { return; } if (!row.Displayed) { return; } BudgetInfo item = row.DataBoundItem as BudgetInfo; //Face.Common.ControlTools.Instance.SetRowColor(row, item.EEstado); }
public override void PrintDetailAction() { if (ActiveItem == null) { return; } PgMng.Reset(6, 1, Face.Resources.Messages.RETRIEVING_DATA, this); BudgetReportMng reportMng = new BudgetReportMng(AppContext.ActiveSchema, this.Text, this.FilterValues); SerieInfo serie = SerieInfo.Get(ActiveItem.OidSerie, false); PgMng.Grow(); ClienteInfo cliente = ClienteInfo.Get(ActiveItem.OidCliente, false); PgMng.Grow(); FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport(); conf.nota = (cliente.OidImpuesto == 1) ? Library.Invoice.Resources.Messages.NOTA_EXENTO_IGIC : string.Empty; conf.nota += Environment.NewLine + (ActiveItem.Nota ? serie.Cabecera : ""); conf.cuenta_bancaria = string.Empty; PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT); BudgetInfo item = BudgetInfo.Get(ActiveOID, true); PgMng.Grow(); ReportClass report = reportMng.GetDetailReport(item, conf); PgMng.FillUp(); if (SettingsMng.Instance.GetUseDefaultPrinter()) { int n_copias = SettingsMng.Instance.GetDefaultNCopies(); PrintReport(report, n_copias); } else { ShowReport(report); } }
public override void ExportPDFAction() { if (ActiveItem == null) { return; } try { PgMng.Reset(7, 1, Face.Resources.Messages.RETRIEVING_DATA, this); BudgetReportMng reportMng = new BudgetReportMng(AppContext.ActiveSchema, this.Text, this.FilterValues); SerieInfo serie = SerieInfo.Get(ActiveItem.OidSerie, false); PgMng.Grow(); ClienteInfo cliente = ClienteInfo.Get(ActiveItem.OidCliente, false); PgMng.Grow(); FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport(); conf.nota = (cliente.OidImpuesto == 1) ? Library.Invoice.Resources.Messages.NOTA_EXENTO_IGIC : string.Empty; conf.nota += Environment.NewLine + (ActiveItem.Nota ? serie.Cabecera : ""); conf.cuenta_bancaria = string.Empty; PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT); BudgetInfo item = BudgetInfo.Get(ActiveOID, true); PgMng.Grow(); ReportClass report = reportMng.GetDetailReport(item, conf); PgMng.Grow(); ExportPDF(report, ActiveItem.FileName); } finally { PgMng.FillUp(); } }
protected void Page_Load(object sender, EventArgs e) { //Create connection resources using (Interface db = new Interface()) { //Set last update date try { //Query database using request DateTime result = db.getLtaLastUpdate(); //Set label value LTALastUpdate.Text = result.Date.ToShortDateString(); } catch (Exception) { LTALastUpdate.Text = "error"; } //Set budget numbers try { //Query database using request BudgetInfo budget = db.getUKBudgetInfo("newbuy"); //Set label values BudgetTotal.Text = string.Format("{0:C}", budget.totalBudget); BudgetedSpent.Text = string.Format("{0:C}", budget.budgetedSpent); NonBudgetedSpent.Text = string.Format("{0:C}", budget.nonBudgetedSpent); BudgetRemain.Text = string.Format("{0:C}", (budget.totalBudget - budget.totalSpent)); BudgetSpentPercent.Text = string.Format("{0:P}", Math.Round((budget.totalSpent / budget.totalBudget), 3)); } catch (Exception) { BudgetTotal.Text = "error"; } } }
protected override void GetFormSourceData(long oid, object[] parameters) { _entity = BudgetInfo.Get(oid, true); }
// // GET: /Project/budget/Details/5 //public ActionResult Details(int id) //{ // return View(); //} // // GET: /Project/ProjectBasedata/Create public ActionResult Create() { var model = new BudgetInfo(); return(View("Edit", model)); } //