Ejemplo n.º 1
0
    public void ExportReportPdf()
    {
        try
        {
            //Şimdi oluşturulan kapak dosyasını veritabanına işlemek için path ve dosyaadi bilgisini oluştur.
            EFDal e = new EFDal();

            //Guid KapakDosyaAdi = Guid.NewGuid();



            Guid   KapakDosyaAdi = Guid.Parse(Session["SertifikaDosyaAdi"].ToString());
            var    usr           = UserManager.GetCurrentUser();
            string usrName       = usr.Identity.Name;

            int    BolgeKodu = e.kal_BolgeKoduDon(usrName);
            string dosyaYolu = Server.MapPath("~/DosyaSistemi/");
            dosyaYolu += BolgeKodu.ToString();
            //switch (BolgeKodu)
            //{
            //    case 1:
            //        dosyaYolu += "Gebze";
            //        break;
            //    case 2:
            //        dosyaYolu += "Ankara";
            //        break;
            //    case 3:
            //        dosyaYolu += "Bursa";
            //        break;

            //}
            dosyaYolu += '\\' + DateTime.Now.Year.ToString() + '\\' + KapakDosyaAdi.ToString() + ".pdf";

            //string bak = dosyaYolu;
            //1 nolu dokuman Sertifika kapagına karsilik geliyor



            ExportOptions crExportOptions = new ExportOptions();
            DiskFileDestinationOptions crDiskFileDestinationOptions = new DiskFileDestinationOptions();
            String Fname = "";
            //string DosyaAdi = KapakDosyaAdi.ToString();//Request["IstId"];
            //Fname = "c:\\TEMP\\" + "tut.doc";
            //Fname = Server.MapPath("~\\DosyaSistemi\\" + DosyaAdi + ".pdf");
            Fname = dosyaYolu;
            crDiskFileDestinationOptions.DiskFileName = Fname;
            crExportOptions = report.ExportOptions;
            crExportOptions.DestinationOptions    = crDiskFileDestinationOptions;
            crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
            crExportOptions.ExportFormatType      = ExportFormatType.PortableDocFormat;
            lblUyari.Text = "merhaba";
            report.Export();
            Response.ClearContent();
            Response.ClearHeaders();
            Response.ContentType = "application/pdf";
            Response.WriteFile(Fname);
            Response.Flush();
            Response.Close();
            //if (Session["DokumanSaklanacakIstId"] == null)
            if (Session["eImzaliOlacak"] == null)
            {
                System.IO.File.Delete(Fname);
            }
            else//Yani saklanacak ve imzalanacak bir dokuman
            {
                int istId = Convert.ToInt32(Request["IstId"]);
                IKBSServisi.ikbsSoapClient client = new IKBSServisi.ikbsSoapClient();
                //var birimBilgisi=client.BirimBilgisiGetir(Guid.Parse("e1657b33-c92d-4bde-a813-164a5e5bcacb"));
                //önce imzali dosyalar tablosunda bu istid ye kapak v veriye ilişkin ne varsa silmek gerekli

                e.SertifikapagiVarsaSil(Convert.ToInt32(Request["IstId"]));

                e.spImzaliDosyalaraEkle(Convert.ToInt32(Request["IstId"]), KapakDosyaAdi + ".pdf", 1, Guid.Empty,
                                        e.UserNamedenUserIdDon(usrName), dosyaYolu, ".pdf");
                Session.Remove("DokumanSaklanacakIstId");
                Session.Remove("eImzaliOlacak");
                Session["SertifikaKapagiEklendi"] = "E";
            }
        }
        catch (Exception e)
        {
        }
        //ServiceCMS client = new ServiceCMS();
    }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     IKBSServisi.ikbsSoapClient client = new IKBSServisi.ikbsSoapClient();
     //client.
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     IKBSServisi.ikbsSoapClient client = new IKBSServisi.ikbsSoapClient();
     //client.
 }
Ejemplo n.º 4
0
    public void ExportReportPdf()
    {
        try
        {

            //Şimdi oluşturulan kapak dosyasını veritabanına işlemek için path ve dosyaadi bilgisini oluştur.
            EFDal e = new EFDal();

            //Guid KapakDosyaAdi = Guid.NewGuid();

            Guid KapakDosyaAdi = Guid.Parse(Session["SertifikaDosyaAdi"].ToString());
            var usr = UserManager.GetCurrentUser();
            string usrName = usr.Identity.Name;

            int BolgeKodu = e.kal_BolgeKoduDon(usrName);
            string dosyaYolu = Server.MapPath("~/DosyaSistemi/");
            dosyaYolu += BolgeKodu.ToString();
            //switch (BolgeKodu)
            //{
            //    case 1:
            //        dosyaYolu += "Gebze";
            //        break;
            //    case 2:
            //        dosyaYolu += "Ankara";
            //        break;
            //    case 3:
            //        dosyaYolu += "Bursa";
            //        break;

            //}
            dosyaYolu += '\\' + DateTime.Now.Year.ToString() + '\\' + KapakDosyaAdi.ToString() + ".pdf";

            //string bak = dosyaYolu;
            //1 nolu dokuman Sertifika kapagına karsilik geliyor

            ExportOptions crExportOptions = new ExportOptions();
            DiskFileDestinationOptions crDiskFileDestinationOptions = new DiskFileDestinationOptions();
            String Fname = "";
            //string DosyaAdi = KapakDosyaAdi.ToString();//Request["IstId"];
            //Fname = "c:\\TEMP\\" + "tut.doc";
            //Fname = Server.MapPath("~\\DosyaSistemi\\" + DosyaAdi + ".pdf");
            Fname = dosyaYolu;
            crDiskFileDestinationOptions.DiskFileName = Fname;
            crExportOptions = report.ExportOptions;
            crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
            crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
            crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
            lblUyari.Text = "merhaba";
            report.Export();
            Response.ClearContent();
            Response.ClearHeaders();
            Response.ContentType = "application/pdf";
            Response.WriteFile(Fname);
            Response.Flush();
            Response.Close();
            //if (Session["DokumanSaklanacakIstId"] == null)
            if (Session["eImzaliOlacak"]==null)
            {
                System.IO.File.Delete(Fname);
            }
            else//Yani saklanacak ve imzalanacak bir dokuman
            {
               int istId = Convert.ToInt32(Request["IstId"]);
                IKBSServisi.ikbsSoapClient client=new IKBSServisi.ikbsSoapClient();
                //var birimBilgisi=client.BirimBilgisiGetir(Guid.Parse("e1657b33-c92d-4bde-a813-164a5e5bcacb"));
                //önce imzali dosyalar tablosunda bu istid ye kapak v veriye ilişkin ne varsa silmek gerekli

               e.SertifikapagiVarsaSil(Convert.ToInt32(Request["IstId"]));

               e.spImzaliDosyalaraEkle(Convert.ToInt32(Request["IstId"]), KapakDosyaAdi + ".pdf", 1, Guid.Empty,
               e.UserNamedenUserIdDon(usrName), dosyaYolu, ".pdf");
               Session.Remove("DokumanSaklanacakIstId");
               Session.Remove("eImzaliOlacak");
               Session["SertifikaKapagiEklendi"] = "E";
            }

        }
        catch (Exception e)
        {

        }
        //ServiceCMS client = new ServiceCMS();
    }
Ejemplo n.º 5
0
 public Guid BirimAmiriDon(int BolgeKodu)
 {
     Guid sonuc = new Guid();
     if (IcindeBulunulanAnIcinBolgedeVekaletVarMi(BolgeKodu) == Guid.Empty)
     {
         using (IKBSServisi.ikbsSoapClient client = new IKBSServisi.ikbsSoapClient())
         {
             switch (BolgeKodu)
             {
                 case 1:
                     sonuc =
                         Guid.Parse(
                             client.BirimBilgisiGetir(Guid.Parse("e1657b33-c92d-4bde-a813-164a5e5bcacb")).Tables[0].Rows[
                                 0]["BirimAmirUN"].ToString());
                     break;
                 case 2:
                     sonuc =
                         Guid.Parse(
                             client.BirimBilgisiGetir(Guid.Parse("ab634693-903a-4f77-a2e7-5f80123e0ef0")).Tables[0].Rows[
                                 0]["BirimAmirUN"].ToString());
                     break;
                 case 3:
                     sonuc =
                         Guid.Parse(
                             client.BirimBilgisiGetir(Guid.Parse("aabaaa50-55f2-4d5a-a8bd-0a15aa543b9d")).Tables[0].Rows[
                                 0]["BirimAmirUN"].ToString());
                     break;
             }
         }
         return sonuc;
     }
     else
     {
         return IcindeBulunulanAnIcinBolgedeVekaletVarMi(BolgeKodu);
     }
 }