public BOCompany(Accountant acc, DataFileInformation data, BOContext context) : base(acc, context) { mObjectID = BOType.BOCompany; mDataProxy = data.Clone() as DataFileInformation; mDataSource = data; }
protected override OpResult _Store(DataFileInformation _obj) { if (_obj == null) { return(OpResult.NotifyStoreAction(OpResult.ResultStatus.ObjectIsNull, _obj, "DataFileInformation object cannot be created as it is null")); } if (Exists(_obj)) { ExecuteNonQuery(GetQuery_UpdateQuery(_obj)); return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Updated, _obj)); } ExecuteNonQuery(GetQuery_InsertQuery(_obj)); _obj.FromDb = true; return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Created, _obj)); }
protected override Customer _CreateEntity() { Customer _obj = new Customer(false, this); _obj.CardTypeID = CardType.GetCardTypeID(CardType.TypeID.Customer); _obj.IsIndividual = "N"; DataFileInformation c = RepositoryMgr.DataFileInformationMgr.Company; _obj.TermsID = c.DefaultCustomerTermsID; _obj.PriceLevelID = c.DefaultCustomerPriceLevelID; _obj.TaxCodeID = c.DefaultCustomerTaxCodeID; _obj.UseCustomerTaxCode = c.DefaultUseCustomerTaxCode; _obj.FreightTaxCodeID = c.DefaultCustomerFreightTaxCodeID; _obj.CreditLimit = c.DefaultCustomerCreditLimit; return(_obj); }
protected Doddle.Reporting.Report CreateReport(string report_title) { Doddle.Reporting.Report report = new Doddle.Reporting.Report(); DataFileInformation company = mAccountant.DataFileInformationMgr.Company; string title = report_title; string subtitle = ""; if (IncludeCompanyAddress) { title = string.Format("{0}\r\n{1}", company.CompanyName, company.Address); subtitle = report_title; } string footer = string.Format("Copyright {0}", DateTime.Now.Year); if (IncludeCompanyName) { footer = string.Format("Copyright {0}; The {1}", DateTime.Now.Year, company.CompanyName); } string header = " "; if (IncludeReportDateAndTime) { StringBuilder header_sb = new StringBuilder(); header_sb.Append(DateTime.Now.ToString("yyyy-MMM-dd")); header_sb.Append("\r\n"); header_sb.Append(DateTime.Now.ToString("HH:mm:ss")); header = header_sb.ToString(); } report.TextFields.Title = title; report.TextFields.SubTitle = subtitle; report.TextFields.Footer = footer; report.TextFields.Header = header; // Render hints allow you to pass additional hints to the reports as they are being rendered report.RenderHints.BooleanCheckboxes = true; return(report); }
private DbUpdateStatement GetQuery_UpdateQuery(DataFileInformation _obj) { return(DbMgr.CreateUpdateClause("DataFileInformation", GetFields(_obj), "CompanyName", _obj.CompanyName)); }
private DbInsertStatement GetQuery_InsertQuery(DataFileInformation _obj) { Dictionary <string, DbFieldEntry> fields = GetFields(_obj); return(DbMgr.CreateInsertClause("DataFileInformation", fields)); }
public async Task <HttpResponseMessage> UploadDataFile(long userID, string culture) { HttpResponseMessage response; DataFileInformation FileDataStructure; List <DataFileInformation> FileDataList = new List <DataFileInformation>(); FileInfo OSFileInfo; try { if (this.ModelState.IsValid) { string fileName, OriginalFileName; var root = HttpContext.Current.Server.MapPath("~/App_Data/UploadFiles"); Directory.CreateDirectory(root); var provider = new MultipartFormDataStreamProvider(root); var result = await Request.Content.ReadAsMultipartAsync(provider); string subFolderParentName = "DataFiles"; string subFolderName = ""; string UploadPath = "~/Upload/"; string UploadPhysicalPath; string FinalFilePath; if (subFolderParentName != "") { UploadPath = UploadPath + "/" + subFolderParentName + "/"; } if (subFolderName != "") { UploadPath = UploadPath + subFolderName + "/"; } UploadPhysicalPath = HttpContext.Current.Server.MapPath(UploadPath); Utility.CreateDirectory(UploadPhysicalPath); foreach (MultipartFileData fileData in result.FileData) { fileName = fileData.Headers.ContentDisposition.FileName; if (fileName.StartsWith("\"") && fileName.EndsWith("\"")) { fileName = fileName.Trim('"'); } if (fileName.Contains(@"/") || fileName.Contains(@"\")) { fileName = Path.GetFileName(fileName); } OriginalFileName = fileName; FinalFilePath = Path.Combine(UploadPhysicalPath, fileName); { fileName = Path.GetFileNameWithoutExtension(FinalFilePath); fileName = DocumentScanner.AddDateIntoFileName(fileName); fileName = DocumentScanner.RefractorFileName(fileName) + Path.GetExtension(FinalFilePath); fileName = HttpUtility.UrlEncode(fileName); FinalFilePath = Path.Combine(UploadPhysicalPath, fileName); } File.Copy(fileData.LocalFileName, FinalFilePath, true); OSFileInfo = new FileInfo(FinalFilePath); FileDataStructure = new DataFileInformation(); FileDataStructure.FileName = fileName; FileDataStructure.OriginalFileName = OriginalFileName; FileDataStructure.DownloadURL = Request.RequestUri.GetLeftPart(UriPartial.Authority) + "/Upload/DataFiles/" + fileName; FileDataStructure.UploadDate = DateTime.Now; FileDataStructure.FileSize = OSFileInfo.Length; FileDataStructure.Extension = OSFileInfo.Extension; FileDataList.Add(FileDataStructure); } response = Request.CreateResponse(HttpStatusCode.OK, FileDataList); } else { response = Request.CreateResponse(HttpStatusCode.BadRequest, ModelState); } } catch (Exception ex) { response = Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message); } return(response); }