示例#1
0
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        LiveReportingDAL.UploadVideoClass upl = new LiveReportingDAL.UploadVideoClass();
        if (Session["USERNAME"] != null)
        {
            upl.UploadTitle            = txtname.Text;
            upl.UploadTypeID           = 1;
            upl.UserID                 = int.Parse(MyLogic.GetUserID);
            upl.UserType               = 3;
            upl.KeyWordForSearch       = txtkeyword.Text;
            upl.IncidentCategoryIDF    = int.Parse(ddincategory.SelectedValue);
            upl.IncidentSubCategoryIDF = int.Parse(ddSubincategory.SelectedValue);
            upl.IncidentCityIDF        = int.Parse(ddcity.SelectedValue);
            upl.IncidentDate           = txtincidentdate.Text + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second;
            upl.AreaOfCity             = txtAreaOfCity.Text;
            upl.IncidentDescription    = txtincidentdesc.Text;
            upl.KeyWordForSearch       = txtkeyword.Text;
            upl.AreaID                 = 0;
            upl.IncidentStateIDF       = int.Parse(ddstate.SelectedValue);
            upl.Flag = "ADD";
            MEMBERS.SQLReturnValue M;
            M = LiveReportingDAL.UploadVideoClass.Insert_Update_UploadVideo(upl);
            if (M.ValueFromSQL > 0)
            {
                if (fileVideoUpload.PostedFile != null)
                {
                    string RandomStr = AdminSettingClass.RandomDigit();
                    string filename  = Path.GetFileName(fileVideoUpload.PostedFile.FileName);
                    fileVideoUpload.SaveAs(Server.MapPath("/VideoALL/" + filename));
                    string filepath = "/VideoALL/" + filename;

                    upl.UploadedVideoIDP       = M.ValueFromSQL;
                    upl.video_path             = filename;
                    upl.IncidentSubCategoryIDF = int.Parse(ddSubincategory.SelectedValue);
                    upl.IncidentCategoryIDF    = int.Parse(ddincategory.SelectedValue);
                    upl.thumbpath = "NA";
                    int outsaveVideo = UploadVideoClass.Save_Video_Path(upl).ValueFromSQL;

                    SendSMS SMS = new SendSMS();
                    SMS.MySendSMS("Video has been uploaded in " + ddincategory.SelectedItem.Text + " on " + DateTime.Now.ToString("dd/MM/yyyy hh:mm") + " by  " + MyLogic.GetUserName + "", "9769501341");
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('Thanks for sharing your Video, it Will be LIVE soon!!',1);", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('Video File Required!!',1);", true);
                }
            }
            ClearCaching.ClearControls(pnlvideo);
        }
        else
        {
            Response.Redirect("SignIn.aspx");
        }
    }
    protected void btSave_Click(object sender, EventArgs e)
    {
        string Extention = Path.GetExtension(fileUpload.PostedFile.FileName);

        if (fileUpload.PostedFile.ContentLength < 20728650)
        {
            upl.UploadTitle            = txtname.Text;
            upl.UploadTypeID           = 1;
            upl.UserID                 = int.Parse(MyLogic.GetUserID);
            upl.UserType               = int.Parse(MyLogic.GetUserType);
            upl.KeyWordForSearch       = txtkeyword.Text;
            upl.IncidentCategoryIDF    = int.Parse(ddincategory.SelectedValue);
            upl.IncidentSubCategoryIDF = int.Parse(ddSubincategory.SelectedValue);
            upl.IncidentCityIDF        = int.Parse(ddcity.SelectedValue);
            upl.IncidentDate           = txtincidentdate.Text + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second;
            upl.AreaOfCity             = txtAreaOfCity.Text;
            upl.IncidentDescription    = txtincidentdesc.Text;
            upl.KeyWordForSearch       = txtkeyword.Text;
            upl.AreaID                 = 0;
            upl.IncidentStateIDF       = int.Parse(ddstate.SelectedValue);
            upl.Flag = "ADD";
            MEMBERS.SQLReturnValue M;
            M = LiveReportingDAL.UploadVideoClass.Insert_Update_UploadVideo(upl);
            if (M.ValueFromSQL > 0)
            {
                if (fileUpload.PostedFile != null)
                {
                    string RandomStr = AdminSettingClass.RandomDigit();
                    string filename  = Path.GetFileName(fileUpload.PostedFile.FileName);
                    fileUpload.SaveAs(Server.MapPath("/VideoALL/" + filename));
                    string filepath = "/VideoALL/" + filename;

                    upl.UploadedVideoIDP       = M.ValueFromSQL;
                    upl.video_path             = filename;
                    upl.IncidentSubCategoryIDF = int.Parse(ddSubincategory.SelectedValue);
                    upl.IncidentCategoryIDF    = int.Parse(ddincategory.SelectedValue);
                    upl.thumbpath = "NA";
                    int outsaveVideo = UploadVideoClass.Save_Video_Path(upl).ValueFromSQL;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('" + M.MessageFromSQL + "',1);", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('Video File Required!!',1);", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('File size exceeds maximum limit 20 MB.',1);", true);
            }

            ClearCaching.ClearControls(Vpanel);
        }
    }
    protected void btSave_Click(object sender, EventArgs e)
    {
        sms.sms_api    = txtSMS.Text;
        sms.sms_status = 1;
        int outsave = SendSMS.InsertSms_APi(sms).ValueFromSQL;

        if (outsave == 1)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('sms api successfully saved.',1);", true);
        }
        ClearCaching.ClearControls(smspanel);
    }
示例#4
0
    protected void btnuploadStory_Click(object sender, EventArgs e)
    {
        LiveReportingDAL.UploadVideoClass upl = new LiveReportingDAL.UploadVideoClass();
        if (Session["USERNAME"] != null)
        {
            upl.UploadTitle            = txtStitle.Text;
            upl.UploadTypeID           = 2;
            upl.UserID                 = int.Parse(MyLogic.GetUserID);
            upl.UserType               = 3;
            upl.KeyWordForSearch       = txtKeywordStory.Text;
            upl.IncidentCategoryIDF    = int.Parse(ddincidentCategoryStory.SelectedValue);
            upl.IncidentSubCategoryIDF = 0;
            upl.IncidentStateIDF       = int.Parse(ddstate.SelectedValue);
            upl.IncidentCityIDF        = int.Parse(ddcity.SelectedValue);
            upl.IncidentDate           = txtincidentdateStory.Text + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second;
            upl.AreaOfCity             = txtAreaOfCity1.Text;
            upl.IncidentDescription    = txtDescStory.Text;
            upl.AreaID                 = 0;

            upl.Flag      = "ADD";
            upl.thumbpath = "Story";
            MEMBERS.SQLReturnValue M;
            M = LiveReportingDAL.UploadVideoClass.Insert_Update_UploadVideo(upl);

            #region FIleUpload

            HttpFileCollection fileCollection = Request.Files;
            for (int i = 0; i < fileCollection.Count; i++)
            {
                HttpPostedFile uploadfile = fileCollection[i];
                string         fileName   = Path.GetFileName(uploadfile.FileName);
                if (uploadfile.ContentLength > 0)
                {
                    uploadfile.SaveAs(Server.MapPath("/StoriesALL/") + fileName);
                    upl.UploadedVideoIDP = M.ValueFromSQL;
                    upl.video_path       = fileName;
                    int outsaveVideo = UploadVideoClass.Save_Video_Path(upl).ValueFromSQL;
                }
            }
            SendSMS SMS = new SendSMS();

            SMS.MySendSMS("Picture has been uploaded in " + txtincidentdateStory.Text + " on " + DateTime.Now.ToString("dd/MM/yyyy hh:mm") + " by  " + MyLogic.GetUserName + "", "9769501341");
            ClearCaching.ClearControls(pnlstory);
            ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('Thanks for sharing your Story, it Will be LIVE soon!!',1);", true);
            #endregion
        }
    }
    protected void btSave_Click(object sender, EventArgs e)
    {
        LiveReportingDAL.UploadVideoClass upl = new LiveReportingDAL.UploadVideoClass();
        upl.UploadTitle            = txtname.Text;
        upl.UploadTypeID           = 2;
        upl.UserID                 = int.Parse(MyLogic.GetUserID);
        upl.UserType               = int.Parse(MyLogic.GetUserType);
        upl.KeyWordForSearch       = txtkeyword.Text;
        upl.IncidentCategoryIDF    = int.Parse(ddincategory.SelectedValue);
        upl.IncidentSubCategoryIDF = 0;
        upl.IncidentStateIDF       = int.Parse(ddstate.SelectedValue);
        upl.IncidentCityIDF        = int.Parse(ddcity.SelectedValue);
        upl.IncidentDate           = txtincidentdate.Text + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second;
        upl.AreaOfCity             = txtArea.Text;
        upl.IncidentDescription    = txtdescription.Text;
        upl.KeyWordForSearch       = txtkeyword.Text;
        upl.AreaID                 = 0;

        upl.Flag      = "ADD";
        upl.thumbpath = "Story";
        MEMBERS.SQLReturnValue M;
        M = LiveReportingDAL.UploadVideoClass.Insert_Update_UploadVideo(upl);

        #region FIleUpload

        HttpFileCollection fileCollection = Request.Files;
        for (int i = 0; i < fileCollection.Count; i++)
        {
            HttpPostedFile uploadfile = fileCollection[i];
            string         fileName   = Path.GetFileName(uploadfile.FileName);
            if (uploadfile.ContentLength > 0)
            {
                uploadfile.SaveAs(Server.MapPath("/StoriesALL/") + fileName);
                upl.UploadedVideoIDP = M.ValueFromSQL;
                upl.video_path       = fileName;
                int outsaveVideo = UploadVideoClass.Save_Video_Path(upl).ValueFromSQL;
            }
        }
        ClearCaching.ClearControls(storypanel);
        ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + M.MessageFromSQL + "</b>',1);", true);
        #endregion
    }
    protected void btSave_Click(object sender, EventArgs e)
    {
        Pincode pin = new Pincode();

        pin.AreaOfCity = txtarea.Text;
        pin.CityIDF    = int.Parse(ddcity.SelectedValue);
        pin.StateIDF   = int.Parse(ddstate.SelectedValue);
        pin.IsActive   = cbIsActive.Checked;
        MEMBERS.SQLReturnValue mRes;
        mRes = Pincode.Insert_Pincode(pin);
        if (mRes.ValueFromSQL == 1)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + mRes.MessageFromSQL + "</b>',1);", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + mRes.MessageFromSQL + "</b>',1);", true);
        }
        ClearCaching.ClearControls(PincodePanel);
    }
示例#7
0
    protected void btSave_Click(object sender, EventArgs e)
    {
        string Extention = Path.GetExtension(fileUpload.PostedFile.FileName);

        if (Extention.ToString() != ".flv")
        {
            if (fileUpload.PostedFile.ContentLength < 20728650)
            {
                upl.UploadTitle            = txtname.Text;
                upl.UploadTypeID           = 1;
                upl.UserID                 = int.Parse(MyLogic.GetUserID);
                upl.UserType               = int.Parse(MyLogic.GetUserType);
                upl.KeyWordForSearch       = txtkeyword.Text;
                upl.IncidentCategoryIDF    = int.Parse(ddincategory.SelectedValue);
                upl.IncidentSubCategoryIDF = int.Parse(ddSubincategory.SelectedValue);
                upl.IncidentCityIDF        = int.Parse(ddcity.SelectedValue);
                upl.IncidentDate           = txtincidentdate.Text + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second;
                upl.AreaOfCity             = ddAreaOfCity.SelectedItem.Text;
                upl.IncidentDescription    = txtincidentdesc.Text;
                upl.KeyWordForSearch       = txtkeyword.Text;
                upl.AreaID                 = int.Parse(ddAreaOfCity.SelectedValue);
                upl.IncidentStateIDF       = int.Parse(ddstate.SelectedValue);
                upl.Flag = "ADD";
                MEMBERS.SQLReturnValue M;
                M = LiveReportingDAL.UploadVideoClass.Insert_Update_UploadVideo(upl);
                //#region Convert File
                //if (fileUpload.PostedFile.FileName != string.Empty)
                //{
                //    string RandomStr = AdminSettingClass.RandomDigit();
                //    string filename = Path.GetFileName(fileUpload.PostedFile.FileName);
                //    fileUpload.SaveAs(Server.MapPath("/VideoALL/" + filename));
                //    string filepath = "/VideoALL/" + filename;
                //    NReco.VideoConverter.FFMpegConverter FFMpegConv;
                //    FFMpegConv = new NReco.VideoConverter.FFMpegConverter();
                //    FFMpegConv.FFMpegProcessPriority = System.Diagnostics.ProcessPriorityClass.BelowNormal;

                //    var outFile = Server.MapPath("/VideoStoryColl/" + "" + RandomStr + ".flv");
                //    if (File.Exists(outFile))
                //        File.Delete(outFile);
                //    try
                //    {
                //        #region ThumbImgCOnvert
                //        var ffMpeg = new FFMpegConverter();
                //        ffMpeg.GetVideoThumbnail(Server.MapPath("/VideoALL/" + filename), Server.MapPath("/ThumbIMG/" + "" + RandomStr + ".jpg"), 5);
                //        #endregion


                //        FFMpegConv.ConvertMedia(Server.MapPath("/VideoALL/" + filename), outFile, "flv");
                //        upl.UploadedVideoIDP = M.ValueFromSQL;
                //        upl.video_path = "" + RandomStr + ".flv";
                //        upl.IncidentSubCategoryIDF = int.Parse(ddSubincategory.SelectedValue);
                //        upl.IncidentCategoryIDF = int.Parse(ddincategory.SelectedValue);
                //        upl.thumbpath = "/ThumbIMG/" + "" + RandomStr + ".jpg";
                //        int outsaveVideo = UploadVideoClass.Save_Video_Path(upl).ValueFromSQL;
                //        if (outsaveVideo == 1)
                //        {
                //            if (File.Exists(Server.MapPath("/VideoALL/" + filename)))
                //            {
                //                File.Delete(Server.MapPath("/VideoALL/" + filename));
                //            }
                //            ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + M.MessageFromSQL + "</b>',1);", true);
                //        }
                //        else
                //        {
                //            ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('File Already Exists',1);", true);
                //        }
                //    }
                //    catch (Exception ex)
                //    {
                //        ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + ex.ToString() + "</b>',1);", true);
                //    }
                //    finally
                //    {

                //    }
                //    BindAllVideo();
                //}
                //#endregion
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('File size exceeds maximum limit 20 MB.',1);", true);
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('Invalid File. Please upload a File Other Extention.',1);", true);
        }
        ClearCaching.ClearControls(Vpanel);
    }
 protected void btCancel_Click(object sender, EventArgs e)
 {
     ClearCaching.ClearControls(smspanel);
 }