Esempio n. 1
0
        protected void gv_material_ext_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                GridViewRow gvr = (GridViewRow)(((Button)e.CommandSource).NamingContainer);

                string status      = gvr.Cells[5].Text.ToString().Trim();
                int    id_sessionf = int.Parse(gvr.Cells[0].Text);
                int    id_session;
                string str_sessionf;
                using (var data_mat = new db_transcriptEntities())
                {
                    var items_mat = (from c in data_mat.inf_material_ext
                                     where c.id_material_ext == id_sessionf
                                     select c).FirstOrDefault();

                    id_session = items_mat.id_material;
                }
                using (var data_mat = new db_transcriptEntities())
                {
                    var items_mat = (from c in data_mat.inf_material
                                     where c.id_material == id_session
                                     select c).FirstOrDefault();

                    str_sessionf = items_mat.sesion;
                }

                str_session = gvr.Cells[1].Text;
                str_video   = gvr.Cells[2].Text + ".mp4";
                var two_user = new int?[] { 1, 3, 4, 5, 8, 9 };

                switch (status)
                {
                case "ACTIVO":

                    using (var edm_material = new db_transcriptEntities())
                    {
                        var i_material = new inf_material_dep
                        {
                            sesion             = str_session,
                            video              = str_video,
                            id_usuario         = guid_fidusuario,
                            id_material        = 0,
                            fecha_registro     = DateTime.Now,
                            fecha_registro_alt = DateTime.Now
                        };

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

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

                    string str_namefile = @"videos\\" + str_sessionf + "\\" + str_session + "\\" + str_session + "\\" + str_video;

                    play_video.Visible           = true;
                    play_video.Attributes["src"] = str_namefile;
                    Button btn      = e.CommandSource as Button;
                    string name_btn = btn.Text;

                    if (name_btn == "PDF")
                    {
                        lblModalTitle.Text = "transcript";
                        Label1.Text        = "Expediente:" + str_sessionf + " - Sesión:" + str_session + " - Archivo:" + str_video.Replace(".mp4", "");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal_pdf", "$('#myModal_pdf').modal();", true);
                        up_pdf.Update();
                    }
                    else

                    {
                        lblModalTitle.Text = "transcript";
                        Label2.Text        = "Expediente:" + str_sessionf + " - Sesión:" + str_session + " - Archivo:" + str_video.Replace(".mp4", "");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal_video", "$('#myModal_video').modal();", true);
                        up_video.Update();
                    }

                    break;

                case "ERROR":

                    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 = 3;

                        data_mat.SaveChanges();
                    }

                    flist_user(two_user);
                    break;

                case "NUEVO":

                    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 = 3;

                        data_mat.SaveChanges();
                    }

                    flist_user(two_user);
                    break;
                }
            }
            catch
            { }
        }
Esempio n. 2
0
        protected void Unnamed_Click(object sender, EventArgs e)
        {
            //play_video.Visible = false;
            //div_panel.Visible = false;
            //UpdatePanel2.Update();
            GridViewRow row = (sender as LinkButton).NamingContainer as GridViewRow;

            var    two_user = new int?[] { 1, 3, 4, 5, 8, 9 };
            string status   = row.Cells[5].Text.ToString().Trim();

            int id_m_ext = int.Parse(row.Cells[0].Text);
            int id_m;

            switch (status)
            {
            case "XML":

                break;

            case "ACTIVO":

                string str_session_p;
                str_session = row.Cells[1].Text;
                str_video   = row.Cells[2].Text + ".mp4";

                //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();
                //    str_session_p
                //}

                using (var edm_material = new db_transcriptEntities())
                {
                    var i_material = new inf_material_dep
                    {
                        sesion             = str_session,
                        video              = str_video,
                        id_usuario         = guid_fidusuario,
                        id_material        = 0,
                        fecha_registro     = DateTime.Now,
                        fecha_registro_alt = DateTime.Now
                    };

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

                using (var data_mat = new db_transcriptEntities())
                {
                    var items_mat = (from c in data_mat.inf_material_ext
                                     where c.id_material_ext == id_m_ext
                                     select c).FirstOrDefault();

                    id_m = items_mat.id_material;
                }

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

                    string sessionf = items_mat.sesion;

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

                    string str_namefile = @"videos\\" + sessionf + "\\" + str_session + "\\" + str_session + "\\" + str_video;

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

                s_gn = 1;

                break;

            case "ERROR":
                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 = 3;

                    data_mat.SaveChanges();
                }

                break;

            case "NUEVO":

                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 = 3;

                    data_mat.SaveChanges();
                }

                flist_user(two_user);
                break;
            }
            //play_video.Visible = true;
            //div_panel.Visible = true;
            //UpdatePanel2.Update();
            //Response.Redirect(Request.Url.AbsoluteUri);
        }
Esempio n. 3
0
        protected void gv_usr_ext_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string str_session = null;
            string str_video   = null;
            string str_pdf     = null;
            string str_mp4     = null;
            string str_exp     = null;

            int int_estatus;

            Guid guid_exp, guid_se;

            try
            {
                GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);

                guid_se = Guid.Parse(gvr.Cells[0].Text.ToString().Trim());

                using (var data_mat = new bd_tsEntities())
                {
                    var items_mat = (from c in data_mat.inf_exp_mat
                                     where c.id_exp_mat == guid_se
                                     select c).FirstOrDefault();

                    guid_exp    = Guid.Parse(items_mat.id_control_exp.ToString());
                    str_video   = items_mat.ruta_archivo;
                    str_pdf     = items_mat.ruta_ext.Replace("C:\\inetpub\\wwwroot\\", "").Replace(".mp4", ".pdf");
                    str_mp4     = items_mat.ruta_archivo.Replace("C:\\inetpub\\wwwroot\\", "");
                    int_estatus = 1;
                    str_session = items_mat.nom_archivo;

                    var i_extmat = (from c in data_mat.inf_master_jvl
                                    where c.id_control_exp == guid_exp
                                    select c).FirstOrDefault();

                    str_exp = i_extmat.sesion;
                }
                //using (var data_mat = new bd_tsEntities())
                //{
                //    var items_mat = (from c in data_mat.inf_material
                //                     where c.id_material == id_session
                //                     select c).FirstOrDefault();

                //    str_sessionf = items_mat.sesion;
                //}



                switch (int_estatus)
                {
                case 1:
                    guid_fidusuario = (Guid)(Session["ss_id_user"]);
                    using (var edm_material = new bd_tsEntities())
                    {
                        var i_material = new inf_material_dep
                        {
                            id_exp_mat = guid_se,

                            id_usuario = guid_fidusuario,

                            fecha_registro     = DateTime.Now,
                            fecha_registro_alt = DateTime.Now
                        };

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

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

                    //string str_namefile = @"videos\\" + str_sessionf + "\\" + str_session + "\\" + str_session + "\\" + str_video;

                    LinkButton btn      = e.CommandSource as LinkButton;
                    string     name_btn = null;
                    name_btn = btn.ID;
                    if (name_btn == "lkb_pdf_exp")
                    {
                        iframe_pdf.Visible           = true;
                        iframe_pdf.Attributes["src"] = str_pdf;
                        lblModalTitle.Text           = "transcript";
                        Label1.Text = "Expediente:" + str_exp + " - Sesión:" + str_session + "";
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal_pdf", "$('#myModal_pdf').modal();", true);
                        up_pdf.Update();
                    }
                    else
                    {
                        play_video.Visible           = true;
                        play_video.Attributes["src"] = str_mp4;
                        lblModalTitle.Text           = "transcript";
                        Label2.Text = "Expediente:" + str_exp + " - Sesión:" + str_session + "";
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal_video", "$('#myModal_video').modal();", true);
                        up_video.Update();
                    }

                    break;

                case 2:

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

                        items_mat.id_estatus_material = 3;

                        data_mat.SaveChanges();
                    }

                    //flist_user(two_user);
                    break;

                case 3:

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

                        items_mat.id_estatus_material = 3;

                        data_mat.SaveChanges();
                    }

                    //flist_user(two_user);
                    break;
                }
            }
            catch
            {
            }
        }