Beispiel #1
0
        public static void SendEmail(AryaTask job, bool includeLogUrl, string customStatus, string projectName, string emailAddress, string portalLocation)
        {
            var subject = String.Format("{0}: {1}", job.JobType.Spacify(), job.Description);
            //var to = aryaDb.CurrentUser.EmailAddress;
            var to          = emailAddress;
            var messageBody = String.Format(@"
    Project Name: {0}
    Description: {1}
    Status: {2}", projectName, job.Description, customStatus ?? WorkerBase.GetFriendlyWorkerState((WorkerState)Enum.Parse(typeof(WorkerState), job.Status)));

            if (includeLogUrl)
            {
                messageBody += String.Format("{0}{0}Log file can be viewed here: {1}/Log.aspx?ID={2}", Environment.NewLine,
                                             portalLocation, job.ID);
            }

            EmailSender.SendEmail(to, messageBody, subject);
        }
Beispiel #2
0
        public static AryaTask CreateAryaTask(Guid id, Guid projectID, string description, string argumentDirectoryPath, Guid submittedBy, Type jobType)
        {
            using (var db = new AryaServicesDbDataContext())
            {
                var nt = new AryaTask
                {
                    ID                    = id,
                    ProjectID             = projectID,
                    Description           = description,
                    ArgumentDirectoryPath = argumentDirectoryPath,
                    Status                = "New",
                    SubmittedBy           = submittedBy,
                    SubmittedOn           = DateTime.Now,
                    LastUpdateOn          = DateTime.Now,
                    JobType               = jobType.FullName.Split('.').Last()
                };

                db.AryaTasks.InsertOnSubmit(nt);
                db.SubmitChanges();

                return(nt);
            }
        }
Beispiel #3
0
 private void detach_AryaTasks(AryaTask entity)
 {
     this.SendPropertyChanging();
     entity.AryaSchedule = null;
 }
Beispiel #4
0
 partial void DeleteAryaTask(AryaTask instance);
Beispiel #5
0
 partial void UpdateAryaTask(AryaTask instance);
Beispiel #6
0
 partial void InsertAryaTask(AryaTask instance);