Beispiel #1
0
        protected void UploadControl_FilesUploadComplete(object sender, DevExpress.Web.FilesUploadCompleteEventArgs e)
        {
            try
            {
                foreach (UploadedFile file in UploadControl.UploadedFiles)
                {
                    //string dosyaAdiUret = DateTime.Now.ToString().Replace(".", "").Replace(":", "").Replace(" ", "");
                    string uploadFolder    = Server.MapPath("~/App_Data/UploadDirectory/");
                    string resultExtension = Path.GetExtension(file.FileName);
                    string resultFileName  = Path.ChangeExtension(Path.GetRandomFileName(), resultExtension);
                    string fileName        = resultFileName;//e.UploadedFile.FileName;
                    file.SaveAs(uploadFolder + fileName);
                    e.CallbackData = fileName;
                    Guid UserGUID = new Guid(Membership.GetUser().ProviderUserKey.ToString());
                    var  sonuc    = db.I_PrimHakedis_Excel(uploadFolder + fileName, UserGUID).ToList();
                    //var sonuc = db.I_TemlikRapor_Excel(uploadFolder + fileName, UserGUID).ToList();
                    //var sonuc = db.I_AktivasyonAraRapor_Excel(uploadFolder + fileName, UserGUID).ToList().FirstOrDefault().Sonuc;
                }

                ////ASPxGridView1.DataSource = DataProvider.GetCagriIstekYenile();
                ////ASPxGridView1.DataSourceID = String.Empty;
                ////ASPxGridView1.DataBind();

                //DosyaYuklemePopup.JSProperties["cpVisible"] = "false";
                e.CallbackData = "success";
            }
            catch (Exception hata)
            {
                e.CallbackData = "error: " + hata.Message;
            }
        }