コード例 #1
0
        private static void SendNotification(decimal submissionId)
        {
            var submission = DBReadManager.GeFileSubmissionById(submissionId);

            if (submission == null)
            {
                return;
            }
            var files = DBReadManager.GetFilesPerSubmission(submissionId.ToString(CultureInfo.InvariantCulture));
            var roles = DbReader.GetRolesToNotify();

            if (roles.HasRows)
            {
                var x = (from s in roles.Tables[0].Rows.OfType <DataRow>()
                         select s["EmailAddress"].ToString()).ToArray();

                var fileList = new StringBuilder();
                //fileList.Append("<ul>");
                foreach (DataRow file in files.Tables[0].Rows)
                {
                    fileList.AppendFormat("<li>{0} - {1}</li>", file["Category"], file["Classification"]);
                }

                //fileList.Append("</ul>");

                var messageBody = string.Format(
                    File.ReadAllText("FileArrivalNotification.htm")
                    , submission.TaxRefNo
                    , submission.Year
                    , fileList
                    , SARSDataSettings.Settings.ApplicationName);
                FdrCommon.SendEmail(x, messageBody, "CBC Declaration");
            }
        }
コード例 #2
0
    private void LoadFiles()
    {
        using (var files = DBReadManager.GetFilesPerSubmission(SubmissionId))
        {
            //if (!files.HasRows) return;
            var view = files.Tables[0].DefaultView;

            view.RowFilter = "FileCategoryID='1'";
            gvMasterFiles.Bind(view);
            view.RowFilter = "FileCategoryID='2'";
            gvLocalFiles.Bind(view);
        }
    }