示例#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);
        }
    }
示例#3
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
    }