public static bool ModifyFinanceReport(FinanceReport model) { string sql = string.Format(@"update {0} set [ReportTypeId]=@ReportTypeId,[ReportTypeName]=@ReportTypeName,[Abstract]=@Abstract,[Blance]=@Blance,[Type]=@Type,[Remark]=@Remark,[DateTime]=@DateTime,[Operater]=@Operater,[Payer]=@Payer,[IsDeleted]=@IsDeleted,[ModifyDate]=getdate() where Id=@Id", TableName); return(DBAccess.ExecuteSqlWithEntity(sql, model)); }
public static bool DeleteFinanceReport(FinanceReport model) { string sql = string.Format(@"update {0} set [Operater]=@Operater,[IsDeleted]=1,[ModifyDate]=getdate() where Id=@Id", TableName); return(DBAccess.ExecuteSqlWithEntity(sql, model)); }
private void PrintFinanceReport(ReportViewer rptViewer) { IACDataSet ReportData = new IACDataSet(); IACDataSetTableAdapters.OPNCUSTTableAdapter OPNCUSTTableAdapter = new IACDataSetTableAdapters.OPNCUSTTableAdapter(); IACDataSetTableAdapters.OPNDEALRTableAdapter OPNDEALRTableAdapter = new IACDataSetTableAdapters.OPNDEALRTableAdapter(); IACDataSetTableAdapters.StatementCustomerHeaderTableAdapter StatementCustomerHeaderTableAdapter = new IACDataSetTableAdapters.StatementCustomerHeaderTableAdapter(); IACDataSetTableAdapters.StatementDealerSummaryTableAdapter StatementDealerSummaryTableAdapter = new IACDataSetTableAdapters.StatementDealerSummaryTableAdapter(); OPNCUSTTableAdapter.CustomizeFill("SELECT * FROM OPNCUST WHERE CUSTOMER_ACT_STAT <> \'I\' AND CUSTOMER_DAY_DUE = " + ((DateTime)StatementDatenullableDateTimePicker.Value).Day.ToString().TrimStart().TrimEnd() + " ORDER BY CUSTOMER_DEALER,CUSTOMER_NO"); OPNCUSTTableAdapter.CustomFillBy(ReportData.OPNCUST); StatementCustomerHeaderTableAdapter.FillByDueDate(ReportData.StatementCustomerHeader, ((DateTime)StatementDatenullableDateTimePicker.Value).Date, false, false); StatementDealerSummaryTableAdapter.FillByDueDate(ReportData.StatementDealerSummary, ((DateTime)StatementDatenullableDateTimePicker.Value).Date); if (ReportData.StatementCustomerHeader.Rows.Count == 0 || ReportData.OPNCUST.Rows.Count == 0) { MessageBox.Show("*** Sorry there are no statements for the DUE DATE you entered!!! ***"); } else { OPNDEALRTableAdapter.CustomizeFill("SELECT * FROM OPNDEALR"); OPNDEALRTableAdapter.CustomFillBy(ReportData.OPNDEALR); FinanceReport myReportObject = new FinanceReport(); myReportObject.SetDataSource(ReportData); myReportObject.SetParameterValue("gsUserID", Program.gsUserID); myReportObject.SetParameterValue("gsUserName", Program.gsUserName); myReportObject.SetParameterValue("gsFormTitle", "Open Customer Finance Charge Report"); rptViewer.crystalReportViewer.ReportSource = myReportObject; rptViewer.crystalReportViewer.Refresh(); rptViewer.Show(); } }
public JsonResult FinanceReportAdd(FinanceReport model) { ResultInfo info = new ResultInfo(); var flag = false; AdminInfo admin = CookieOperate.UserAdminCookie; model.CreateBy = admin.UserName; if (model.Id <= 0) { flag = FinanceReportDBOperate.AddFinanceReport(model); info.IsSuccess = flag; if (flag) { info.Message = "保存成功"; } } else { flag = FinanceReportDBOperate.ModifyFinanceReport(model); info.IsSuccess = flag; if (flag) { info.Message = "保存成功"; } } return(Json(info)); }
public ActionResult CreateFinanceReport(FinanceReport financeReport) { db.Entry(financeReport).State = EntityState.Added; db.SaveChanges(); ViewBag.right = true; return(View()); }
private void bunifuFlatButton1_Click(object sender, EventArgs e) { FinancialReportDesign form = new FinancialReportDesign(); CrystalReports.FinanceReport report = new FinanceReport(); TextObject text1 = (TextObject)report.ReportDefinition.Sections["Section3"].ReportObjects["txtIncomeBox"]; text1.Text = txtIncome.Text.ToString(); TextObject text2 = (TextObject)report.ReportDefinition.Sections["Section3"].ReportObjects["txtExpenseBox"]; text2.Text = txtExpense.Text.ToString(); TextObject text3 = (TextObject)report.ReportDefinition.Sections["Section3"].ReportObjects["txtProfitBox"]; text3.Text = txtProfit.Text.ToString(); TextObject text4 = (TextObject)report.ReportDefinition.Sections["Section3"].ReportObjects["Text9"]; text4.Text = "Delgoda Caterers And Family Restaurent"; TextObject text5 = (TextObject)report.ReportDefinition.Sections["Section3"].ReportObjects["Text10"]; text5.Text = "364, New Kandy Road, Delgoda"; form.crystalReportViewerFinance.ReportSource = report; form.Show(); }
public ActionResult DeleteFinanceReport(int id) { FinanceReport financeReport = db.FinanceReports.Find(id); if (financeReport != null) { db.FinanceReports.Remove(financeReport); db.SaveChanges(); } ViewBag.Id = id; return(RedirectToAction("Index")); }
private static ExportFinanceModel ConventToExPortFinance(FinanceReport model) { ExportFinanceModel newModel = new ExportFinanceModel() { Abstract = model.Abstract, Operater = model.Operater, Remark = model.Remark, ReportTypeName = model.ReportTypeName, ShouRu = model.Type == 1 ? model.Blance.ToString() : "0", ZhiChu = model.Type == 1 ? "0" : model.Blance.ToString(), TimeFormat = model.DateTime.ToShortDateString() }; return(newModel); }
public JsonResult FinanceReportDel(int Id) { ResultInfo info = new ResultInfo(); var flag = false; FinanceReport model = new FinanceReport() { Id = Id, Operater = CookieOperate.UserAdminCookie.UserName }; flag = FinanceReportDBOperate.DeleteFinanceReport(model); info.IsSuccess = flag; if (flag) { info.Message = "删除成功"; } return(Json(info)); }
private FinanceReport ParseReport(string code, string[] lines) { FinanceReport report = new FinanceReport(); int lineIndex = 0; string companyName; if (!ParseHeader(code, lines, ref lineIndex, out companyName)) { _errorWriter.WriteLine("Failed to parse report header"); return(null); } report.CompanyCode = code; report.CompanyName = companyName; while (lineIndex < lines.Length) { int currentLineIndex = lineIndex; FinanceReportTable table = ParseTable(lines, ref lineIndex); if (table != null && table.Name != "环比分析") { report.AddTable(table); } else { report.Annotations = string.Join( Environment.NewLine, Enumerable .Range(currentLineIndex, lines.Length - currentLineIndex) .Select(i => lines[i])); break; } } return(report); }
private static void AddReportMetadataToDataDictionary(FinanceReport report, DataDictionary dataDictionary) { foreach (var table in report.Tables) { dataDictionary.AddTableName(table.Name); foreach (var column in table.ColumnDefinitions) { if (column.Type == FinanceReportColumnDefinition.ColumnType.Text && !string.IsNullOrWhiteSpace(column.Text)) { dataDictionary.AddColumnName(table.Name, column.Text); } } foreach (var row in table.Rows) { if (!string.IsNullOrWhiteSpace(row.Name)) { dataDictionary.AddRowName(table.Name, row.Name); } } } }
public IActionResult FinanceReport() { List <FinanceReport> list = new FinanceReport(__httpContextAccessor).ReturnDataGraphicPie(); string values = ""; string labels = ""; string colors = ""; //Used the function to generate random colors var random = new Random(); for (int i = 0; i < list.Count; i++) { values += list[i].TotalValue.ToString() + ","; labels += "'" + list[i].PlaneAccountName.ToString() + "',"; colors += "'" + String.Format("#{0:X6}", random.Next(0x1000000)) + "',"; } ViewBag.Colors = colors; ViewBag.Values = values; ViewBag.Labels = labels; return(View()); }
public static bool AddFinanceReport(FinanceReport model) { string sql = string.Format("insert into {0}(ReportTypeId,ReportTypeName,Abstract,Blance,Type,Remark,CreateBy,DateTime,Operater,Payer,CreateDate,IsDeleted) values(@ReportTypeId,@ReportTypeName,@Abstract,@Blance,@Type,@Remark,@CreateBy,@DateTime,@Operater,@Payer,getdate(),0)", TableName); return(DBAccess.ExecuteSqlWithEntity(sql, model)); }
static void Run(Options options) { options.Print(Console.Out); string inputFolder = Path.GetFullPath(options.InputFolder); if (!Directory.Exists(inputFolder)) { Console.WriteLine("Input file folder {0} does not exist.", inputFolder); return; } DataDictionary dataDictionary = new DataDictionary(); if (!string.IsNullOrEmpty(options.DataDictionaryFile)) { dataDictionary.Load(options.DataDictionaryFile); } DataDictionary newDataDictionary = new DataDictionary(dataDictionary); IReportParser parser = ReportParserFactory.Create(options.FinanceReportFileType, dataDictionary, Console.Error); List <FinanceReport> reports = new List <FinanceReport>(); foreach (var file in Directory.EnumerateFiles(inputFolder)) { string code = Path.GetFileNameWithoutExtension(file); if (string.IsNullOrWhiteSpace(code)) { Console.WriteLine("The file name {0} is not expected", file); } FinanceReport report = parser.ParseReport(code, file); if (report == null) { Console.WriteLine("Parse report file {0} failed.", file); } else { Console.WriteLine("Parse report for {0}:{1} succeeded.", report.CompanyCode, report.CompanyName); AddReportMetadataToDataDictionary(report, newDataDictionary); reports.Add(report); } } // normalize each report according to data dictionary foreach (var report in reports) { report.Normalize(newDataDictionary); } // expand and merge tables in reports ExpandAndMergeTables(reports); // create revenue table for last 12 months CreateRevenueTableForLast12Months(reports); // output reports OutputReports(reports, options.OutputFolder); // save new data dictionary if necessary. if (!string.IsNullOrEmpty(options.GenerateDataDictionaryFile)) { newDataDictionary.Save(options.GenerateDataDictionaryFile); } Console.WriteLine("Done."); }
public ActionResult EditFinanceReport(FinanceReport financeReport) { db.Entry(financeReport).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult EditFinanceReport(int?id) { FinanceReport financeReport = db.FinanceReports.Find(id); return(View(financeReport)); }