|
|
@@ -821,27 +821,35 @@ namespace UnivateProperties_API.Repository.Timeshare
|
|
821
|
821
|
|
|
822
|
822
|
var template = _dbContext.Templates.FirstOrDefault(x => x.Name == "WeekLoaded-Owner");
|
|
823
|
823
|
|
|
824
|
|
- if (agent != null)
|
|
|
824
|
+ try
|
|
825
|
825
|
{
|
|
826
|
|
- template = _dbContext.Templates.FirstOrDefault(x => x.Name == "WeekLoaded-Agent");
|
|
827
|
|
- if (template != null)
|
|
|
826
|
+ if (agent != null)
|
|
828
|
827
|
{
|
|
829
|
|
- templateRepository.SendEmailTemplateWeek(template, agent, sellItem);
|
|
830
|
|
- }
|
|
831
|
|
- }
|
|
832
|
|
- else
|
|
833
|
|
- {
|
|
834
|
|
- if (template != null)
|
|
835
|
|
- {
|
|
836
|
|
- templateRepository.SendEmailTemplateWeek(template, owner, sellItem);
|
|
|
828
|
+ template = _dbContext.Templates.FirstOrDefault(x => x.Name == "WeekLoaded-Agent");
|
|
|
829
|
+ if (template != null)
|
|
|
830
|
+ {
|
|
|
831
|
+ templateRepository.SendEmailTemplateWeek(template, agent, sellItem);
|
|
|
832
|
+ }
|
|
837
|
833
|
}
|
|
838
|
|
- template = _dbContext.Templates.FirstOrDefault(x => x.Name == "WeekLoaded-UV");
|
|
839
|
|
- if (template != null)
|
|
|
834
|
+ else
|
|
840
|
835
|
{
|
|
841
|
|
- templateRepository.SendEmailTemplate(template, sellItem.Owner, new List<BaseEntity>() { sellItem, sellItem.Owner });
|
|
|
836
|
+ if (template != null)
|
|
|
837
|
+ {
|
|
|
838
|
+ templateRepository.SendEmailTemplateWeek(template, owner, sellItem);
|
|
|
839
|
+ }
|
|
|
840
|
+ template = _dbContext.Templates.FirstOrDefault(x => x.Name == "WeekLoaded-UV");
|
|
|
841
|
+ if (template != null)
|
|
|
842
|
+ {
|
|
|
843
|
+ templateRepository.SendEmailTemplate(template, sellItem.Owner, new List<BaseEntity>() { sellItem, sellItem.Owner });
|
|
|
844
|
+ }
|
|
|
845
|
+
|
|
842
|
846
|
}
|
|
843
|
|
-
|
|
844
|
847
|
}
|
|
|
848
|
+ catch(Exception ex)
|
|
|
849
|
+ {
|
|
|
850
|
+ throw (ex);
|
|
|
851
|
+ }
|
|
|
852
|
+
|
|
845
|
853
|
|
|
846
|
854
|
|
|
847
|
855
|
week.StatusId = 32;
|