Esempio n. 1
0
        private ArcUploadState taskUploadState;                        // the state of uploading archives according to the task


        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        public Exporter(ExportTargetConfig exporterConfig, EntityMap entityMap,
                        IServerData serverData, AppDirs appDirs, string arcDir)
        {
            this.exporterConfig = exporterConfig ?? throw new ArgumentNullException(nameof(exporterConfig));
            this.entityMap      = entityMap ?? throw new ArgumentNullException(nameof(entityMap));
            this.serverData     = serverData ?? throw new ArgumentNullException(nameof(serverData));
            this.arcDir         = arcDir ?? throw new ArgumentNullException(nameof(arcDir));

            GeneralOptions generalOptions = exporterConfig.GeneralOptions;

            dataLifetime = TimeSpan.FromSeconds(generalOptions.DataLifetime);
            string prefix = FilePrefix + "_" + generalOptions.ID.ToString("D3");

            log = new Log(Log.Formats.Simple)
            {
                FileName = Path.Combine(appDirs.LogDir, prefix + ".log")
            };
            infoFileName  = Path.Combine(appDirs.LogDir, prefix + ".txt");
            stateFileName = Path.Combine(appDirs.StorageDir, prefix + "_State.xml");
            exporterTitle = string.Format("[{0}] {1}", generalOptions.ID, generalOptions.Name);
            dataSource    = DataSourceFactory.GetDataSource(exporterConfig.ConnectionOptions);
            triggers      = new ClassifiedTriggers(exporterConfig.Triggers, dataSource);

            thread     = null;
            terminated = false;
            connStatus = ConnStatus.Undefined;

            CreateQueues();
            InitArcUploading();
        }
Esempio n. 2
0
 public ActionResult CreateReminder()
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         return(View());
     }
 }
Esempio n. 3
0
        public ActionResult ReminderDetails(int id)
        {
            using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
            {
                var reminder = ds.Reminder.SingleOrDefault(x => x.ReminderID == id);

                ReminderCenter model = new ReminderCenter
                {
                    ReminderID = reminder.ReminderID,

                    Subject          = reminder.Subject,
                    Details          = reminder.Details,
                    ReminderDateTime = reminder.AlertDateTime,

                    From = ds.Contacts.Where(x => x.ContactID == reminder.From)
                           .Select(x => new FromReminderListTableRow
                    {
                        ContactID    = x.ContactID,
                        FirstMidName = x.FirstMidName,
                        LastName     = x.LastName
                    }).ToList(),

                    To = ds.Contacts.Where(x => x.ContactID == reminder.To)
                         .Select(x => new ToReminderListTableRow
                    {
                        ContactID    = x.ContactID,
                        FirstMidName = x.FirstMidName,
                        LastName     = x.LastName
                    }).ToList()
                };


                return(View(model));
            }
        }
Esempio n. 4
0
        // GET: contact/Details/5
        public ActionResult Details(int id)
        {
            using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
            {
                var contact = ds.Contacts.SingleOrDefault(x => x.ContactID == id);
                ContactCenterModel model = new ContactCenterModel
                {
                    ContactID           = contact.ContactID,
                    FirstMidName        = contact.FirstMidName,
                    LastName            = contact.LastName,
                    EmailAddress        = contact.EmailAddress,
                    Address             = contact.Address,
                    CountryID           = contact.CountryID,
                    CellPhone           = contact.CellPhone,
                    Phone               = contact.Phone,
                    TeudatZehutPassport = contact.TeudatZehutPassport,



                    contactType = ds.ContactType.Where(x => x.ContactTypeID == contact.ContactType)
                                  .Select(x => new ContactTypeModel
                    {
                        ContactTypeID   = x.ContactTypeID,
                        TypeDescription = x.TypeDescription
                    }).ToList()
                };

                return(View(model));
            }
        }
Esempio n. 5
0
        // GET: Contact
        public ActionResult Index()
        {
            using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
            {
                ContactModel model = new ContactModel
                {
                    Contacts = ds.Contacts
                               //.Include(c => c.ContactType)
                               .Select(x => new ContactCenterModel
                    {
                        ContactID           = x.ContactID,
                        FirstMidName        = x.FirstMidName,
                        LastName            = x.LastName,
                        EmailAddress        = x.EmailAddress,
                        Address             = x.Address,
                        TeudatZehutPassport = x.TeudatZehutPassport,
                        CountryID           = x.CountryID,
                        Phone     = x.Phone,
                        CellPhone = x.CellPhone,
                    }).ToList()
                };

                return(View(model));
            }
        }
 public ActionResult Practising()
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         return(View());
     }
 }
        public ActionResult Index()
        {
            using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
            {
                CourseModels model = new CourseModels
                {
                    Coursess = ds.Courses.Include(c => c.Contact)
                               .Select(x => new CourseModelsTableRow

                    {
                        CourseID           = x.CoursesID,
                        CourseName         = x.CourseName,
                        Module             = x.Module,
                        StartDate          = x.StartDate,
                        EndDate            = x.EndDate,
                        Credit             = x.Credit,
                        Price              = x.Price,
                        activated_date     = x.activated_date,
                        ParticapantsGender = (CourseModelsTableRow.Gender)x.Gender,
                        Format             = (CourseModelsTableRow.Location)x.Location,
                        DayOfWeek          = (CourseModelsTableRow.DaysOfWeek)x.DayOfWeek,
                        Comment            = x.Comment,
                        TimeClassBegins    = x.TimeClassBegins,
                        TimeClassEnds      = x.TimeClassEnds
                    }).ToList()
                };

                return(View(model));
            }
        }
Esempio n. 8
0
        public ActionResult ContactEdit(int id, ContactCenterModel model)
        {
            using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
            {
                if (ModelState.IsValid)
                {
                    foreach (ContactTypeModel contactType in model.contactType)
                    {
                        ds.ContactType.Single(x => x.ContactTypeID == contactType.ContactTypeID);
                        // .TypeDescription = contactType.TypeDescription;

                        ds.SaveChanges();
                    }

                    return(RedirectToAction("DisplayContactList"));
                }


                else
                {
                    var errors = ModelState.SelectMany(x => x.Value.Errors.Select(z => z.Exception));


                    return
                        (RedirectToAction("Options/" + id));
                }
                //return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
        }
 // GET: Coursestryout/Create
 public ActionResult Create()
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         ViewBag.ContactID = new SelectList(ds.Contacts, "ContactID", "FirstMidName");
         return(View());
     }
 }
Esempio n. 10
0
 public ActionResult DeleteReminderConfirmed(int id)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         Reminder reminder = ds.Reminder.Find(id);
         ds.Reminder.Remove(reminder);
         ds.SaveChanges();
         return(RedirectToAction("DisplayReminderList"));
     }
 }
Esempio n. 11
0
 public ActionResult DeleteConfirmed(int id)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         Contact contact = ds.Contacts.Find(id);
         ds.Contacts.Remove(contact);
         ds.SaveChanges();
         return(RedirectToAction("DisplayContactList"));
     }
 }
 public ActionResult DeleteConfirmed(int id)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         Courses course = ds.Courses.Find(id);
         ds.Courses.Remove(course);
         ds.SaveChanges();
         return(RedirectToAction("Index"));
     }
 }
 protected override void Dispose(bool disposing)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         if (disposing)
         {
             ds.Dispose();
         }
         base.Dispose(disposing);
     }
 }
Esempio n. 14
0
 public ActionResult EditReminder(int id, EditReminderModel model)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         if (ModelState.IsValid)
         {
             ds.SaveChanges();
         }
         return(RedirectToAction("DisplayReminderList"));
     }
 }
 private Courses GetDailyDeal()
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         var course = ds.Courses
                      .OrderBy(a => System.Guid.NewGuid())
                      .First();
         course.Price *= 0.5m;
         return(course);
     }
 }
Esempio n. 16
0
        public ActionResult CreateReminder([Bind(Include = "ReminderID,From,To,Subject,Details,AlertDateTime")] Reminder reminder)
        {
            using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
            {
                if (ModelState.IsValid)
                {
                    ds.Reminder.Add(reminder);
                    ds.SaveChanges();
                    return(RedirectToAction("DisplayReminderList"));
                }

                return(View(reminder));
            }
        }
 public ActionResult Edit([Bind(Include = "CourseID,CourseName,Module,StartDate,EndDate,Credit,DayOfWeek,ContactID,activated_date,TimeClassBegins,TimeClassEnds,Location,Gender,Price,Comment")] Courses course)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         if (ModelState.IsValid)
         {
             //ds.Entry(course).State = EntityState.Modified;
             ds.SaveChanges();
             return(RedirectToAction("Index"));
         }
         ViewBag.ContactID = new SelectList(ds.Contacts, "ContactID", "FirstMidName", course.ContactID);
         return(View(course));
     }
 }
Esempio n. 18
0
 public ActionResult Edit([Bind(Include = "FirstMidName,ContactType,LastName,EmailAddress,Address,TeudatZehutPassport,CountryID,Phone,CellPhone")] Contact contact)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         if (ModelState.IsValid)
         {
             //ds.Entry(course).State = EntityState.Modified;
             ds.SaveChanges();
             return(RedirectToAction("DisplayContactList"));
         }
         ViewBag.ContactID = new SelectList(ds.Contacts, "ContactID", "FirstMidName", contact.ContactID);
         return(View(contact));
     }
 }
 // GET: Courses/Delete/5
 public ActionResult Delete(int?id)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         if (id == null)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         Courses course = ds.Courses.Find(id);
         if (course == null)
         {
             return(HttpNotFound());
         }
         return(View(course));
     }
 }
Esempio n. 20
0
 public ActionResult DeleteReminder(int?id)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         if (id == null)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         Reminder reminder = ds.Reminder.Find(id);
         if (reminder == null)
         {
             return(HttpNotFound());
         }
         return(View(reminder));
     }
 }
 // GET: Courses/Edit/5
 public ActionResult Edit(int?id)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         if (id == null)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         Courses course = ds.Courses.Find(id);
         if (course == null)
         {
             return(HttpNotFound());
         }
         ViewBag.ContactID = new SelectList(ds.Contacts, "ContactID", "FirstMidName", course.ContactID);
         return(View(course));
     }
 }
Esempio n. 22
0
 public ActionResult EditReminder(int id)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         var reminder            = ds.Reminder.SingleOrDefault(x => x.ReminderID == id);
         EditReminderModel model = new EditReminderModel
         {
             ReminderID       = id,
             From             = reminder.From,
             To               = reminder.To,
             Subject          = reminder.Subject,
             Details          = reminder.Details,
             ReminderDateTime = reminder.AlertDateTime
         };
         return(View(model));
     }
 }
Esempio n. 23
0
 public ActionResult StudentGradeDetails(int id)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         var student = ds.Participant.SingleOrDefault(x => x.ParticipantID == id);
         StudentGradeDetailsModel model = new StudentGradeDetailsModel
         {
             FirstName = student.Contact.FirstMidName,
             LastName  = student.Contact.LastName,
             Grades    = ds.Participant.Where(x => x.ContactID == student.ContactID).Select(x => new GradeTableModel
             {
                 Coursename = x.Courses.CourseName,
                 Module     = x.Courses.Module,
                 Grade      = x.Grade
             }).ToList()
         };
         return(View(model));
     }
 }
Esempio n. 24
0
        //[HttpPost]
        //[ValidateAntiForgeryToken]
        //public ActionResult EditReminder([Bind(Include = "FirstMidName,LastName,EmailAddress,Address,TeudatZehutPassport,CountryID,Phone,CellPhone")] Reminder reminder)
        //{
        //    using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
        //    {
        //        if (ModelState.IsValid)
        //        {
        //            //ds.Entry(course).State = EntityState.Modified;
        //            ds.SaveChanges();
        //            return RedirectToAction("DisplayReminderList");
        //        }
        //        //ViewBag.ContactID = new SelectList(ds.Contacts, "ContactID", "FirstMidName", contact.ContactID);
        //        return View(reminder);
        //    }
        //}



        public ActionResult ReminderList()
        {
            using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
            {
                ReminderScreen model = new ReminderScreen
                {
                    Reminders = ds.Reminder.Include(c => c.From)
                                .Select(x => new ReminderCenter

                    {
                        ReminderID = x.ReminderID,


                        Subject          = x.Subject,
                        Details          = x.Details,
                        ReminderDateTime = x.AlertDateTime,



                        //        From = ds.Reminder.Where(s => s. )
                        //.Select(d => new FromReminderListTableRow
                        //{

                        //})
                    }).ToList()

                                //ContactID = x.ContactID,
                                //FirstMidName = x.FirstMidName + " " + x.LastName,

                                //To = ds.Contacts.Where(x => x.ContactID == reminder.To)
                                //.Select(x => new ToReminderListTableRow
                                //{

                                //    ContactID = x.ContactID,
                                //    FirstMidName = x.FirstMidName,
                                //    LastName = x.LastName
                                //}).ToList()
                };

                return(View(model));
            }
        }
Esempio n. 25
0
        public ActionResult GradeClassEdit(int id, GradeClassModel model)
        {
            using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
            {
                if (ModelState.IsValid)
                {
                    foreach (ParticipantModel participant in model.Participants)
                    {
                        ds.Participant.Single(x => x.ParticipantID == participant.ParticpantID).Grade = participant.Grade;
                        ds.SaveChanges();
                    }

                    return(RedirectToAction("GradeClass/" + id));
                }
                else
                {
                    return(RedirectToAction("GradeClassEdit/" + id));
                }
            }
        }
Esempio n. 26
0
        /// <summary>
        /// Load in all of the source providers. Currently does not allow extensions
        /// or third party providers, which is a pretty simple addition.
        ///
        /// Right now, it's an azure blob source or local file source
        /// </summary>
        private void LoadSourceProviders()
        {
            // Blob Source
            IDataSource blobSource = DataSourceFactory.GetDataSource(DataSourceProvider.AzureBlob, DataSink.Catalog);

            blobSource.ConfigurationControl.OnConfigurationUdpated = this.IDataSourceOnConfigurationUdpated;
            blobSource.ConfigurationControl.OnSourceDataUpdated    = this.IDataSourceOnSourceDataUpdated;
            blobSource.ConfigurationControl.Parent = this;

            // Disk Source
            IDataSource localSource = DataSourceFactory.GetDataSource(DataSourceProvider.LocalDisk, DataSink.Catalog);

            localSource.ConfigurationControl.OnConfigurationUdpated = this.IDataSourceOnConfigurationUdpated;
            localSource.ConfigurationControl.OnSourceDataUpdated    = this.IDataSourceOnSourceDataUpdated;
            localSource.ConfigurationControl.Parent = this;

            // Labelled blob Source
            IDataSource labelledBlobSource = DataSourceFactory.GetDataSource(DataSourceProvider.LabeledAzureBlob, DataSink.Catalog);

            labelledBlobSource.ConfigurationControl.OnConfigurationUdpated = this.IDataSourceOnConfigurationUdpated;
            labelledBlobSource.ConfigurationControl.OnSourceDataUpdated    = this.IDataSourceOnSourceDataUpdated;
            labelledBlobSource.ConfigurationControl.Parent = this;

            // Labelled local Source
            IDataSource labelledLocalSource = DataSourceFactory.GetDataSource(DataSourceProvider.LabelledLocalDisk, DataSink.Catalog);

            labelledLocalSource.ConfigurationControl.OnConfigurationUdpated = this.IDataSourceOnConfigurationUdpated;
            labelledLocalSource.ConfigurationControl.OnSourceDataUpdated    = this.IDataSourceOnSourceDataUpdated;
            labelledLocalSource.ConfigurationControl.Parent = this;

            this.ApplicationContext.DataSources = new List <IDataSource>()
            {
                labelledLocalSource, localSource, blobSource, labelledBlobSource
            };

            // Set the UI up but don't select one, happens later after we hook the selection changed.
            foreach (IDataSource source in this.ApplicationContext.DataSources)
            {
                this.ConfigurationTabSourceProviderCombo.Items.Add(new DataSourceComboItem(source));
            }
        }
Esempio n. 27
0
        public ActionResult DisplayReminderList()
        {
            using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
            {
                ReminderListCenter model = new ReminderListCenter
                {
                    Reminderss = ds.Reminder.Select(x => new ReminderList
                    {
                        ReminderID = x.ReminderID,
                        From       = ds.Contacts.FirstOrDefault(d => d.ContactID == x.From).FirstMidName + " " + ds.Contacts.FirstOrDefault(d => d.ContactID == x.From).LastName,
                        To         = ds.Contacts.FirstOrDefault(d => d.ContactID == x.To).FirstMidName + " " + ds.Contacts.FirstOrDefault(d => d.ContactID == x.To).LastName,

                        Details          = x.Details,
                        ReminderDateTime = x.AlertDateTime,
                        Subject          = x.Subject,
                    }
                                                    ).ToList()
                };
                return(View(model));
            }
        }
Esempio n. 28
0
 public ActionResult GradeClassEdit(int id)
 {
     using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
     {
         var             course = ds.Courses.SingleOrDefault(x => x.CoursesID == id);
         GradeClassModel model  = new GradeClassModel
         {
             CourseID     = id,
             CourseName   = course.CourseName,
             Module       = course.Module,
             StartDate    = course.StartDate,
             Participants = ds.Participant.Where(x => x.CoursesID == id).Select(x => new ParticipantModel
             {
                 ParticpantID = x.ParticipantID,
                 FirstName    = x.Contact.FirstMidName,
                 LastName     = x.Contact.LastName,
                 Grade        = x.Grade
             }).ToList()
         };
         return(View(model));
     }
 }
Esempio n. 29
0
        // GET: Teacher
        public ActionResult ClassList()
        {
            using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
            {
                var user = UserManager.FindById(User.Identity.GetUserId());

                ClassListModel model = new ClassListModel
                {
                    TeacherName = ds.Contacts.SingleOrDefault(x => x.ContactID == user.ContactID).FirstMidName + " " + ds.Contacts.SingleOrDefault(x => x.ContactID == user.ContactID).LastName,
                    Classes     = ds.Courses.Where(x => x.ContactID == user.ContactID)
                                  .Select(x => new ClassListTableRow
                    {
                        CourseID   = x.CoursesID,
                        CourseName = x.CourseName,
                        Module     = x.Module,
                        StartDate  = x.StartDate
                    }).ToList()
                };

                return(View(model));
            }
        }
        // GET: Courses/Details/5
        public ActionResult Details(int id)
        {
            using (IHoneyMustardDataSource ds = DataSourceFactory.GetDataSource())
            {
                var course = ds.Courses.SingleOrDefault(x => x.CoursesID == id);
                CourseModelsTableRow model = new CourseModelsTableRow
                {
                    CourseID           = course.CoursesID,
                    CourseName         = course.CourseName,
                    Module             = course.Module,
                    StartDate          = course.StartDate,
                    EndDate            = course.EndDate,
                    Credit             = course.Credit,
                    Price              = course.Price,
                    activated_date     = course.activated_date,
                    ParticapantsGender = (CourseModelsTableRow.Gender)course.Gender,
                    Format             = (CourseModelsTableRow.Location)course.Location,
                    DayOfWeek          = (CourseModelsTableRow.DaysOfWeek)course.DayOfWeek,
                    Comment            = course.Comment,
                    TimeClassBegins    = course.TimeClassBegins,
                    TimeClassEnds      = course.TimeClassEnds,

                    Contact = ds.Contacts.Where(x => x.ContactID == course.ContactID)
                              .Select(x => new ContactListTableRow

                    {
                        ContactID    = x.ContactID,
                        FirstMidName = x.FirstMidName,
                        LastName     = x.LastName
                    }).ToList()
                };
                if (TempData.ContainsKey("course"))
                {
                    ViewBag.Message = TempData["course"];
                }
                //ViewBag.Message = TempData["mesaage"];
                return(View(model));
            }
        }