Beispiel #1
0
        public static void SendPushCommentEvent(string what, string urlstr, string towho, string pusher, Controller ctrl)
        {
            try
            {
                if (string.Compare(towho, pusher, true) == 0)
                {
                    return;
                }

                var routevalue = new RouteValueDictionary();
                routevalue.Add("issuekey", "ABC");
                string scheme          = ctrl.Url.RequestContext.HttpContext.Request.Url.Scheme;
                string validatestr     = ctrl.Url.Action("UpdateIssue", "Issue", routevalue, scheme);
                var    netcomputername = "";
                try { netcomputername = System.Net.Dns.GetHostName(); }
                catch (Exception ex) { }
                validatestr = validatestr.Replace("//localhost", "//" + netcomputername);


                validatestr = validatestr.Split(new string[] { "/Issue" }, StringSplitOptions.RemoveEmptyEntries)[0] + urlstr;
                var content = what + " is added to your shared file by " + pusher + ":\r\n\r\n" + validatestr;

                var toaddrs = new List <string>();
                toaddrs.Add(towho);

                var reporter = pusher.Split(new string[] { "@" }, StringSplitOptions.RemoveEmptyEntries)[0].Replace(".", " ");
                EmailUtility.SendEmail(ctrl, "WUXI NPI System_" + reporter, toaddrs, content);
                new System.Threading.ManualResetEvent(false).WaitOne(20);
            }
            catch (Exception ex)
            { }
        }
Beispiel #2
0
        public static void SendPushDocEvent(string what, string urlstr, string towho, string pusher, Controller ctrl, string reason = "")
        {
            try
            {
                var routevalue = new RouteValueDictionary();
                routevalue.Add("issuekey", "ABC");
                string scheme          = ctrl.Url.RequestContext.HttpContext.Request.Url.Scheme;
                string validatestr     = ctrl.Url.Action("UpdateIssue", "Issue", routevalue, scheme);
                var    netcomputername = "";
                try { netcomputername = System.Net.Dns.GetHostName(); }
                catch (Exception ex) { }
                validatestr = validatestr.Replace("//localhost", "//" + netcomputername);


                validatestr = validatestr.Split(new string[] { "/Issue" }, StringSplitOptions.RemoveEmptyEntries)[0] + urlstr;

                var content = "";
                if (!string.IsNullOrEmpty(reason))
                {
                    content = "With Comment: " + reason + "\r\n\r\n";
                }
                content = content + what + " is share to you by " + pusher + ":\r\n\r\n" + validatestr;

                var toaddrs = new List <string>();
                toaddrs.Add(towho);
                EmailUtility.SendEmail(ctrl, "WUXI NPI System - " + pusher.Split(new string[] { "@" }, StringSplitOptions.RemoveEmptyEntries)[0].ToUpper()
                                       , toaddrs, content);
                new System.Threading.ManualResetEvent(false).WaitOne(20);
            }
            catch (Exception ex)
            { }
        }