예제 #1
0
        /* Removing Button Control Code.
         *
         * protected void ButtonCreateReturn_Click(object sender, EventArgs e)
         * {
         *  using (CascadeEdgeCaptureDataContext NewEventEntry = new CascadeEdgeCaptureDataContext())
         *  {
         *      TableLocalEvent NewEvent = new TableLocalEvent();
         *      NewEvent.LocalCustomerID = Session["SessionSelectedCustomerID"].ToString();
         *      NewEvent.LocalEventID = TextBoxNewEventGUID.Text;
         *      NewEvent.LocalEventName = TextBoxEventName.Text;
         *      NewEvent.LocalEventDescription = TextBoxEventDescription.Text;
         *      NewEvent.LocalEventSite = TextBoxEventLocation.Text;
         *      NewEvent.LocalEventStatus = 0;
         *      NewEvent.LocalEventReleaseDate = TextBoxEventDate.Text;
         *      NewEvent.LocalEventDateCreated = DateTime.Now;
         *      NewEventEntry.TableLocalEvents.InsertOnSubmit(NewEvent);
         *      NewEventEntry.SubmitChanges();
         *
         *      Page.Server.Transfer("Menu.aspx");
         *
         *  }
         * }
         *
         * protected void ButtonCreateControl_Click(object sender, EventArgs e)
         * {
         *  using (CascadeEdgeCaptureDataContext NewEventEntry = new CascadeEdgeCaptureDataContext())
         *  {
         *      TableLocalEvent NewEvent = new TableLocalEvent();
         *      NewEvent.LocalCustomerID = Session["SessionSelectedCustomerID"].ToString();
         *      NewEvent.LocalEventID = TextBoxNewEventGUID.Text;
         *      NewEvent.LocalEventName = TextBoxEventName.Text;
         *      NewEvent.LocalEventDescription = TextBoxEventDescription.Text;
         *      NewEvent.LocalEventSite = TextBoxEventLocation.Text;
         *      NewEvent.LocalEventStatus = 0;
         *      NewEvent.LocalEventReleaseDate = TextBoxEventDate.Text;
         *      NewEvent.LocalEventDateCreated = DateTime.Now;
         *      NewEventEntry.TableLocalEvents.InsertOnSubmit(NewEvent);
         *      NewEventEntry.SubmitChanges();
         *
         *      Session["SessionSelectedEventID"] = TextBoxNewEventGUID;
         *
         *      Page.Server.Transfer("Control.aspx");
         *
         *  }
         * }
         */

        protected void ButtonUploadCameraFile_Click(object sender, EventArgs e)
        {
            if (LocalFileUpload.HasFile)
            {
                string fileName = TextBoxEventLocationFile.Text + "-" + TextBoxNewEventGUID.Text + System.IO.Path.GetExtension(LocalFileUpload.FileName);
                string savePath = @"C:\Users\Mark C Strathdee\Documents\Visual Studio 2013\Projects\BrittishCouncil\BrittishCouncil\Uploads\Source\";

                using (CascadeEdgeCaptureDataContext NewEventEntry = new CascadeEdgeCaptureDataContext())
                {
                    TableLocalEvent NewEvent = new TableLocalEvent();
                    NewEvent.LocalCustomerID       = Session["SessionSelectedCustomerID"].ToString();
                    NewEvent.LocalEventID          = TextBoxNewEventGUID.Text;
                    NewEvent.LocalAssetID          = Guid.NewGuid().ToString();
                    NewEvent.LocalEventName        = TextBoxEventNameFile.Text;
                    NewEvent.LocalEventDescription = TextBoxEventDescriptionFile.Text;
                    NewEvent.LocalEventSite        = TextBoxEventLocationFile.Text;
                    NewEvent.LocalAssetFileName    = fileName;
                    NewEvent.LocalEventStatus      = 1;
                    NewEvent.LocalEventReleaseDate = TextBoxEventDateFile.Text;
                    NewEvent.LocalEventDateCreated = DateTime.Now;
                    NewEventEntry.TableLocalEvents.InsertOnSubmit(NewEvent);
                    NewEventEntry.SubmitChanges();
                }

                savePath += fileName;
                LocalFileUpload.SaveAs(savePath);

                Page.Server.Transfer("Menu.aspx");
            }
        }
예제 #2
0
        protected void ButtonCloseSubmitQueue_Click(object sender, EventArgs e)
        {
            using (CascadeEdgeCaptureDataContext UpdateEventStatus = new CascadeEdgeCaptureDataContext())
            {
                TableLocalEvent CheckEvent = UpdateEventStatus.TableLocalEvents.SingleOrDefault(TableLocalEvent => TableLocalEvent.LocalEventID == DropDownListSelectEvent.Text);
                CheckEvent.LocalEventStatus       = 1;
                CheckEvent.LocalEventDateModified = DateTime.Now;
                UpdateEventStatus.SubmitChanges();
            }

            HttpWebRequest request1 = (HttpWebRequest)WebRequest.Create("http://*****:*****@trustsherpa.com", "H455elblad");

            HttpWebResponse response1 = (HttpWebResponse)request1.GetResponse();
            Stream          stm1      = response1.GetResponseStream();

            LabelCamera1Status.Text      = "Ready";
            LabelCamera1Status.ForeColor = System.Drawing.Color.White;
            LabelCamera1Status.BackColor = System.Drawing.Color.Green;

            HttpWebRequest request2 = (HttpWebRequest)WebRequest.Create("http://*****:*****@trustsherpa.com", "H455elblad");

            HttpWebResponse response2 = (HttpWebResponse)request2.GetResponse();
            Stream          stm2      = response2.GetResponseStream();

            LabelCamera2Status.Text      = "Ready";
            LabelCamera2Status.ForeColor = System.Drawing.Color.White;
            LabelCamera2Status.BackColor = System.Drawing.Color.Green;

            HttpWebRequest request3 = (HttpWebRequest)WebRequest.Create("http://*****:*****@trustsherpa.com", "H455elblad");

            HttpWebResponse response = (HttpWebResponse)request3.GetResponse();
            Stream          stm3     = response.GetResponseStream();

            LabelCamera1Status.Text      = "Ready";
            LabelCamera3Status.ForeColor = System.Drawing.Color.White;
            LabelCamera3Status.BackColor = System.Drawing.Color.Green;

            Response.Redirect("Queue.aspx");
        }
 partial void DeleteTableLocalEvent(TableLocalEvent instance);
 partial void UpdateTableLocalEvent(TableLocalEvent instance);
 partial void InsertTableLocalEvent(TableLocalEvent instance);
예제 #6
0
        protected void ButtonTransferRecordings_Click(object sender, EventArgs e)
        {
            using (CascadeEdgeCaptureDataContext LoadedLocalEvents = new CascadeEdgeCaptureDataContext())
            {
                LabelRecordings.Text = "Transferring Recordings - Please Wait";

                var LocalRecordings = LoadedLocalEvents.TableLocalEvents.Where(TableLocalEvents => TableLocalEvents.LocalEventStatus == 1);

                foreach (TableLocalEvent RecordingsToOutput in LocalRecordings)
                {
                    string fileName   = RecordingsToOutput.LocalAssetFileName;
                    string sourcePath = @"C:\Users\Mark C Strathdee\Documents\Visual Studio 2013\Projects\BrittishCouncil\BrittishCouncil\Uploads\Source\";
                    string targetPath = @"M:\bc\";

                    string sourceFile = System.IO.Path.Combine(sourcePath, fileName);
                    string destFile   = System.IO.Path.Combine(targetPath, fileName);

                    System.IO.File.Copy(sourceFile, destFile, true);

                    using (CascadeCoreDataContext NewEventEntry = new CascadeCoreDataContext())
                    {
                        TableEvent NewEvent = new TableEvent();
                        NewEvent.CustomerID       = RecordingsToOutput.LocalCustomerID;
                        NewEvent.EventID          = RecordingsToOutput.LocalEventID;
                        NewEvent.EventName        = RecordingsToOutput.LocalEventName;
                        NewEvent.EventDescription = RecordingsToOutput.LocalEventDescription;
                        NewEvent.EventSite        = RecordingsToOutput.LocalEventSite;
                        NewEvent.AssetFileName    = RecordingsToOutput.LocalAssetFileName;
                        NewEvent.EventStatus      = "2";
                        NewEvent.EventReleaseDate = RecordingsToOutput.LocalEventReleaseDate;
                        NewEvent.EventDateCreated = DateTime.Now;
                        NewEventEntry.TableEvents.InsertOnSubmit(NewEvent);
                        NewEventEntry.SubmitChanges();
                    }

                    using (CascadeCoreDataContext NewAssetEntry = new CascadeCoreDataContext())
                    {
                        TableAsset NewAsset = new TableAsset();
                        NewAsset.CustomerID       = RecordingsToOutput.LocalCustomerID;
                        NewAsset.EventID          = RecordingsToOutput.LocalEventID;
                        NewAsset.AssetID          = RecordingsToOutput.LocalAssetID;
                        NewAsset.AssetName        = RecordingsToOutput.LocalEventName;
                        NewAsset.AssetDescription = RecordingsToOutput.LocalEventDescription;
                        NewAsset.AssetFileName    = RecordingsToOutput.LocalAssetFileName;
                        NewAsset.AssetDateCreated = RecordingsToOutput.LocalEventDateCreated;
                        NewAssetEntry.TableAssets.InsertOnSubmit(NewAsset);
                        NewAssetEntry.SubmitChanges();
                    }

                    using (CascadeEdgeCaptureDataContext UpdateEventStatus = new CascadeEdgeCaptureDataContext())
                    {
                        TableLocalEvent CheckEvent = UpdateEventStatus.TableLocalEvents.SingleOrDefault(TableLocalEvent => TableLocalEvent.LocalEventID == RecordingsToOutput.LocalEventID);
                        CheckEvent.LocalEventStatus       = 2;
                        CheckEvent.LocalEventDateModified = DateTime.Now;
                        UpdateEventStatus.SubmitChanges();
                    }


                    LabelRecordings.Text = "Transferring Recordings - Please Wait";
                }

                LabelRecordings.Text = "The following recordings have been transferred to the central archive.";
            }
        }