Beispiel #1
0
        private void ProcessEmailJobStatus(string emailAddresses, AryaTask job, bool includeLogUrl, string customStatus = null)
        {
            var emailAddress = emailAddresses;
            var projectName  = string.Empty;

            try
            {
                using (var aryaDb = new AryaDbDataContext(job.ProjectID, job.SubmittedBy))
                {
                    if (string.IsNullOrWhiteSpace(emailAddress))
                    {
                        emailAddress = aryaDb.CurrentUser.EmailAddress;
                    }
                    projectName = aryaDb.CurrentProject.ProjectName;
                }
            }
            catch (UnauthorizedAccessException e)
            {
                CurrentLogWriter.Warn(e.Message);
            }

            try
            {
                AryaServices.SendEmail(job, includeLogUrl, customStatus, projectName, emailAddress, Settings.Default.PortalLocation);
            }
            catch (Exception ex)
            {
                CurrentLogWriter.Error(String.Format("Email sending has failed. {0} has occured. Details{1}",
                                                     ex.GetType(), ex.StackTrace));
            }
        }
Beispiel #2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                var taskId = GetAllValues();

                var task = AryaServices.CreateAryaTask(taskId, Guid.Parse(projectId.Value), txtProjectDesc.Text,
                                                       Path.Combine(projectId.Value, folderGuid.Value), Guid.Parse(userId.Value), typeof(ImportWorker));

                AryaServices.SendEmail(task, false, null, ddlProject.SelectedItem.Text,
                                       ((SiteMaster)Page.Master).Email, "http://" + Request.Url.Authority + Request.ApplicationPath);

                Response.Redirect("Status.aspx");
            }
        }
Beispiel #3
0
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            var args = SaveParameters();

            if (args == null)
            {
                LblMessage.Text = "There was a problem saving the parameters.";
                return;
            }

            var task = AryaServices.CreateAryaTask(Guid.NewGuid(), Guid.Parse(ddlModel.SelectedValue), args.JobDescription,
                                                   Path.Combine(ddlModel.SelectedValue, args.Id.ToString()), Guid.Parse(UserId.Value), ExportType);

            AryaServices.SendEmail(task, false, null, ddlModel.SelectedItem.Text, ((SiteMaster)Page.Master).Email, "http://" + Request.Url.Authority + Request.ApplicationPath);
            //Response.Redirect("Status.aspx?ProjectID=" + ddlModel.SelectedValue + "&JobType=" + ExportType);
            Response.Redirect("Status.aspx");
        }