public ManagerMessageViewModel(ManagerMessage domain) { MessageID = domain.MessageID; MessageText = domain.MessageText; IsPublic = domain.IsPublic; Timestamp = domain.Timestamp; }
private static void MakeRun(string arguments, ref ManagerMessage row) { try { //string arguments = @"-nosplash -nodesktop -sd D:\MyWorkGGTest\one\MGtcp -r test"; System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo("matlab", arguments); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; System.Diagnostics.Process myprocess = new System.Diagnostics.Process(); myprocess.StartInfo = startInfo; myprocess.StartInfo.UseShellExecute = false; myprocess.StartInfo.CreateNoWindow = true; myprocess.StartInfo.RedirectStandardOutput = true; myprocess.Start(); row.PID = myprocess.Id; //获取PID myprocess.WaitForExit(); //进程会一直处于等待退出状态。 } catch (Exception ex) { } }
public ManagerMessageViewModel(ManagerMessage domain, bool isDismissed) { MessageID = domain.MessageID; MessageText = domain.MessageText; IsPublic = domain.IsPublic; Timestamp = domain.Timestamp; IsDismissed = isDismissed; }
public ManagerMessageEntity(LeagueYear leagueYear, ManagerMessage domainMessage) { MessageID = domainMessage.MessageID; LeagueID = leagueYear.League.LeagueID; Year = leagueYear.Year; MessageText = domainMessage.MessageText; IsPublic = domainMessage.IsPublic; Timestamp = domainMessage.Timestamp.ToDateTimeUtc(); }
static void Main(string[] args) { SdkVersion(); //Test(); //TestKill(2203);//现在就想实验这个 ManagerMessage manager = new ManagerMessage(); MakeRun("", ref manager); string str = ClassTest.SayHello(); Console.WriteLine("Hello World!" + str); Console.ReadLine(); }
static void Main(string[] args) { Manager manager = new Manager(); Area area = new Area(); Person vickie = new Person(); vickie.Name = "Vickie"; Location personStartLocation01 = new Location(); personStartLocation01.X = 0; personStartLocation01.Y = 0; ManagerMessage response = manager.AddPerson(ref vickie, personStartLocation01); if (response.Success) { Console.WriteLine(response.Message); } Person mindy = new Person(); mindy.Name = "Mindy"; Location personStartLocation02 = new Location(); personStartLocation02.X = 10; personStartLocation02.Y = 10; response = manager.AddPerson(ref mindy, personStartLocation02); if (response.Success) { Console.WriteLine(response.Message); } Console.ReadLine(); }
public async Task <IActionResult> SendMessage(string msgTitle, string msgDesc) { if (string.IsNullOrEmpty(msgTitle) || string.IsNullOrEmpty(msgDesc)) { TempData["Error"] = "لطفا عنوان و شرح پیام را وارد کنید"; return(RedirectToAction("Index")); } var message = new ManagerMessage() { Description = msgDesc, Title = msgTitle, Seen = false, DateTime = DateTime.Now }; await _db.ManagerMessages.AddAsync(message); await _db.SaveChangesAsync(); TempData["Success"] = "پیغام شما با موفقیت به مدیر سایت ارسال گردید"; return(RedirectToAction("Index")); }
public string GetMails() { StringBuilder result = new StringBuilder(); try { result.AppendLine("Conecta con correo"); MailClient oClient = GetMailClient(); result.AppendLine("Conexión exitosa"); result.AppendLine("Obtiene correos nuevos"); MailInfo[] infoMails = oClient.GetMailInfos(); if (infoMails != null) { result.AppendLine(string.Format("Se encontraron {0} correos nuevos", infoMails.Length)); foreach (MailInfo infoMail in infoMails) { Mail oMail = null; try { oMail = oClient.GetMail(infoMail); List <string> headersIngored = new List <string> { "Auto-Submitted", "X-Auto-Response-Suppress", "Precedence" }; result.AppendLine(string.Format("Procesando correo {0} recibido {1}", oMail.Subject, oMail.ReceivedDate)); bool correovalido = true; foreach (string header in headersIngored) { correovalido = ValidaHeader(oMail.Headers.GetValueOfKey(header), _valuesIgnored); if (!correovalido) { break; } } if (correovalido) { result.AppendLine(string.Format("Correo {0} recibido {1} procesado como nuevo", oMail.Subject, oMail.ReceivedDate)); if (string.IsNullOrEmpty(oMail.Headers.GetValueOfKey("References"))) { result.AppendLine(string.Format("Correo {0} recibido {1} procesado como nuevo", oMail.Subject, oMail.ReceivedDate)); Smtp.SendNotificationNewTicket(oMail); } else { result.AppendLine(string.Format("Correo {0} recibido {1} procesado como comentario", oMail.Subject, oMail.ReceivedDate)); string references = oMail.Headers.GetValueOfKey("References"); string[] referencesArray = references.Split('~'); if (referencesArray.Any(w => w.Contains("ticket"))) { Smtp.SendNotificationCommentTicket(oMail); } else { Smtp.SendNotificationNewTicket(oMail); } } } else { result.AppendLine(string.Format("Correo {0} recibido {1} se descarto por motivo de autorespuesa", oMail.Subject, oMail.ReceivedDate)); } ManagerMessage.MarcarLeidoNoLeido(oClient, infoMail); } catch (Exception e) { if (oMail != null) { result.AppendLine("error al recibir correo: " + oMail.Subject); } else { result.AppendLine("error al recibir correo: " + e.Message); } } } } oClient.Quit(); } catch (Exception ex) { throw new Exception(ex.Message); } return(result.ToString().Trim()); }
public async Task PostNewManagerMessage(LeagueYear leagueYear, string message, bool isPublic) { var domainMessage = new ManagerMessage(Guid.NewGuid(), message, isPublic, _clock.GetCurrentInstant()); await _fantasyCriticRepo.PostNewManagerMessage(leagueYear, domainMessage); }
public Task PostNewManagerMessage(LeagueYear leagueYear, ManagerMessage domainMessage) { throw new NotImplementedException(); }