I am getting meaningless Compilation errors , any ideawhat it is about ?
namespace Terrasoft.Core.Process
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Globalization;
using System.Text;
using Terrasoft.Common;
using Terrasoft.Configuration;
using Terrasoft.Core;
using Terrasoft.Core.Configuration;
using Terrasoft.Core.DB;
using Terrasoft.Core.Entities;
using Terrasoft.Core.Process;
using Terrasoft.Core.Process.Configuration;
using Terrasoft.UI.WebControls.Utilities;
#region Class: UsrProcess_7b09d28TravelAgencyDev1MethodsWrapper
/// <exclude/>
public class UsrProcess_7b09d28TravelAgencyDev1MethodsWrapper : ProcessModel
{
public UsrProcess_7b09d28TravelAgencyDev1MethodsWrapper(Process process)
: base(process) {
AddScriptTaskMethod("ScriptTask2Execute", ScriptTask2Execute);
AddScriptTaskMethod("ScriptTask3Execute", ScriptTask3Execute);
AddScriptTaskMethod("ScriptTask4Execute", ScriptTask4Execute);
}
#region Methods: Private
private bool ScriptTask2Execute(ProcessExecutingContext context) {
string sender="AutoAddVisits";
string msgbody="something";
MsgChannelUtilities.PostMessage(UserConnection,sender,msgbody);
return true;
}
private bool ScriptTask3Execute(ProcessExecutingContext context) {
var frequency="frequencyInDays";
switch (frequency) {
case "Daily":
Set(frequency, 1);
break;
case "Weekly":
Set("frequency", 7);
break;
case "Monthly":
Set("frequency", 30);
break;
default:
break;
}
return true;
}
private bool ScriptTask4Execute(ProcessExecutingContext context) {
var travelOfferId = "TravelId";
var travelOfferSchemaName = "TravelOffers";
var travelOfferEsq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, travelOfferSchemaName);
travelOfferEsq.addColumn("TravelOfferFrequency");
var travelOffer = travelOfferEsq.getEntity(travelOfferId);
var tourSchemaName = "Tours";
var tourEsq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, tourSchemaName);
var tourCollection = new Collection();
var currentDate = new Date();
var firstTour = tourCollection.add(tourEsq.createEntity(UserConnection));
firstTour.set("TravelOffer", travelOfferId);
firstTour.set("TourDate", currentDate);
var travelOfferFrequency = travelOffer.get("UsrTravelOfferFrequencyId").displayValue;
var tourDate = currentDate;
for (var i = 1; i < 8; i++) {
switch (travelOfferFrequency) {
case "Daily":
tourDate.setDate(tourDate.getDate() + 1);
break;
case "Weekly":
tourDate.setDate(tourDate.getDate() + 7);
break;
case "Monthly":
tourDate.setDate(tourDate.getDate() + 30);
break;
default:
throw new UnknownException("Invalid travel offer frequency");
}
var tour = tourCollection.add(tourEsq.createEntity(UserConnection));
tour.set("TravelOffer", travelOfferId);
tour.set("TourDate", tourDate);
}
tourCollection.saveAll({
isExternal: true,
success: function() {
// The tour entities have been saved
},
failure: function() {
// An error occurred while saving the tour entities
}
});
}
#endregion
}
#endregion
}