コード例 #1
0
 public static MEMBERS.SQLReturnValue Save_Video_Path(UploadVideoClass obj)
 {
     string[,] param = { { "UploadedVideoIDP",       obj.UploadedVideoIDP.ToString()       },
                         { "video_path",             obj.video_path.ToString()             },
                         { "IncidentCategoryIDF",    obj.IncidentCategoryIDF.ToString()    },
                         { "IncidentSubCategoryIDF", obj.IncidentSubCategoryIDF.ToString() },
                         { "ThumbPath",              obj.thumbpath.ToString()              } };
     return(ExecuteProcWithMessageValue("Save_Path", param, true));
 }
コード例 #2
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");
        }
    }
コード例 #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
        }
    }
コード例 #4
0
 public static MEMBERS.SQLReturnValue Insert_Update_UploadVideo(UploadVideoClass obj)
 {
     string[,] param = { { "UploadedVideoIDP",       obj.UploadedVideoIDP.ToString()       },
                         { "UploadTypeID",           obj.UploadTypeID.ToString()           },
                         { "UploadTitle",            obj.UploadTitle.ToString()            },
                         { "IncidentCategoryIDF",    obj.IncidentCategoryIDF.ToString()    },
                         { "IncidentCityIDF",        obj.IncidentCityIDF.ToString()        },
                         { "AreaOfCity",             obj.AreaOfCity.ToString()             },
                         { "IncidentDate",           obj.IncidentDate.ToString()           },
                         { "IncidentDescription",    obj.IncidentDescription.ToString()    },
                         { "KeyWordForSearch",       obj.KeyWordForSearch.ToString()       },
                         { "UserID",                 obj.UserID.ToString()                 },
                         { "UserType",               obj.UserType.ToString()               },
                         { "IncidentStateIDF",       obj.IncidentStateIDF.ToString()       },
                         { "Flag",                   obj.Flag.ToString()                   },
                         { "AreaID",                 obj.AreaID.ToString()                 },
                         { "IncidentSubCategoryIDF", obj.IncidentSubCategoryIDF.ToString() }, };
     return(ExecuteProcWithMessageValue("Insert_Update_UploadVideo", param, true));
 }
コード例 #5
0
    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
    }