protected void btSave_Click(object sender, EventArgs e) { AdminSettingClass obj = new AdminSettingClass(); Int32 VUSize = 0, SPSize = 0, SPCount = 0; Int32.TryParse(tbVideoUploadSize.Text, out VUSize); Int32.TryParse(tbStoryPicSize.Text, out SPSize); Int32.TryParse(tbStoryPicCount.Text, out SPCount); obj.VideoUploadSize = VUSize; obj.StoryPicSize = SPSize; obj.StoryPicCount = SPCount; MEMBERS.SQLReturnValue mRes; if (hfID.Value == string.Empty) { obj.Flag = "ADD"; mRes = AdminSettingClass.Insert_Update_AdminSetting(obj); } else { obj.Flag = "EDIT"; obj.AdminSettingIDP = Int64.Parse(hfID.Value); mRes = AdminSettingClass.Insert_Update_AdminSetting(obj); } ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + mRes.MessageFromSQL + "</b>',1);", true); BindData(); }
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); } }
public void BindData() { DataTable dtAdminSetting = AdminSettingClass.GetAdminSetting_ByID(1); if (dtAdminSetting.Rows.Count > 0) { hfID.Value = "1"; DataRow dr = dtAdminSetting.Rows[0]; tbVideoUploadSize.Text = dr["VideoUploadSize"].ToString(); tbStoryPicSize.Text = dr["StoryPicSize"].ToString(); tbStoryPicCount.Text = dr["StoryPicCount"].ToString(); } }