protected void Application_Error() { HttpContext httpContext = HttpContext.Current; if (httpContext != null) { EvolutionEntities db = new EvolutionEntities(); var request = httpContext.Request; var requestLength = request.ContentLength; var ex = Server.GetLastError(); int id = db.WriteLog(ex, httpContext.Request.RawUrl); if (ex.Message.IndexOf("The view ") != -1 && ex.Message.IndexOf(" or its master was not found or no view engine supports the searched locations") != -1 && ex.Message.IndexOf("Error.cshtml") != -1) { // Stops an infinite loop if Error.cshtml can't be found httpContext.Response.Write(httpContext.Request.RawUrl + "<br/<br/>"); httpContext.Response.Write(ex.Message + "<br/<br/>"); } else { // The error page replaces /r/n with /r/n<br/> It doesn't touch || httpContext.Response.Redirect("~/Error?id=" + id.ToString()); } } }
private static string GenerateHTML(string successfulIntervalsFileName, string scoreFileName, string gifFileName, string mostRecentFileName, string saveDirectory) { var sb = new StringBuilder(File.ReadAllText(saveDirectory + @"\template.html")); //[current_date] var current_date = DateTime.UtcNow.Day.ToString() + ((DateTime.UtcNow.Day % 10 == 1 && DateTime.UtcNow.Day != 11) ? "st" : (DateTime.UtcNow.Day % 10 == 2 && DateTime.UtcNow.Day != 12) ? "nd" : (DateTime.UtcNow.Day % 10 == 3 && DateTime.UtcNow.Day != 13) ? "rd" : "th") + " " + DateTime.UtcNow.ToString("MMMM") + " " + DateTime.UtcNow.Year.ToString() + " " + DateTime.UtcNow.Hour.ToString("00") + ":" + DateTime.UtcNow.Minute.ToString("00") + " GMT"; sb.Replace("[current_date]", current_date); sb.Replace("[successful_intervals.png]", successfulIntervalsFileName.Substring(successfulIntervalsFileName.LastIndexOf("\\") + 1)); sb.Replace("[scores.png]", scoreFileName.Substring(scoreFileName.LastIndexOf("\\") + 1)); sb.Replace("[progress.gif]", gifFileName.Substring(gifFileName.LastIndexOf("\\") + 1)); sb.Replace("[most_recent.jpg]", mostRecentFileName.Substring(scoreFileName.LastIndexOf("\\") + 1)); var DB = new EvolutionEntities(); var numberOfGenerations = DB.FamilyTrees.Max(x => x.Generation); var numberOfSuccessfulGenerations = DB.FamilyTrees.Where(x => x.WasSuccessful).Count(); sb.Replace("[current_generation]", numberOfGenerations.ToString()); sb.Replace("[successful_generations]", numberOfSuccessfulGenerations.ToString()); var fileName = saveDirectory + "\\index.html"; File.WriteAllText(fileName, sb.ToString()); return(fileName); }
public PurchasingService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <PurchaseOrderHeader, PurchaseOrderHeader>(); cfg.CreateMap <PurchaseOrderHeader, PurchaseOrderHeaderModel>(); cfg.CreateMap <PurchaseOrderHeader, PurchaseOrderHeaderTemp>(); cfg.CreateMap <PurchaseOrderHeaderModel, PurchaseOrderHeader>(); cfg.CreateMap <PurchaseOrderHeaderModel, PurchaseOrderHeaderModel>(); cfg.CreateMap <PurchaseOrderHeaderTemp, PurchaseOrderHeaderTempModel>(); cfg.CreateMap <PurchaseOrderHeaderTemp, PurchaseOrderHeader>(); cfg.CreateMap <PurchaseOrderHeaderTempModel, PurchaseOrderSummaryModel>(); cfg.CreateMap <PurchaseOrderHeaderTempModel, PurchaseOrderHeaderTemp>(); cfg.CreateMap <PurchaseOrderDetailModel, PurchaseOrderDetail>() .ForSourceMember(s => s.OriginalRowId, t => t.Ignore()) .ForSourceMember(s => s.LineNumber, t => t.Ignore()); cfg.CreateMap <PurchaseOrderDetail, PurchaseOrderDetail>(); cfg.CreateMap <PurchaseOrderDetail, PurchaseOrderDetailSplitModel>(); cfg.CreateMap <PurchaseOrderDetailModel, PurchaseOrderDetailModel>(); cfg.CreateMap <PurchaseOrderDetailTemp, PurchaseOrderDetailTempModel>(); cfg.CreateMap <PurchaseOrderDetailTempModel, PurchaseOrderDetailTemp>() .ForSourceMember(s => s.OriginalRowId, t => t.Ignore()) .ForSourceMember(s => s.LineNumber, t => t.Ignore()); cfg.CreateMap <PurchaseOrderDetailTempModel, PurchaseOrderDetailTempModel>(); })); Mapper = config.CreateMapper(); }
public ProductService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <Brand, BrandModel>(); cfg.CreateMap <BrandModel, Brand>(); cfg.CreateMap <BrandModel, BrandModel>(); cfg.CreateMap <BrandCategory, BrandCategoryModel>(); cfg.CreateMap <BrandCategoryModel, BrandCategory>(); cfg.CreateMap <BrandCategoryModel, BrandCategoryModel>(); cfg.CreateMap <Product, Product>(); cfg.CreateMap <Product, ProductModel>(); cfg.CreateMap <ProductModel, Product>(); cfg.CreateMap <ProductModel, ProductModel>(); cfg.CreateMap <ProductLocation, ProductLocationModel>(); cfg.CreateMap <ProductLocationModel, ProductLocation>(); cfg.CreateMap <ProductMedia, ProductMedia>(); cfg.CreateMap <ProductMedia, ProductMediaModel>(); cfg.CreateMap <ProductMediaModel, ProductMedia>(); cfg.CreateMap <ProductPrice, ProductPriceModel>(); cfg.CreateMap <ProductPriceModel, ProductPrice>(); cfg.CreateMap <ProductAdditionalCategoryModel, ProductAdditionalCategory>(); cfg.CreateMap <ProductAdditionalCategory, ProductAdditionalCategoryModel>(); cfg.CreateMap <ProductCompliance, ProductComplianceModel>(); cfg.CreateMap <ProductComplianceModel, ProductCompliance>(); cfg.CreateMap <ProductComplianceAttachment, ProductComplianceAttachmentModel>(); cfg.CreateMap <ProductComplianceAttachmentModel, ProductComplianceAttachment>(); })); Mapper = config.CreateMapper(); }
static void Main(string[] args) { //CSharpScript causes memory leaks. //https://social.msdn.microsoft.com/Forums/vstudio/en-US/be68af47-b420-4440-9075-484505948a5f/memory-leak-issue-with-roslyn-compilation?forum=roslyn int iterationsBeforeTerminate = 100; var DBContext = new EvolutionEntities(); var generation = DBContext.FamilyTrees.Max(x => (long?)x.Generation) ?? 0; long daddysScore = DBContext.FamilyTrees.Min(x => (long?)x.Score) ?? -1; var tasks = new List <Task>(); var children = new List <Child>(); for (int counter = 0; counter < iterationsBeforeTerminate; counter++) { generation++; for (int i = 0; i < 5; i++) { Child c = new Child(generation, i, Properties.Settings.Default.TargetPicture); // @"c:\temp\DNA\GWB.bmp"); children.Add(c); tasks.Add(Task.Factory.StartNew(() => c.MutateAndRun(Properties.Settings.Default.CurrentGenerationPath))); // @"c:\temp\DNA\currentGeneration.csx"))); } Task.WaitAll(tasks.ToArray()); FightToTheDeath(children, ref daddysScore); children.Clear(); tasks.Clear(); } Console.WriteLine("All done"); }
public void Demand() { bool bFound = false; string[] roles = _role.Split(','); var currentUser = System.Web.HttpContext.Current.User; foreach (string role in roles) { if (currentUser.IsInRole(role.Trim())) { //if (Thread.CurrentPrincipal.IsInRole(role.Trim())) { bFound = true; break; } } if (!bFound) { using (EvolutionEntities db = new EvolutionEntities()) { db.WriteLog(LogSection.Security, LogSeverity.Severe, "", EvolutionResources.errUserIsNotInRole //.DoSubstitutions(Thread.CurrentPrincipal.Identity.Name, _role), .DoSubstitutions(currentUser.Identity.Name, _role), ""); } throw new SecurityException(EvolutionResources.errUserIsNotInRole //.DoSubstitutions(Thread.CurrentPrincipal.Identity.Name, _role)); .DoSubstitutions(currentUser.Identity.Name, _role)); } }
public SalesService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <SalesOrderHeader, SalesOrderHeader>(); cfg.CreateMap <SalesOrderHeader, SalesOrderHeaderModel>(); cfg.CreateMap <SalesOrderHeader, SalesOrderHeaderTemp>(); cfg.CreateMap <SalesOrderHeaderModel, SalesOrderHeader>() .ForMember(s => s.BrandCategory, opt => opt.Ignore()) .ForMember(s => s.SalesOrderDetails, opt => opt.Ignore()); cfg.CreateMap <SalesOrderHeaderTemp, SalesOrderHeaderTempModel>() .ForMember(s => s.SOStatusValue, opt => opt.Ignore()); cfg.CreateMap <SalesOrderHeaderTemp, SalesOrderHeader>(); cfg.CreateMap <SalesOrderHeaderTempModel, SalesOrderHeaderTemp>() .ForMember(s => s.BrandCategory, opt => opt.Ignore()); cfg.CreateMap <SalesOrderDetailTemp, SalesOrderDetailTempModel>(); cfg.CreateMap <SalesOrderDetailTempModel, SalesOrderDetailTemp>(); cfg.CreateMap <SalesOrderDetail, SalesOrderDetailModel>(); cfg.CreateMap <SalesOrderDetailModel, SalesOrderDetail>(); cfg.CreateMap <FindCancellationSummaryList_Result, CancellationSummaryModel>(); cfg.CreateMap <FindTransactionDrillDown_Result, TransactionDrillDownModel>(); cfg.CreateMap <CreditClaimReplacementOrderModel, CreditClaimReplacementOrder>(); cfg.CreateMap <CreditClaimReplacementOrder, CreditClaimReplacementOrderModel>(); cfg.CreateMap <CreditClaimHeaderModel, CreditClaimHeader>(); cfg.CreateMap <CreditClaimHeader, CreditClaimHeaderModel>(); })); Mapper = config.CreateMapper(); }
public CustomerService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <CreditCard, CreditCardModel>(); cfg.CreateMap <CreditCardModel, CreditCard>(); cfg.CreateMap <Customer, Customer>(); cfg.CreateMap <Customer, CustomerModel>(); cfg.CreateMap <Customer, CustomerAdditionalInfoModel>(); cfg.CreateMap <Customer, CustomerFreightModel>(); cfg.CreateMap <CustomerFreightModel, Customer>(); cfg.CreateMap <CustomerAdditionalInfoModel, Customer>(); cfg.CreateMap <CustomerAddress, CustomerAddressModel>(); cfg.CreateMap <CustomerAddressModel, CustomerAddress>(); cfg.CreateMap <CustomerModel, Customer>(); cfg.CreateMap <CustomerModel, CustomerModel> (); cfg.CreateMap <CustomerContact, CustomerContactModel>(); cfg.CreateMap <CustomerContactModel, CustomerContact>(); cfg.CreateMap <CustomerConflictSensitivity, CustomerConflictModel>(); cfg.CreateMap <CustomerConflictModel, CustomerConflictSensitivity>(); cfg.CreateMap <CustomerDefault, CustomerDefaultModel>(); cfg.CreateMap <CustomerDefaultModel, CustomerDefault>(); cfg.CreateMap <BrandCategorySalesPerson, BrandCategorySalesPerson>(); cfg.CreateMap <BrandCategorySalesPerson, BrandCategorySalesPersonModel>(); cfg.CreateMap <BrandCategorySalesPersonModel, BrandCategorySalesPerson>(); cfg.CreateMap <MarketingGroupSubscription, CustomerMarketingModel>(); cfg.CreateMap <CustomerMarketingModel, MarketingGroupSubscription>(); })); Mapper = config.CreateMapper(); }
public static string sendMailWithoutAttachment(MailModel _objModelMail) { try { // string Body = PopulateBody(_objModelMail); EvolutionEntities _db = new EvolutionEntities(); var mailData = _db.Email_Setting.FirstOrDefault(); MailMessage mail = new MailMessage(); mail.To.Add(_objModelMail.To); mail.From = new MailAddress(_objModelMail.From); mail.Subject = _objModelMail.Subject; mail.Body = _objModelMail.Body; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = mailData.Server; smtp.Port = Convert.ToInt32(mailData.Port); smtp.UseDefaultCredentials = false; smtp.Credentials = new System.Net.NetworkCredential(mailData.From_Email, mailData.Email_Password); // Enter seders User name and password smtp.EnableSsl = Convert.ToBoolean(mailData.Enable_SSL); smtp.Send(mail); string mailSend = "Mail Send Suucessfully"; return(mailSend); } catch (Exception e) { string mailCancle = "Problem while sending email, Please check details." + e; return(mailCancle); } }
public override object BindModel(ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext bindingContext) { object result = null; var name = bindingContext.ModelName; var value = bindingContext.ValueProvider.GetValue(name); if (dateFormat == null) { EvolutionEntities db = new EvolutionEntities(); var mms = new MembershipManagementService.MembershipManagementService(db); var user = mms.User; dateFormat = user.DateFormat; } if (value != null && !string.IsNullOrEmpty(value.AttemptedValue)) { DateTimeOffset date; if (DateTimeOffset.TryParseExact(value.AttemptedValue, dateFormat + " HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out date)) { result = date; } else if (DateTimeOffset.TryParseExact(value.AttemptedValue, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out date)) { result = date; } else { result = base.BindModel(controllerContext, bindingContext); } } return(result); }
public EMailService(EvolutionEntities dbEntities, CompanyModel company = null) : base(dbEntities) { if (company != null) { // Company supplied as a parameter _company = company; } else { // No company, so get the default 'head office' company var temp = db.FindParentCompany(); if (temp != null) { _company = new CompanyModel { Id = temp.Id, CompanyName = temp.CompanyName }; } else { throw new Exception("Error: No Parent Company is configured!"); } } // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <EMailQueue, EMailQueueModel>(); })); Mapper = config.CreateMapper(); }
public TaskManagerService(EvolutionEntities dbEntities, CompanyModel company = null) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <DAL.Task, TaskModel>(); cfg.CreateMap <TaskModel, DAL.Task>(); cfg.CreateMap <TaskModel, TaskModel>(); cfg.CreateMap <Company, CompanyModel>(); })); Mapper = config.CreateMapper(); // Other initialisations if (company != null) { // Company supplied as a parameter _company = company; } else { // No company, so get the default 'head office' company var temp = db.FindParentCompany(); if (temp != null) { _company = Mapper.Map <Company, CompanyModel>(temp); } else { throw new Exception("Error: No Parent Company is configured!"); } } }
public LookupService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <Country, CountryModel>(); cfg.CreateMap <CountryModel, Country>(); cfg.CreateMap <CountryModel, CountryModel>(); cfg.CreateMap <Currency, CurrencyModel>(); cfg.CreateMap <CurrencyModel, Currency>(); cfg.CreateMap <CurrencyModel, CurrencyModel>(); cfg.CreateMap <FreightCarrier, FreightCarrierModel>() .ForMember(d => d.FreightCarrier, opts => opts.MapFrom(s => s.FreightCarrier1)); cfg.CreateMap <FreightCarrierModel, FreightCarrier>() .ForMember(d => d.FreightCarrier1, opts => opts.MapFrom(s => s.FreightCarrier)); cfg.CreateMap <FreightCarrierModel, FreightCarrierModel>(); cfg.CreateMap <FreightForwarder, FreightForwarderModel>(); cfg.CreateMap <FreightForwarderModel, FreightForwarder>(); cfg.CreateMap <FreightForwarderModel, FreightForwarderModel>(); cfg.CreateMap <LOVItem, LOVItemModel>(); cfg.CreateMap <LOVItemModel, LOVItem>(); cfg.CreateMap <LOVItemModel, LOVItemModel>(); cfg.CreateMap <Location, LocationModel>(); cfg.CreateMap <LocationModel, Location>(); cfg.CreateMap <LocationModel, LocationModel>(); cfg.CreateMap <MarketingGroup, MarketingGroupModel>(); cfg.CreateMap <MarketingGroupModel, MarketingGroup>(); cfg.CreateMap <MarketingGroupModel, MarketingGroupModel>(); cfg.CreateMap <MessageTemplate, MessageTemplateModel>(); cfg.CreateMap <MessageTemplateModel, MessageTemplate>(); cfg.CreateMap <PaymentTerm, PaymentTermModel>(); cfg.CreateMap <PaymentTermModel, PaymentTerm>(); cfg.CreateMap <Port, PortModel>(); cfg.CreateMap <PortModel, Port>(); cfg.CreateMap <PortModel, PortModel>(); cfg.CreateMap <PriceLevel, PriceLevelModel>(); cfg.CreateMap <PriceLevelModel, PriceLevel>(); cfg.CreateMap <PriceLevelModel, PriceLevelModel>(); cfg.CreateMap <PurchaseOrderHeaderStatu, PurchaseOrderHeaderStatusModel>(); cfg.CreateMap <PurchaseOrderHeaderStatusModel, PurchaseOrderHeaderStatu>(); cfg.CreateMap <PurchaseOrderHeaderStatusModel, PurchaseOrderHeaderStatusModel>(); cfg.CreateMap <Region, RegionModel>(); cfg.CreateMap <RegionModel, Region>(); cfg.CreateMap <RegionModel, RegionModel>(); cfg.CreateMap <SalesOrderHeaderStatu, SalesOrderHeaderStatusModel>(); cfg.CreateMap <SalesOrderHeaderStatusModel, SalesOrderHeaderStatu>(); cfg.CreateMap <DocumentTemplate, DocumentTemplateModel>(); cfg.CreateMap <DocumentTemplateModel, DocumentTemplate>(); cfg.CreateMap <DocumentTemplateModel, DocumentTemplateModel>(); cfg.CreateMap <SupplierTerm, SupplierTermModel>(); cfg.CreateMap <SupplierTermModel, SupplierTerm>(); cfg.CreateMap <SupplierTermModel, SupplierTermModel>(); cfg.CreateMap <TaxCode, TaxCodeModel>() .ForMember(d => d.TaxCode, opts => opts.MapFrom(s => s.TaxCode1)); cfg.CreateMap <TaxCodeModel, TaxCode>() .ForMember(d => d.TaxCode1, opts => opts.MapFrom(s => s.TaxCode)); cfg.CreateMap <TaxCodeModel, TaxCodeModel>(); })); Mapper = config.CreateMapper(); }
public FileImportService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <FileImportRow, FileImportRowModel>(); })); Mapper = config.CreateMapper(); }
public SystemService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <Log, LogModel>(); })); Mapper = config.CreateMapper(); }
public MailSenderTask(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <User, UserModel>(); })); Mapper = config.CreateMapper(); }
public static string AllCustomerEmailString() { EvolutionEntities _db = new EvolutionEntities(); var Users = _db.AspNetUsers.Where(x => x.SSOID.StartsWith("C") && x.Archived == false).ToList(); string[] username = Users.Select(x => x.UserName).ToArray(); string AllCustomerEmailAddress = String.Join(",", username); return(AllCustomerEmailAddress); }
public MediaService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <Medium, MediaModel>(); cfg.CreateMap <MediaModel, Medium>(); })); Mapper = config.CreateMapper(); }
public AllocationService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <FindAllocations_Result, AllocationResultModel>(); cfg.CreateMap <Allocation, AllocationModel>(); cfg.CreateMap <AllocationModel, Allocation>(); })); Mapper = config.CreateMapper(); }
public static string AllManagerEmailString() { EvolutionEntities _db = new EvolutionEntities(); RolesManagementMethod _RolesManagementMethod = new RolesManagementMethod(); var Users = _RolesManagementMethod.GetManagersList(); string[] username = Users.Select(x => x.UserName).ToArray(); string AllManagerEmailAddress = String.Join(",", username); return(AllManagerEmailAddress); }
public AuditService(EvolutionEntities dbEntities) { db = dbEntities; // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <AuditLog, AuditModel>(); })); Mapper = config.CreateMapper(); }
public NoteService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <Note, NoteModel>(); cfg.CreateMap <NoteModel, Note>(); cfg.CreateMap <NoteAttachment, NoteAttachmentModel>(); })); Mapper = config.CreateMapper(); }
public DataTransferService(EvolutionEntities dbEntities, CompanyModel company = null) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <FileTransferConfiguration, FileTransferConfigurationModel>(); cfg.CreateMap <FileTransferConfigurationModel, FileTransferConfiguration>() .ForMember(s => s.Id, opt => opt.Ignore()); })); Mapper = config.CreateMapper(); }
public PickService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <PickHeader, PickHeaderModel>(); cfg.CreateMap <PickHeaderModel, PickHeader>(); cfg.CreateMap <PickDetail, PickDetailModel>(); cfg.CreateMap <PickDetailModel, PickDetail>(); })); Mapper = config.CreateMapper(); }
public PepperiImportService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings //var config = new MapperConfiguration((cfg => { // //cfg.CreateMap<PepperiImportHeaderTemp, PepperiTransactionTempModel.SalesTransactionTransactionHeader>(); // //cfg.CreateMap<PepperiImportDetailTemp, PepperiTransactionTempModel.SalesTransactionTransactionHeaderTransactionHeaderFields>(); // //cfg.CreateMap<PepperiTransactionTempModel.SalesTransactionTransactionHeader, PepperiImportHeaderTemp>(); // //cfg.CreateMap<PepperiTransactionTempModel.SalesTransactionTransactionLine, PepperiImportHeaderTemp>(); //})); //Mapper = config.CreateMapper(); }
public MembershipManagementService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <User, UserModel>(); cfg.CreateMap <UserModel, User>(); cfg.CreateMap <UserAlias, UserAliasModel>(); cfg.CreateMap <UserAliasModel, UserAlias>(); })); Mapper = config.CreateMapper(); }
public TaskService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <ScheduledTask, ScheduledTaskModel>(); cfg.CreateMap <ScheduledTaskModel, ScheduledTask>() .ForSourceMember(s => s.CurrentState, t => t.Ignore()) .ForSourceMember(s => s.LastRun, t => t.Ignore()); cfg.CreateMap <ScheduledTaskLog, ScheduledTaskLogModel>(); })); Mapper = config.CreateMapper(); }
public ShipmentService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <Shipment, Shipment>(); cfg.CreateMap <Shipment, ShipmentModel>(); cfg.CreateMap <ShipmentModel, Shipment>() .ForMember(s => s.CarrierVessel, t => t.Ignore()); cfg.CreateMap <ShipmentContent, ShipmentContentModel>(); cfg.CreateMap <ShipmentContentModel, ShipmentContent>(); cfg.CreateMap <FindShippingRegister_Result, ShipmentResultModel>(); })); Mapper = config.CreateMapper(); }
public SupplierService(EvolutionEntities dbEntities) : base(dbEntities) { // Setup Automapper mappings var config = new MapperConfiguration((cfg => { cfg.CreateMap <Supplier, Supplier>(); cfg.CreateMap <Supplier, SupplierModel>(); cfg.CreateMap <SupplierModel, Supplier>(); cfg.CreateMap <SupplierModel, SupplierModel>(); cfg.CreateMap <SupplierAddress, SupplierAddress>(); cfg.CreateMap <SupplierAddress, SupplierAddressModel>(); cfg.CreateMap <SupplierAddressModel, SupplierAddress>(); })); Mapper = config.CreateMapper(); }
internal static Task NewsCommentNotificationSendEmailAsync(int Id, string Comment) { EvolutionEntities _db = new EvolutionEntities(); var data = _db.News.Where(x => x.Id == Id).FirstOrDefault(); AdminNewsViewModel model = new AdminNewsViewModel(); model.EmployeeAccess = data.EmployeeAccess; model.ManagerAccess = data.ManagerAccess; model.CustomerAccess = data.CustomerAccess; model.SpecificWorker = data.SpecificWorker; model.SpecificManager = data.SpecificManager; model.SpecificCustomer = data.SpecificCustomer; model.WorkerID = data.WorkerID; model.ManagerID = data.ManagerID; model.CustomerID = data.CustomerID; model.Description = Comment; return(NewsCommentNotification(model)); }