Exemplo n.º 1
0
        private static Log getLog(
            LogDataContext dataContext,
            string id,
            string source)
        {
            var logFromDB =
                dataContext.Logs.Where(log => log.ID.Equals(id)).FirstOrDefault();

            if (logFromDB != null)
            {
                return(logFromDB);
            }
            var misparIshi = CurrentMisparIshi.GetCurrentMisparIshi();

            var newLog = new Log();

            newLog.TimeCreated   = DateTime.Now;
            newLog.ID            = id;
            newLog.MailSent      = 0;
            newLog.MorePressed   = 0;
            newLog.RequestsMade  = 0;
            newLog.SeeAllPressed = 0;
            newLog.Shared        = false;
            newLog.MisparIshi    = misparIshi;
            newLog.GivenName     = getGivenNameForMisparIshi(misparIshi);
            newLog.Source        = source;
            dataContext.Logs.InsertOnSubmit(newLog);
            return(newLog);
        }
Exemplo n.º 2
0
        public static IEnumerable <object> ReportBug(string report)
        {
            var bugReport = new BugReport();

            bugReport.Report             = report;
            bugReport.ReporterMisparIshi =
                CurrentMisparIshi.GetCurrentMisparIshi();
            bugReport.TimeReported = DateTime.Now;

            var dataContext = new LogDataContext();

            dataContext.BugReports.InsertOnSubmit(bugReport);
            dataContext.SubmitChanges();

            return(new object[] { new { Success = "Yes" } });

            // TODO(Josh): Figure out why this isn't working and fix it.

            /*try
             * {
             *  Microsoft.Office.Interop.Outlook.Application app =
             *      new Microsoft.Office.Interop.Outlook.Application();
             *  Microsoft.Office.Interop.Outlook.MailItem mailItem =
             *      app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
             *  mailItem.Subject = "מערכת אנשים - Bug report";
             *  mailItem.To = "*****@*****.**";
             *  mailItem.Body = report;
             *  mailItem.Send();
             *  return new object[] { new { Success = "Yes" } };
             * }
             * catch (Exception exception)
             * {
             *  return new object[] { new { exception } };
             * }*/
        }
Exemplo n.º 3
0
 private bool getIsMe()
 {
     return(CurrentMisparIshi.GetCurrentMisparIshi().Equals(person.MisparIshi));
 }