Beispiel #1
0
        protected void UploadControlGuncelle_FilesUploadComplete(object sender, FilesUploadCompleteEventArgs e)
        {
            // ay ve yıl combobox'ın daki parametreleri SP ye gönderip o ay aralığındaki kayıtları silip yeni excel yüklenecek.

            try
            {
                foreach (UploadedFile file in UploadControlGuncelle.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());
                    db.D_TemlikRapor_Excel(Convert.ToInt32(CmbAy.Value), Convert.ToInt32(CmbYil.Value), "", null);
                    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;
            }
        }