コード例 #1
0
        protected void gv_files_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            foreach (GridViewRow row in gv_files.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    CheckBox chkRow = (row.Cells[3].FindControl("chk_select") as CheckBox);
                    if (chkRow.Checked)
                    {
                        if (row.RowType == DataControlRowType.DataRow)
                        {
                            Button btnButton = (Button)row.FindControl("cmd_action");
                            if (row.Cells[10].Text == "ERROR")
                            {
                                str_session = row.Cells[3].Text;
                                str_video   = row.Cells[7].Text;

                                using (var edm_material = new db_transcriptEntities())
                                {
                                    var i_material = (from c in edm_material.inf_material
                                                      where c.sesion == str_session
                                                      select c).FirstOrDefault();

                                    i_material.id_estatus_material = 6;

                                    edm_material.SaveChanges();
                                }
                                var two_user = new int?[] { 1, 4, 5, 6 };
                                flist_user(two_user);

                                lblModalTitle.Text = "transcript";
                                lblModalBody.Text  = "Comienza proceso de Conversión, favor de esperar.";
                                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal", "$('#myModal').modal();", true);
                                upModal.Update();
                            }
                            else if (row.Cells[10].Text == "ACTIVO")
                            {
                                str_session       = row.Cells[3].Text;
                                str_video         = row.Cells[7].Text;
                                div_panel.Visible = true;
                                UpdatePanel2.Update();
                                using (var edm_material = new db_transcriptEntities())
                                {
                                    var i_material = new inf_log_videos
                                    {
                                        sesion             = str_session,
                                        video              = str_video,
                                        id_usuario         = guid_fidusuario,
                                        id_tribunal        = guid_fidcentro,
                                        fecha_registro     = DateTime.Now,
                                        fecha_registro_alt = DateTime.Now
                                    };

                                    edm_material.inf_log_videos.Add(i_material);
                                    edm_material.SaveChanges();
                                }

                                str_session = row.Cells[3].Text;
                                str_video   = row.Cells[7].Text;



                                string d_pdf = "videos\\" + str_session + "\\ExtraFiles\\" + str_session + "_Report.pdf";
                                iframe_pdf.Visible           = true;
                                iframe_pdf.Attributes["src"] = d_pdf;

                                string str_namefile = @"videos\" + row.Cells[7].Text;

                                play_video.Visible           = true;
                                play_video.Attributes["src"] = str_namefile;
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
        protected void gv_files_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            foreach (GridViewRow row in gv_files.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    CheckBox chkRow = (row.Cells[3].FindControl("chk_select") as CheckBox);
                    if (chkRow.Checked)
                    {
                        if (row.RowType == DataControlRowType.DataRow)
                        {
                            Button btnButton = (Button)row.FindControl("cmd_action");
                            if (row.Cells[8].Text == "ERROR")
                            {
                                str_session = row.Cells[1].Text;
                                str_video   = row.Cells[5].Text;

                                using (var data_mat = new db_transcriptEntities())
                                {
                                    var items_mat = (from c in data_mat.inf_material
                                                     where c.sesion == str_session
                                                     select c).FirstOrDefault();

                                    items_mat.id_estatus_material = 6;

                                    data_mat.SaveChanges();
                                }
                                var two_user = new int?[] { 1, 6 };
                                flist_user(two_user);

                                lblModalTitle.Text = "tranScript";
                                lblModalBody.Text  = "Comienza proceso de Conversión, favor de esperar.";
                                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal", "$('#myModal').modal();", true);
                                upModal.Update();
                            }
                            else if (row.Cells[8].Text == "CARGADO")
                            {
                                Guid id_fcenter = Guid.Parse(lbl_idcenter.Text);
                                div_panel.Visible = true;
                                UpdatePanel2.Update();
                                using (var insert_fiscal = new db_transcriptEntities())
                                {
                                    var items_fiscal = new inf_log_videos
                                    {
                                        sesion             = str_session,
                                        video              = str_video,
                                        id_usuario         = id_fuser,
                                        id_centro          = id_fcenter,
                                        fecha_registro     = DateTime.Now,
                                        fecha_registro_alt = DateTime.Now
                                    };

                                    insert_fiscal.inf_log_videos.Add(items_fiscal);
                                    insert_fiscal.SaveChanges();
                                }

                                string str_namefile = @"videos\" + row.Cells[5].Text;

                                play_video.Visible           = true;
                                play_video.Attributes["src"] = str_namefile;
                            }
                        }
                    }
                }
            }
        }