示例#1
0
 public int Delete(VideoRec entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Delete(entityToInsert));
     }
 }
示例#2
0
 public int Update(VideoRec entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Update(entityToInsert));
     }
 }
示例#3
0
 public int Insert(VideoRec entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Insert <int>(entityToInsert));
     }
 }
示例#4
0
 public VideoRecAddAndEditForm(string operType, VideoRec vr)
 {
     InitializeComponent();
     this.operType = operType;
     if (operType.Equals("Edit"))
     {
         labelX_Name.Text          = "编辑视频录像";
         this.vr                   = vr;
         textBoxX_Path.Text        = vr.VideoRecPath;
         textBoxX_Name.Text        = vr.VideoRecName;
         dateTimeInput_Time.Value  = vr.RecTime;
         textBoxX_Location.Text    = vr.RecLocation;
         textBoxX_Src.Text         = vr.RecSrc;
         textBoxX_EventType.Text   = vr.EventType;
         textBoxX_Description.Text = vr.Description;
     }
     else
     {
         labelX_Name.Text = "新增视频录像";
     }
 }
示例#5
0
        public MainWindow()
        {
            InitializeComponent();

            audioRec = new AudioRec();
            InitAudioView();

            threadAudio = new LabelTimeThread(LabelTimeAudio);
            audioRec.ThreadLabelTimeEventStart += threadAudio.Start;
            audioRec.ThreadLabelTimeEventStop  += threadAudio.Stop;
            audioRec.MetroMessageBoxEvent      += MetroMessageBox;

            videoRec = new VideoRec(sampleImage);
            InitVideoView();

            threadVideo = new LabelTimeThread(LabelTimeVideo);
            videoRec.ThreadLabelTimeEventStart += threadVideo.Start;
            videoRec.ThreadLabelTimeEventStop  += threadVideo.Stop;
            videoRec.MetroMessageBoxEvent      += MetroMessageBox;

            InitSettings();
        }
示例#6
0
        private void buttonX_Save_Click(object sender, EventArgs e)
        {
            VideoRecRepository repo = new VideoRecRepository();

            try
            {
                if (operType.Equals("Add"))
                {
                    VideoRec newVR = new VideoRec();
                    newVR.VideoRecPath = textBoxX_Path.Text;
                    newVR.VideoRecName = textBoxX_Name.Text;
                    newVR.RecTime      = dateTimeInput_Time.Value;
                    newVR.RecLocation  = textBoxX_Location.Text;
                    newVR.RecSrc       = textBoxX_Src.Text;
                    newVR.EventType    = textBoxX_EventType.Text;
                    newVR.Description  = textBoxX_Description.Text;
                    repo.Insert(newVR);
                }
                else
                {
                    vr.VideoRecPath = textBoxX_Path.Text;
                    vr.VideoRecName = textBoxX_Name.Text;
                    vr.RecTime      = dateTimeInput_Time.Value;
                    vr.RecLocation  = textBoxX_Location.Text;
                    vr.RecSrc       = textBoxX_Src.Text;
                    vr.EventType    = textBoxX_EventType.Text;
                    vr.Description  = textBoxX_Description.Text;
                    repo.Update(vr);
                }
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }