protected void articleRating_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { if (User.Identity.Name == "") { warning.Text = "Članak mogu ocijeniti samo prijavljeni korisnici."; warning_block.Visible = true; } else { ClanciOcjene grade = new ClanciOcjene(); grade.ClanakID = articleId; grade.KorisnikID = Convert.ToInt32(User.Identity.Name); grade.Ocjena = articleRating.CurrentRating; grade.DatumKreiranja = DateTime.Now; grade.DatumIzmjene = DateTime.Now; DAClanci.GradeArticle(grade); articleRating.ReadOnly = true; ratingLabel.Text = "Vaša ocjena: " + grade.Ocjena.ToString(); dateRatedLabel.Text = string.Format("{0:dd.MM.yyyy}", grade.DatumKreiranja); rating_block.Visible = true; BindGrade(); } }
public void AjaxFileUploadIdentitasLahan_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { if (Session["userid"] is object) { userid = Session["userid"].ToString(); } //string user = ""; string wilayah = ""; LANDCOMP.generateNUm gn = new LANDCOMP.generateNUm(); gn.Datas(); string _stNomor; string _stDates = DateTime.Today.ToString("yyyyMMdd"); string uploadFolder = Request.PhysicalApplicationPath + "uploadDocument\\"; LANDCOMP.paramz ext = new LANDCOMP.paramz(); ext.setExtension(Path.GetExtension(e.FileName)); if (ext.getExtsion() != ".exe") { _stFAsli = System.IO.Path.GetFileName(e.FileName); _stNomor = gn.GenerateNumber("", 101, 10, _stDates, userid); AjaxFileUploadIdentitasLahan.SaveAs(uploadFolder + _stNomor + ext.getExtsion()); e.PostedUrl = string.Format(e.FileName + "|" + _stNomor + "|" + userid + "|" + wilayah); } }
public void AjaxFileUploadVerifikasi_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { if (Session["userid"] is object) userid = Session["userid"].ToString(); //if (Request.Params["param7"] is object) param7 = ddprs.SelectedValue.ToString(); //string user = ""; string wilayah = ""; ALMIS.generateNUm gn = new ALMIS.generateNUm(); gn.Datas(); string _stNomor; string _stDates = DateTime.Today.ToString("yyyyMMdd"); string uploadFolder = Request.PhysicalApplicationPath + "uploadDocument\\"; ALMIS.paramz ext = new ALMIS.paramz(); ext.setExtension(Path.GetExtension(e.FileName)); if (ext.getExtsion() != ".exe") { _stFAsli = System.IO.Path.GetFileName(e.FileName); _stNomor = gn.GenerateNumber(param7, 101, 12, _stDates, userid); AjaxFileUploadVerifikasi.SaveAs(uploadFolder + _stNomor + ext.getExtsion()); e.PostedUrl = string.Format(e.FileName + "|" + _stNomor + "|" + userid + "|" + wilayah); } }
//protected void dsSelectedCompany_Inserted(object sender, SqlDataSourceStatusEventArgs e) //{ // //switch back to the GV // mvCompanies.ActiveViewIndex = 0; // //update the GV // gvCompanies.DataBind(); //} //protected void dsSelectedCompany_Updated(object sender, SqlDataSourceStatusEventArgs e) //{ // //switch back to the GV // mvCompanies.ActiveViewIndex = 0; // gvCompanies.DataBind();//update the GV //} protected void AsyncFileUpload1_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { #region LOGO UPLOAD //find the control in the detailsview AsyncFileUpload afuLogo = (AsyncFileUpload)fvSelectedCompany.FindControl ("AsyncFileUpload1"); //generate a new unique image name //get the original filename for its file extension string imageName = afuLogo.FileName;//tells u the name of the filename they are uploading //get the extension string ext = imageName.Substring(imageName.LastIndexOf(".")); //create a random unique filename (use GUID) //GUID creates a unique value, then tack on the extension string newImageName = Guid.NewGuid().ToString() + ext; //save the image to the students images folder using the new name afuLogo.SaveAs(Server.MapPath("~/images/" + newImageName)); #endregion //When the record above is inserted or uploaded, we will need the //new filename to be used in the CompanyLogo field. Session["newImage"] = newImageName; }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string sPathFile = ConfigurationManager.AppSettings["PathDocs"].ToString(); string NomeFile = _ID + "_" + ((int)_Tipo).ToString() + "_" + DateTime.Parse(DataDocumento.Value).ToString("yyMMdd") + "_" +Path.GetFileNameWithoutExtension( e.FileName.Replace(" " ,"_")) + Path.GetExtension(e.FileName); string filePath = sPathFile + "Documenti\\"+ NomeFile; string resizeImage = ""; string ext = Path.GetExtension(NomeFile).ToLower(); if (ext == ".jpg" || ext == ".png" || ext == ".jpeg" || ext == ".tif" || ext == ".bmp") { resizeImage = NomeFile; } else if (ext == ".pdf") { resizeImage = "icon_pdf.png"; } else if (ext == ".doc" || ext == ".docx") { resizeImage = "icon_doc.png"; } if (inserisciDoc(_Tipo, _ID, NomeFile, DateTime.Now, DateTime.Parse(DataDocumento.Value), DateTime.Parse(DataScadenzaDoc.Value), resizeImage)) { AjaxFileUpload1.SaveAs(filePath); } //Se è un immagine creo la mignatura e poi aggiorno il record if (ResizeImage(filePath)) { } SqlDataSource1.DataBind(); GridView1.DataBind(); }
protected void File_Upload(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string devicekindid = Session["DeviceKindid"].ToString(); //string devicekindid = "13"; AjaxFileUpload1.SaveAs(Server.MapPath(iconPath + devicekindid + ".gif")); }
protected void AsyncFileUpload1_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { if (AsyncFileUpload1.HasFile && e.State == AjaxControlToolkit.AsyncFileUploadState.Success) { AsyncFileUpload1.SaveAs(Utils.PrepareUserDir(fiName) + e.FileName); } }
protected void fluDocument_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { if (this.fluDocument.HasFile) { if (this.fluDocument.PostedFile.ContentType.Equals("image/pjpeg") || this.fluDocument.PostedFile.ContentType.Equals("image/x-png")) { byte[] fileByte = this.fluDocument.FileBytes; Binary binaryObj = new Binary(fileByte); Ajancy.Kimia_Ajancy db = new Ajancy.Kimia_Ajancy(Public.ConnectionString); Ajancy.Doument doc = db.Douments.FirstOrDefault<Ajancy.Doument>(d => d.PersonID == Public.ActiveUserRole.User.PersonID && d.DocumentType == 1); if (doc == null) { doc = new Ajancy.Doument { DocumentType = Public.ToByte(this.drpType.SelectedValue), PersonID = Public.ActiveUserRole.User.PersonID, Picture = binaryObj, SubmitDate = DateTime.Now }; db.Douments.InsertOnSubmit(doc); } else { doc.Picture = binaryObj; } db.SubmitChanges(); db.Dispose(); } } }
/// <summary> /// </summary> /// <param name="dt"></param> /// <param name="LineChart"></param> public void drawLineChart(AjaxControlToolkit.LineChart Chart, DataTable dt, int yScaleFactor = 1) { if (Chart == null) return; string[] x = new string[dt.Columns.Count - 1]; for (int i = 1; i < dt.Columns.Count; ++i) { x[i - 1] = dt.Columns[i].ColumnName; Chart.CategoriesAxis = string.Join(",", x); //Response.Write(ClsConvert.ArrayToHTML(x)); } for (int i = 0; i < dt.Rows.Count; ++i) { decimal[] y = new decimal[dt.Columns.Count - 1]; for (int j = 1; j < dt.Columns.Count; ++j) { y[j - 1] = Convert.ToDecimal(ClsUtil.ObjToDouble(dt.Rows[i][j])) * yScaleFactor; } //Response.Write(ClsConvert.ArrayToHTML(y)); Chart.Series.Add(new AjaxControlToolkit.LineChartSeries { Name = dt.Rows[i][0].ToString(), Data = y }); } Chart.ChartTitle = dt.TableName; Chart.Visible = true; }
protected void AjaxFileUpload_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string fileName = "dateweek"+DateTime.Now.ToString("yyyMMddHHss") + new Random().Next(999) + e.ContentType;// +e.FileName; string fullPath = Server.MapPath(ConfigurationManager.AppSettings["PH_FolderUpload"] + fileName); AjaxFileUpload.SaveAs(fullPath); Session["fileName"] = fullPath; }
protected void Accordion1_ItemDataBound(object sender, AjaxControlToolkit.AccordionItemEventArgs e) { if (e.ItemType == AjaxControlToolkit.AccordionItemType.Content) { HiddenField hdfid = (HiddenField)e.AccordionItem.FindControl("hdfCodigo"); HiddenField hdfsillas = (HiddenField)e.AccordionItem.FindControl("hdfsillas"); Panel pnlInside = (Panel)e.AccordionItem.FindControl("PnlInside"); //'se crea un ciclo for que añade un texto por cada fila en el dataset for (int i = 0; i < Convert.ToInt32(hdfsillas.Value); i++) { LinkButton lkButon = new LinkButton(); Literal ltl = new Literal(); lkButon.ID = "lkButon" + i.ToString(); lkButon.CssClass = "icon-retweet"; lkButon.Text = "Silla" + (i + 1).ToString(); lkButon.CommandArgument = hdfid.Value + ":" + (i + 1).ToString(); lkButon.Click += new EventHandler(lkButon_Click); pnlInside.Controls.Add(lkButon); ltl.Text = "<br />"; pnlInside.Controls.Add(ltl); } } }
protected void Rt1_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { Snlg_DBParameter[] prms = new Snlg_DBParameter[4]; prms[0] = new Snlg_DBParameter("@MakId", SqlDbType.Int, Request.QueryString["makid"]); prms[1] = new Snlg_DBParameter("@Puan", SqlDbType.TinyInt, e.Value); prms[2] = new Snlg_DBParameter("@YazanId", SqlDbType.Int); prms[3] = new Snlg_DBParameter("@IP", SqlDbType.VarChar, 15); if (string.IsNullOrEmpty(Snlg_MemberInfo.s_UserId.ToString())) {//üye değilse prms[2].Deger = DBNull.Value; prms[3].Deger = Request.ServerVariables["REMOTE_ADDR"]; } else {//üye ise prms[2].Deger = Snlg_MemberInfo.s_UserId; prms[3].Deger = DBNull.Value; } try { vt.SorguCalistir("snlg_V1.zsp_makale_PuanEkle", CommandType.StoredProcedure, prms); Snlg_Hata.ziyaretci.HataGosterBasarili(GetGlobalResourceObject("default", "makale_detay_ascx_hata04").ToString(), false); } catch (Exception exc) { Snlg_Hata.ziyaretci.ExceptionLogla(exc); } }
protected void articleRating_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { if (User.Identity.Name == "") { warning.Text = "Pitanje mogu ocijeniti samo prijavljeni korisnici!"; warning_block.Visible = true; } else { int pitanjeID = (int)Session["PitanjeID"]; PitanjaOcjene grade = new PitanjaOcjene(); grade.PitanjeID = pitanjeID; grade.KorisnikID = Convert.ToInt32(User.Identity.Name); grade.Ocjena = articleRating.CurrentRating; grade.DatumKreiranja = DateTime.Now; grade.DatumIzmjene = DateTime.Now; DAPitanja.GradeQuestion(grade); articleRating.ReadOnly = true; ratingLabel.Text = "Vaša ocjena: " + grade.Ocjena.ToString(); dateRatedLabel.Text = string.Format("{0:dd.MM.yyyy}", grade.DatumKreiranja); rating_block.Visible = true; //BindGrade(); } }
//public string parentPath = System.Configuration.ConfigurationSettings.AppSettings["parentPath"]; protected void FileUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string parentPath = System.Configuration.ConfigurationManager.AppSettings["parentPath"]; string idaDir = parentPath + Session["dirID"] + @"\"; string filePath = idaDir + e.FileName; valred.Attributes["Value"] = "0099"; DirectoryInfo di = new DirectoryInfo(idaDir); try { // Determine whether the directory exists. if (di.Exists) { AjaxFileUpload1.SaveAs(filePath); Console.WriteLine("That path exists already."); return; } else { di.Create(); AjaxFileUpload1.SaveAs(filePath); } } catch (Exception er) { Console.WriteLine("The process failed: {0}", er.ToString()); } finally { } }
public void ElaborazioneGeneraForm(AjaxControlToolkit.TabContainer TabContainerReferti, int iFormTipo) { string sSql = @"SELECT FormCampi.* FROM FormCampi WHERE (IDFormTipo = @IDFormTipo) ORDER BY Posizione"; SqlCommand cmd = new SqlCommand(sSql, _Conn); SqlParameter par = new SqlParameter("@IDFormTipo", iFormTipo); cmd.Parameters.Add(par); SqlDataAdapter adap = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); adap.Fill(dt); for (int x = 0; x < 6; x++) { AjaxControlToolkit.TabPanel tabPan = new AjaxControlToolkit.TabPanel(); try { foreach (DataRow dr in dt.Select("PosizioneTab = " + x)) { FormCampi campo = new FormCampi(dr); GeneraComponenti(campo, ref tabPan); } } catch { } if (tabPan.Controls.Count > 0) TabContainerReferti.Tabs.Add(tabPan); } }
protected void cbe_ResolveTargetControlID(object sender, AjaxControlToolkit.ResolveControlEventArgs e) { if (e.ControlID == "LoginViewButton") { e.Control = LoginView1.FindControl(e.ControlID); AddMessage("cbe_ResolveTargetControlID", e.ControlID); } }
protected void NoBot1_GenerateChallengeAndResponse(object sender, AjaxControlToolkit.NoBotEventArgs e) { NoBotState state; NoBot1.IsValid(out state); Label1.Text = state.ToString(); }
protected void ajaxFileUpload_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string filePath = "~/imagenes/programasGenerales/" + e.FileName; var ajaxFileUpload = (AjaxFileUpload)sender; ajaxFileUpload.SaveAs(MapPath(filePath)); e.PostedUrl = Page.ResolveUrl(filePath); }
protected void FileUploadComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { if (AsyncFileUpload1.HasFile) { var fileName = AsyncFileUpload1.FileName; var fileExtension = fileName.Substring(fileName.LastIndexOf('.') + 1); if (fileExtension.ToLower().Contains("jpg") || fileExtension.ToLower().Contains("png")) { if (AsyncFileUpload1.FileContent.Length < 2000000) { String savePath = MapPath("profilePics/" + AsyncFileUpload1.FileName); string formnum = ""; string origPath = MapPath("profilePics/" + formnum + ".jpg"); AsyncFileUpload1.SaveAs(origPath); // File.AppendAllText("C:/lg.txt", "\r\n"+savePath); AsyncFileUpload1.SaveAs(savePath); var image = new Bitmap(MapPath("profilePics/" + formnum + ".jpg")); if (image.Height > 200 || image.Width > 200) { Console.Write("IMAGE DIMENSION LARGE PROCESSING IMAGE"); //var image2 = ResizeImage(image, 200, 200); //image.Dispose(); //image = null; //File.Delete(origPath); //image2.Save(origPath); //image2.Dispose(); //image2 = null; } else { //Console.Write("IMAGE DIMENSION SMALL SKIPPING IMAGE"); image.Dispose(); image = null; } // AsyncFileUpload1.SaveAs(MapPath("C:/AdmissionPortal/Students/profilePics/" + AsyncFileUpload1.FileName)); // literealErrorImage.Text = ""; UploadFolderPath = "profilePics/"; ViewState["imageDisplay_str"] = formnum + "." + fileExtension; } else { ClearContents(sender as Control); // literealErrorImage.Text = " <span class=\"btn btn-danger\">Image file size should be less than 2 MB </span>"; } } } }
protected void RatingControlChanged(object sender, AjaxControlToolkit.RatingEventArgs e) { con.Open(); SqlCommand cmd = new SqlCommand("insert into RatingDetails(Rate)values(@Rating)", con); cmd.Parameters.AddWithValue("@Rating", ratingControl.CurrentRating); cmd.ExecuteNonQuery(); con.Close(); BindRatingControl(); }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string TenAnh = e.FileName; String[] strTmp = TenAnh.Split('.'); TenAnh = DateTime.Now.ToFileTimeUtc().ToString(); TenAnh += "."+strTmp[1]; string strDestPath = Server.MapPath("~/imagesTmp/"); AjaxFileUpload1.SaveAs(@strDestPath + TenAnh); anh = "imagesTmp/" + TenAnh; }
protected void Rating1_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { String _id = lb_id.Text; String _start = txt_startdate.Text; String _end = txt_enddate.Text; if (_id == "" || _start == "" || _end == "") Rating1.CurrentRating = 0; else loadRating(_id, _start, _end); loadBugHunter(_id); }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string path = "uploadedImgs/" + AdminController.getCurrentAdmin().User.FirstName + e.FileName.ToString(); AjaxFileUpload1.SaveAs(MapPath("~/" + path)); images[imgCount, 1] = path; imgCount++; /*System.Drawing.Image image = System.Drawing.Image.FromFile(MapPath("~/" + path)); System.Drawing.Image thumb = image.GetThumbnailImage(120, 120, () => false, IntPtr.Zero); thumb.Save(MapPath("~/"+"uploadedImgs/thumbs/"+AdminController.getCurrentAdmin().User.FirstName + e.FileName.ToString()));*/ }
protected void ajaxFileUpload_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { if(e.ContentType.Contains("jpg") || e.ContentType.Contains("gif") || e.ContentType.Contains("png") || e.ContentType.Contains("jpeg")) { Session["fileContentType_" + e.FileId] = e.ContentType; Session["fileContents_" + e.FileId] = e.GetContents(); } // Set PostedUrl to preview the uploaded file. e.PostedUrl = string.Format("?preview=1&fileId={0}", e.FileId); }
protected void ProcessUpload(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "size", "top.$get(\"" + uploadResult.ClientID + "\").innerHTML = 'Uploaded size: " + AsyncFileUpload1.FileBytes.Length.ToString() + "';", true); string fileName = Server.MapPath("./") + "photos\\" + Session["username"] + "image.jpg"; AsyncFileUpload1.FileName.ToString(); AsyncFileUpload1.SaveAs(fileName); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "image", "top.$get(\"photo\").src = 'photos/" + Session["username"] + "image.jpg" + "';", true); // ScriptManager.RegisterClientScriptBlock(AsyncFileUpload1, AsyncFileUpload1.GetType(), "img", // "top.document.getElementById('photos').src='"+fileName+"';", // true); }
protected void mpe_ResolveControlID(object sender, AjaxControlToolkit.ResolveControlEventArgs e) { // The Ajax stuff needs to be inside a different ContentPlaceHolder on the master page because otherwise the master page CSS breaks it. // The default Control Id resolution in ExtenderControlBase fails to find cmdDefer because it is contained inside a different ContentPlaceHolder // So they raise this event for me and I resolve it for them. switch (e.ControlID) { case "btnVote": e.Control = btnVote; break; } }
public void ajaxType1JamRating_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { var myShow = GetMyShow(hdnMyShowId.Value); if (myShow == null) return; using (IUnitOfWork uow = UnitOfWork.Begin()) { myShow.Type1JamRating = int.Parse(e.Value); uow.Commit(); } }
protected void AsyncFileUpload_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { if (AsyncFileUpload.HasFile) { string fileName = Path.GetFileName(AsyncFileUpload.PostedFile.FileName); string strPath = Server.MapPath("~/CSVFiles/" + fileName); AsyncFileUpload.SaveAs(strPath); //AddInputs(strPath); //DeleteTempFile(strPath); } }
public void AjaxFileUploadMRS_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string user = Request.Params["user"].ToString(); string wilayah = Request.Params["wilay"].ToString(); LANDCOMP.generateNUm gn = new LANDCOMP.generateNUm(); gn.Datas(); string _stNomor; string _stDates = DateTime.Today.ToString("yyyyMMdd"); string uploadFolder = Request.PhysicalApplicationPath + "uploadDocument\\"; LANDCOMP.paramz ext = new LANDCOMP.paramz(); ext.setExtension(Path.GetExtension(e.FileName)); if (ext.getExtsion() != ".exe") { _stFAsli = System.IO.Path.GetFileName(e.FileName); string wilay = user; string owner1 = ""; switch (wilayah) { case "1": owner1 = "SBU1"; break; case "2": owner1 = "SBU2"; break; case "3": owner1 = "SBU3"; break; case "4": owner1 = "TSJ1"; break; case "5": owner1 = "LANDCOMP1"; break; default: break; } _stNomor = gn.GenerateNumber(owner1, 100, 51, _stDates, user); AjaxFileUploadMRS.SaveAs(uploadFolder + _stNomor + ext.getExtsion()); e.PostedUrl = string.Format(e.FileName + "|" + _stNomor + "|" + user + "|" + wilayah); } }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string guid = Guid.NewGuid().ToString(); UploadSession obj = (UploadSession)Session["upload"]; string filename = Server.MapPath("/Albums/" + obj.Folder + "/" + guid + ".JPG"); AjaxFileUpload1.SaveAs(filename); SqlParameter pID = new SqlParameter("AlbumID", SqlDbType.Int); pID.Value = obj.Id; SqlParameter pUrl = new SqlParameter("ImageUrl", SqlDbType.NVarChar); pUrl.Value = guid+".jpg"; SqlParameter insertedKey = new SqlParameter("AlbumDetailID", SqlDbType.Int); insertedKey.Direction = ParameterDirection.Output; string NewsID = DataAccessLayer.ExcuteNoneQueryHasOutput("Album_InsertAlbumDetail", "AlbumDetailID", pID, pUrl, insertedKey); }