Ejemplo n.º 1
0
    public static DataSet Short_Film_Send_To_DB(Short_Film objShort_Film, DataTable Artist)
    {
        try
        {
            SqlParameter[] objSqlParameter = new SqlParameter[16];

            objSqlParameter[0] = new SqlParameter("@Title", objShort_Film.Title);
            objSqlParameter[1] = new SqlParameter("@Tag", objShort_Film.Tag);

            objSqlParameter[2] = new SqlParameter("@Image", objShort_Film.Image);
            objSqlParameter[3] = new SqlParameter("@Short_film_Id", objShort_Film.Short_film_Id);
            objSqlParameter[4] = new SqlParameter("@Artist", Artist);

            objSqlParameter[5] = new SqlParameter("@Category", objShort_Film.Category);
            objSqlParameter[6] = new SqlParameter("@Language", objShort_Film.Language);
            objSqlParameter[7] = new SqlParameter("@Description", objShort_Film.Description);

            objSqlParameter[8]  = new SqlParameter("@Channel", objShort_Film.Channel);
            objSqlParameter[9]  = new SqlParameter("@Video", objShort_Film.Video);
            objSqlParameter[10] = new SqlParameter("@UserId", objShort_Film.UserId);
            objSqlParameter[11] = new SqlParameter("@CreatedDate", objShort_Film.CreatedDate);
            objSqlParameter[12] = new SqlParameter("@ShortIds", objShort_Film.ShortIds);
            objSqlParameter[13] = new SqlParameter("@Duration", objShort_Film.Duration);
            objSqlParameter[14] = new SqlParameter("@Trailer", objShort_Film.Trailer);
            objSqlParameter[15] = new SqlParameter("@Available", objShort_Film.Available);

            return(SqlHelper.ExecuteDataSet(con, CommandType.StoredProcedure, "Sp_Short_Film", objSqlParameter));
        }
        catch (Exception Ex)
        {
            throw Ex;
        }
    }
Ejemplo n.º 2
0
    public static DataSet Trailer_Send_To_DB(Short_Film objShort_Film, DataTable Artist)
    {
        try
        {
            SqlParameter[] objSqlParameter = new SqlParameter[5];

            objSqlParameter[0] = new SqlParameter("@Short_film_Id", objShort_Film.Short_film_Id);
            objSqlParameter[1] = new SqlParameter("@UserId", objShort_Film.UserId);
            objSqlParameter[2] = new SqlParameter("@CreatedDate", objShort_Film.CreatedDate);
            objSqlParameter[3] = new SqlParameter("@Trailer", objShort_Film.Trailer);
            objSqlParameter[4] = new SqlParameter("@Language", objShort_Film.Language);

            return(SqlHelper.ExecuteDataSet(con, CommandType.StoredProcedure, "Sp_Trailer", objSqlParameter));
        }
        catch (Exception Ex)
        {
            throw Ex;
        }
    }
Ejemplo n.º 3
0
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            string CategoryIds = ",";
            for (int i = 0; i < lstCategory.Items.Count; i++)
            {
                if (lstCategory.Items[i].Selected)
                {
                    CategoryIds = CategoryIds + lstCategory.Items[i].Value + ",";
                }
            }

            //string Video = fudUploadVideo.FileName;
            string Image = fupImage.FileName;
            if (txtTitle.Text.Trim() != "" && CategoryIds != "" && txtDescription.Text.Trim() != "" && Image != "" && ddlLanguage.SelectedIndex != 0)
            {
                if (txtURL.Text.Trim() != "" || txtURLTRailer.Text.Trim() != "")
                {
                    Short_Film objShort_Film = new Short_Film();

                    //string FileExt = Path.GetExtension(fudUploadVideo.FileName);
                    string[] Split123 = (txtTitle.Text.Trim()).Split('_');
                    objShort_Film.Title    = Split123[0].ToString();
                    objShort_Film.Tag      = txtTag.Text.Trim();
                    objShort_Film.Category = CategoryIds;
                    objShort_Film.Language = ddlLanguage.SelectedValue.ToString();
                    objShort_Film.Channel  = Convert.ToInt32(ddlProduction.SelectedValue.ToString());

                    string   Url      = txtURL.Text.Trim();
                    string[] SplitUrl = Url.Split('/');
                    string   NewUrl   = "";
                    if (SplitUrl.Length != 0)
                    {
                        for (int i = 0; i < SplitUrl.Length; i++)
                        {
                            if (i == 1)
                            {
                                NewUrl = NewUrl + "//player." + SplitUrl[i].ToString();
                            }
                            else if (i == 3)
                            {
                                NewUrl = NewUrl + "/video/" + SplitUrl[i].ToString();
                            }
                            else
                            {
                                NewUrl = NewUrl + SplitUrl[i].ToString();
                            }
                        }
                    }

                    objShort_Film.Video         = NewUrl;
                    objShort_Film.CreatedDate   = DateTime.Now.AddHours(Connection.SetHours);
                    objShort_Film.UserId        = Convert.ToInt32(Session["UserId"].ToString());
                    objShort_Film.Description   = txtDescription.Text.Trim();
                    objShort_Film.ShortIds      = "";
                    objShort_Film.Image         = Image;
                    objShort_Film.Short_film_Id = 0;
                    objShort_Film.Duration      = 0;

                    string   Url1      = txtURLTRailer.Text.Trim();
                    string[] SplitUrl1 = Url1.Split('/');
                    string   NewUrl1   = "";
                    if (SplitUrl1.Length != 0)
                    {
                        for (int i = 0; i < SplitUrl1.Length; i++)
                        {
                            if (i == 1)
                            {
                                NewUrl1 = NewUrl1 + "//player." + SplitUrl1[i].ToString();
                            }
                            else if (i == 3)
                            {
                                NewUrl1 = NewUrl1 + "/video/" + SplitUrl1[i].ToString();
                            }
                            else
                            {
                                NewUrl1 = NewUrl1 + SplitUrl1[i].ToString();
                            }
                        }
                    }

                    objShort_Film.Trailer   = NewUrl1;
                    objShort_Film.Available = lblAvailable.Text;

                    //lblAvailable.Text

                    DataSet objDataSet = Short_Film.Short_Film_Send_To_DB(objShort_Film, (DataTable)ViewState["Artist"]);
                    if (objDataSet.Tables[0].Rows[0][1].ToString() == "1")
                    {
                        //if (Video != "")
                        //    fudUploadVideo.SaveAs(Server.MapPath("~/Videos/") + "Shortfilm_" + objDataSet.Tables[0].Rows[0][0].ToString() + FileExt);

                        if (Image != "")
                        {
                            fupImage.SaveAs(Server.MapPath("~/Video_Images/") + "Shortfilm_" + objDataSet.Tables[0].Rows[0][2].ToString() + ".jpg");
                        }

                        if (lblAvailable.Text == "1")
                        {
                            if (Image != "")
                            {
                                fupImage.SaveAs(Server.MapPath("~/Video_Images/") + "Reg" + objDataSet.Tables[1].Rows[0][0].ToString() + ".jpg");
                            }
                        }

                        ShowNotification("Short Film", "Your film is uploaded successfully and we will inform you shortly once it got approved", NotificationType.success);

                        if (Convert.ToInt32(Session["UserId"].ToString()) == 1)
                        {
                            Display_List(gvShortFilm, "SELECT top 10 LS.Short_film_Id,Title,Tag,Category,(Select Channel_Name from tbl_admin_channel AC where AC.Channel_Id=SF.Channel)as Channel_Name,Channel,Description,case when LS.Status='Approve' then 'Approved' else 'Unapproved' end as Status,LS.Video,LS.CreatedDate,LS.CreatedById,LS.ModifiedDate,LS.ModifiedById,LS.Isactive,case when LS.Status='Approve' then 'label label-success' else case when LS.Status='Unapprove' then 'label label-danger' else 'label label-warning' end end as StatusClr,LS.Visits,(Select ','+Language_Name from tbl_admin_language where Language_Id in (select val from fn_String_To_Table(LS.Language,',',1))FOR XML PATH (''))as Language FROM tbl_Short_film   SF join tbl_Language_Short_FilmId LS on SF.Short_film_Id=LS.Short_Film_Id where LS.Isactive='True' Order by LS.Short_film_Id desc");
                        }
                        else
                        {
                            Display_List(gvShortFilm, "SELECT top 10 LS.Short_film_Id,Title,Tag,Category,(Select Channel_Name from tbl_admin_channel AC where AC.Channel_Id=SF.Channel)as Channel_Name,Channel,Description,case when LS.Status='Approve' then 'Approved' else 'Unapproved' end as Status,LS.Video,LS.CreatedDate,LS.CreatedById,LS.ModifiedDate,LS.ModifiedById,LS.Isactive,case when LS.Status='Approve' then 'label label-success' else case when LS.Status='Unapprove' then 'label label-danger' else 'label label-warning' end end as StatusClr,LS.Visits,(Select ','+Language_Name from tbl_admin_language where Language_Id in (select val from fn_String_To_Table(LS.Language,',',1))FOR XML PATH (''))as Language FROM tbl_Short_film   SF join tbl_Language_Short_FilmId LS on SF.Short_film_Id=LS.Short_Film_Id where LS.Isactive='True' and LS.CreatedById=" + Convert.ToInt32(Session["UserId"].ToString()) + " Order by LS.Short_film_Id desc");
                        }

                        Clear_Short_Film();
                    }
                }
                else
                {
                    ShowNotification("Short Film", "Please Select Video..!", NotificationType.error);
                }
            }
            else
            {
                ShowNotification("Short Film", "Please Fill All Fields..!", NotificationType.error);
            }
        }
        catch (Exception Ex)
        {
        }
    }
Ejemplo n.º 4
0
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            Button btn = sender as Button;
            switch (btn.CommandName)
            {
            case "Save":

                if (txtURL.Text.Trim() != "" && lblID.Text.Trim() != "" && ddlLanguage.SelectedIndex != 0)
                {
                    Short_Film objShort_Film = new Short_Film();

                    objShort_Film.CreatedDate = DateTime.Now.AddHours(Connection.SetHours);
                    objShort_Film.UserId      = Convert.ToInt32(Session["UserId"].ToString());

                    objShort_Film.Short_film_Id = Convert.ToInt32(lblID.Text.Trim());

                    string   Url1      = txtURL.Text.Trim();
                    string[] SplitUrl1 = Url1.Split('/');
                    string   NewUrl1   = "";
                    if (SplitUrl1.Length != 0)
                    {
                        for (int i = 0; i < SplitUrl1.Length; i++)
                        {
                            if (i == 1)
                            {
                                NewUrl1 = NewUrl1 + "//player." + SplitUrl1[i].ToString();
                            }
                            else if (i == 3)
                            {
                                NewUrl1 = NewUrl1 + "/video/" + SplitUrl1[i].ToString();
                            }
                            else
                            {
                                NewUrl1 = NewUrl1 + SplitUrl1[i].ToString();
                            }
                        }
                    }

                    objShort_Film.Trailer  = NewUrl1;
                    objShort_Film.Language = ddlLanguage.SelectedValue.ToString();

                    DataSet objDataSet = Short_Film.Trailer_Send_To_DB(objShort_Film, (DataTable)ViewState["Artist"]);
                    if (objDataSet.Tables[0].Rows[0][0].ToString() == "1")
                    {
                        ShowNotification("Trailer", "Your trailer is uploaded successfully and we will inform you shortly once it got approved", NotificationType.success);

                        ddlTitle.SelectedIndex    = 0;
                        txtTag.Text               = "";
                        ddlLanguage.SelectedIndex = 0;
                        lblID.Text = "";

                        if (Session["UserName"] == "admin")
                        {
                            Titles_List(gvTitle, "select Title_Id,Title_Name,Isactive,Tag,(Select ','+Language_Name from tbl_admin_language where Language_Id in (select val from fn_String_To_Table(Languages,',',1))FOR XML PATH (''))as Languages,CreatedById,Languages as Languages1 from tbl_Register_Title Order by Title_Name");
                        }
                        else
                        {
                            Titles_List(gvTitle, "select Title_Id,Title_Name,Isactive,Tag,(Select ','+Language_Name from tbl_admin_language where Language_Id in (select val from fn_String_To_Table(Languages,',',1))FOR XML PATH (''))as Languages,Languages as Languages1 from tbl_Register_Title where CreatedById='" + Session["UserId"].ToString() + "' Order by Title_Name");
                        }
                    }
                }
                else
                {
                    ShowNotification("Trailer", "Please Select Trailer..!", NotificationType.error);
                }
                break;

            case "Clear":
                ddlTitle.SelectedIndex    = 0;
                txtTag.Text               = "";
                ddlLanguage.SelectedIndex = 0;
                lblID.Text = "";
                break;

            case "Update":

                string ULanguesIds = ",";
                for (int i = 0; i < lstUpdateLanguage.Items.Count; i++)
                {
                    if (lstUpdateLanguage.Items[i].Selected)
                    {
                        ULanguesIds = ULanguesIds + lstUpdateLanguage.Items[i].Value.ToString() + ",";
                    }
                }
                btnClose.Focus();
                break;

            case "Seach":

                break;
            }
        }
        catch (Exception Ex)
        {
            StackTrace objStackTrace    = new StackTrace();
            string     calledMethodName = objStackTrace.GetFrame(1).GetMethod().Name;
            string     dispErrorMsg     = string.Format("Error occurred in {0} method.", calledMethodName);
            LogFile.WriteToLog(dispErrorMsg, Ex);
            ShowNotification("Title", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
Ejemplo n.º 5
0
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            if (txtURLTRailer.Text.Trim() != "")
            {
                Short_Film objShort_Film = new Short_Film();

                objShort_Film.CreatedDate = DateTime.Now.AddHours(Connection.SetHours);
                objShort_Film.UserId      = Convert.ToInt32(Session["UserId"].ToString());

                objShort_Film.Short_film_Id = Convert.ToInt32(lblShortFilmId.Text.Trim());

                string   Url1      = txtURLTRailer.Text.Trim();
                string[] SplitUrl1 = Url1.Split('/');
                string   NewUrl1   = "";
                if (SplitUrl1.Length != 0)
                {
                    for (int i = 0; i < SplitUrl1.Length; i++)
                    {
                        if (i == 1)
                        {
                            NewUrl1 = NewUrl1 + "//player." + SplitUrl1[i].ToString();
                        }
                        else if (i == 3)
                        {
                            NewUrl1 = NewUrl1 + "/video/" + SplitUrl1[i].ToString();
                        }
                        else
                        {
                            NewUrl1 = NewUrl1 + SplitUrl1[i].ToString();
                        }
                    }
                }

                objShort_Film.Trailer = NewUrl1;

                DataSet objDataSet = Short_Film.Trailer_Send_To_DB(objShort_Film, (DataTable)ViewState["Artist"]);
                if (objDataSet.Tables[0].Rows[0][0].ToString() == "1")
                {
                    ShowNotification("Trailer", "inserted Successfully..", NotificationType.success);

                    if (Convert.ToInt32(Session["UserId"].ToString()) == 1)
                    {
                        Display_List(gvShortFilm, "SELECT Short_film_Id,Title,Tag,Category,(Select Channel_Name from tbl_admin_channel AC where AC.Channel_Id=SF.Channel)as Channel_Name,Channel,Description,Status,Video,CreatedDate,CreatedById,ModifiedDate,ModifiedById,Isactive,case when Status='Approve' then 'label label-success' else case when Status='Unapprove' then 'label label-danger' else 'label label-warning' end end as StatusClr,Visits,(Select ','+Language_Name from tbl_admin_language where Language_Id in (select val from fn_String_To_Table(Language,',',1))FOR XML PATH (''))as Language FROM tbl_Short_film SF where Isactive='True' Order by Short_film_Id desc");
                    }
                    else
                    {
                        Display_List(gvShortFilm, "SELECT Short_film_Id,Title,Tag,Category,(Select Channel_Name from tbl_admin_channel AC where AC.Channel_Id=SF.Channel)as Channel_Name,Channel,Description,Status,Video,CreatedDate,CreatedById,ModifiedDate,ModifiedById,Isactive,case when Status='Approve' then 'label label-success' else case when Status='Unapprove' then 'label label-danger' else 'label label-warning' end end as StatusClr,Visits,(Select ','+Language_Name from tbl_admin_language where Language_Id in (select val from fn_String_To_Table(Language,',',1))FOR XML PATH (''))as Language FROM tbl_Short_film SF where Isactive='True' and CreatedById=" + Convert.ToInt32(Session["UserId"].ToString()));
                    }

                    Clear_Short_Film();
                }
            }
            else
            {
                ShowNotification("Trailer", "Please Select Trailer..!", NotificationType.error);
            }
        }
        catch (Exception Ex)
        {
        }
    }
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            string Video = fudUploadVideo.FileName;
            string Image = fupImage.FileName;
            if (txtTitle.Text.Trim() != "" && txtTag.Text.Trim() != "" && ddlCategory.SelectedIndex != 0 && ddlChannel.SelectedIndex != 0 && txtDescription.Text.Trim() != "" && Video != "" && Image != "" && ViewState["Artist"] != null)
            {
                Short_Film objShort_Film = new Short_Film();

                string FileExt = Path.GetExtension(fudUploadVideo.FileName);

                objShort_Film.Title         = txtTitle.Text.Trim();
                objShort_Film.Tag           = txtTag.Text.Trim();
                objShort_Film.Category      = ddlCategory.SelectedValue.ToString();
                objShort_Film.Language      = ddlLanguage.SelectedItem.ToString();
                objShort_Film.Channel       = Convert.ToInt32(ddlChannel.SelectedValue.ToString());
                objShort_Film.Video         = FileExt;
                objShort_Film.CreatedDate   = DateTime.Now.AddHours(Connection.SetHours);
                objShort_Film.UserId        = Convert.ToInt32(Session["UserId"].ToString());
                objShort_Film.Description   = txtDescription.Text.Trim();
                objShort_Film.ShortIds      = "";
                objShort_Film.Image         = Image;
                objShort_Film.Short_film_Id = 0;
                objShort_Film.Duration      = Convert.ToDecimal(txtDuration.Text.Trim());

                DataSet objDataSet = Short_Film.Short_Film_Send_To_DB(objShort_Film, (DataTable)ViewState["Artist"]);
                if (objDataSet.Tables[0].Rows[0][1].ToString() == "1")
                {
                    if (Video != "")
                    {
                        fudUploadVideo.SaveAs(Server.MapPath("~/Videos/") + "Shortfilm_" + objDataSet.Tables[0].Rows[0][0].ToString() + FileExt);
                    }

                    if (Image != "")
                    {
                        fupImage.SaveAs(Server.MapPath("~/Video_Images/") + "Shortfilm_" + objDataSet.Tables[0].Rows[0][0].ToString() + ".jpg");
                    }

                    ShowNotification("Short Film", "inserted Successfully..", NotificationType.success);

                    if (Convert.ToInt32(Session["UserId"].ToString()) == 1)
                    {
                        Display_List(gvShortFilm, "SELECT Short_film_Id,Title,Tag,Hero,Heroine,Technician,Category,Language,(Select Channel_Name from tbl_admin_channel AC where AC.Channel_Id=SF.Channel)as Channel_Name,Channel,Description,Status,Video,CreatedDate,CreatedById,ModifiedDate,ModifiedById,Isactive,case when Status='Approve' then 'label label-success' else case when Status='Unapprove' then 'label label-danger' else 'label label-warning' end end as StatusClr,Visits FROM tbl_Short_film SF where Isactive='True' Order by Short_film_Id desc");
                    }
                    else
                    {
                        Display_List(gvShortFilm, "SELECT Short_film_Id,Title,Tag,Hero,Heroine,Technician,Category,Language,(Select Channel_Name from tbl_admin_channel AC where AC.Channel_Id=SF.Channel)as Channel_Name,Channel,Description,Status,Video,CreatedDate,CreatedById,ModifiedDate,ModifiedById,Isactive,case when Status='Approve' then 'label label-success' else case when Status='Unapprove' then 'label label-danger' else 'label label-warning' end end as StatusClr,Visits FROM tbl_Short_film SF where Isactive='True' and CreatedById=" + Convert.ToInt32(Session["UserId"].ToString()));
                    }

                    Clear_Short_Film();
                }
            }
            else
            {
                ShowNotification("Short Film", "Please Fill All Fields..!", NotificationType.error);
            }
        }
        catch (Exception Ex)
        {
        }
    }