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 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 } }