public override void Cancelar(Common.Metadata config) { SkuaMetadata skuaMetadata = (SkuaMetadata)config; // Hacer aca lo necesario. this.Log.Info("Cancela grabación - Audiencia: " + skuaMetadata.IdAudiencia); }
private void btnAceptar_Click(object sender, EventArgs e) { if (this.GridAudiencias.SelectedRows.Count == 0) { MessageBox.Show("Debe seleccionar una audiencia", "Kenos - Skua", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } DataGridViewRow dr = this.GridAudiencias.SelectedRows[0]; this.MetadataResult = new SkuaMetadata(); this.MetadataResult.IdAudiencia = ConvertirAEntero(dr.Cells["IdAudiencia"].Value.ToString()); this.MetadataResult.Etiqueta = dr.Cells["Etiqueta"].Value.ToString(); this.MetadataResult.Caratula = dr.Cells["Caratula"].Value.ToString(); this.MetadataResult.Descripcion = dr.Cells["Tipo"].Value.ToString(); /*Fin Prueba*/ this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
private void btnAceptar_Click(object sender, EventArgs e) { if (this.GridAudiencias.SelectedRows.Count == 0) { MessageBox.Show("Debe seleccionar una audiencia", "Kenos - Skua", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } DataRow dr = ((DataTable)this.GridAudiencias.DataSource).Rows[this.GridAudiencias.SelectedRows[0].Index]; this.MetadataResult = new SkuaMetadata(); this.MetadataResult.IdAudiencia = (int)dr["IdAudiencia"]; this.MetadataResult.Etiqueta = dr["Etiqueta"].ToString(); this.MetadataResult.Caratula = dr["Carátula"].ToString(); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
public override void Finalizar(Common.Metadata config) { SkuaMetadata skuaMetadata = (SkuaMetadata)config; string name = skuaMetadata.IdAudiencia.ToString() + "_" + DateTime.Now.Ticks.ToString() + ".wmv"; string subFolder = skuaMetadata.Etiqueta.Replace(":", "_").Replace(" ", ""); string destination = Properties.Settings.Default.VideosRealPath + subFolder + @"\"; string userName = Properties.Settings.Default.UserName; string domainName = Properties.Settings.Default.DomainName; string password = Properties.Settings.Default.Password; List <Kenos.Common.MarcaTiempo> marcas = skuaMetadata.MarcasTiempo; try { //using (new Impersonator(userName, domainName, password)) //{ for (int i = 0; i < 3; i++) { if (!File.Exists(destination + name)) { System.IO.File.Move(skuaMetadata.FullFileName, destination + name); System.IO.File.Move(skuaMetadata.FullFileName + ".xml", destination + name + ".xml"); break; } name = skuaMetadata.IdAudiencia.ToString() + "_" + Path.GetRandomFileName() + ".wmv"; } if (!File.Exists(destination + name)) { MessageBox.Show("No se pudo mover a la carpeta destino", "Skua", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Log.Info("Error Move - Audiencia: " + skuaMetadata.IdAudiencia.ToString() + " - Archivo: " + skuaMetadata.FullFileName + " - Destino:" + destination + name); return; } //} string insert = "INSERT INTO tVideo (Nombre,Ruta,Fecha) " + " VALUES ('" + name + "', '" + Properties.Settings.Default.VideosPath + "/" + subFolder + "/" + name + "', '" + DateTime.Now + "') " + "SELECT SCOPE_IDENTITY()"; SqlConnection conexion = new SqlConnection(Properties.Settings.Default.Conexion); SqlCommand queryInsert = new SqlCommand(insert, conexion); conexion.Open(); int idVideo = (int)queryInsert.ExecuteScalar(); insert = "INSERT INTO tRecurso (IdTipoModelo1,IdObjeto1,IdTipoModelo2,IdObjeto2) " + " VALUES ( 2," + skuaMetadata.IdAudiencia.ToString() + ", 43," + idVideo.ToString() + ") "; queryInsert = new SqlCommand(insert, conexion); queryInsert.ExecuteNonQuery(); conexion.Close(); MessageBox.Show("Video capturados por Skua con éxito!", "Skua", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { MessageBox.Show("Integración de Video Skua fracasada: " + ex.Message, "Skua", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Log.Info("ERROR Fin grabación Audiencia: " + skuaMetadata.IdAudiencia.ToString()); return; } // Hacer aca lo necesario. this.Log.Info("Fin grabación - Audiencia: " + skuaMetadata.IdAudiencia + " - File: " + skuaMetadata.FullFileName); }