コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int bolum_id;

            kullanici = Session["KullaniciAdi"];
            if (kullanici == null)
            {
                Response.Write("<script>alert('Oturum Süreniz Geçmiş!');</script>");
                System.Threading.Thread.Sleep(1000);
                Server.Transfer("Login.aspx");
            }
            BLL.Kullanici blkullanici = new BLL.Kullanici();
            BLL.Bolum     blbolum     = new BLL.Bolum();
            string        temp        = kullanici.ToString();

            labelOgrno.Text  = blkullanici.Getir1(temp).ogrenci_no;
            bolum_id         = blkullanici.Getir1(temp).bolum_id;
            labelEposta.Text = blkullanici.Getir1(temp).eposta;
            labelBolum.Text  = blbolum.Getir(bolum_id).bolum_adi;
            Labeladsoy.Text  = blkullanici.Getir1(temp).ad + blkullanici.Getir1(temp).soyad;
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            kullanici = Session["KullaniciAdi"];
            if (kullanici == null)
            {
                Response.Write("<script>alert('Oturum Süreniz Geçmiş!');</script>");
                System.Threading.Thread.Sleep(1000);
                Server.Transfer("Login.aspx");
            }
            staj_id = Convert.ToInt32(Session["stj_id"]);
            BLL.Kullanici blkullanici = new BLL.Kullanici();
            BLL.Staj      blstaj      = new BLL.Staj();
            BLL.Bolum     blbolum     = new BLL.Bolum();
            ogrenci = blstaj.ListeGetir2(staj_id).FirstOrDefault().tc_no;
            string temp = ogrenci;

            LabelOgrNo.Text = blkullanici.Getir(temp).ogrenci_no;
            bolum_id        = blkullanici.Getir(temp).bolum_id;
            LabelBolum.Text = blbolum.Getir(bolum_id).bolum_adi;
            LabelAdsoy.Text = blkullanici.Getir(temp).ad + blkullanici.Getir(temp).soyad;
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BLL.Kullanici blKullanici = new BLL.Kullanici();
            object        kullanici   = Session["KullaniciAdi"];
            string        temp        = Convert.ToString(kullanici);

            if (kullanici == null)
            {
                Response.Write("<script>alert('Oturum Süreniz Geçmiş!');</script>");
                System.Threading.Thread.Sleep(1000);
                Server.Transfer("Login.aspx");
            }

            if (!IsPostBack)
            {
                ListVw.DataSource = blKullanici.ListeGetir(temp);
                ListVw.DataBind();
            }

            //gridview için:
            //IEnumerable<int> data = Enumerable.Range(1, 4);
            //gv.DataSource = data;
            //gv.DataBind();

            Page     p = new Page();
            HtmlForm f = new HtmlForm();

            f.Controls.Add(form1);
            p.Controls.Add(f);
            StringWriter   sw  = new StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(sw);

            f.Controls[0].RenderControl(htw);
            string content = sw.ToString();



            Document     doc    = new Document(iTextSharp.text.PageSize.A4);
            MemoryStream output = new MemoryStream();

            PdfWriter.GetInstance(doc, output);
            doc.Open();



            content = RelativeToAbsoluteURLS(content);
            List <IElement> dizi = HTMLWorker.ParseToList(new StringReader(content), null);

            foreach (var item in dizi)
            {
                doc.Add(item);
            }



            Phrase phrase = new Phrase(Environment.NewLine);

            doc.Add(phrase);



            BaseFont STF_Helvetica_Turkish = BaseFont.CreateFont("Helvetica", "CP1254", BaseFont.NOT_EMBEDDED);
            Font     fontNormal            = new Font(STF_Helvetica_Turkish, 9, Font.NORMAL, BaseColor.DARK_GRAY);

            fontNormal.SetFamily("Arial");
            Anchor anc = new Anchor("Karabük Üniversitesi, Mühendislik Fakültesi, Kampüs,  KARABÜK, Tel: (0 370)  433 20 21, Faks: (0 370)  433 32 90", fontNormal);

            doc.Add(anc);
            //doc.Add(new Paragraph("bu bir paragraftır :)"));
            //doc.Add(new Anchor("http://www.da.name.tr"));

            doc.Close();



            doc.Close();
            Response.Clear();
            // tarayıcıda göstermek için:
            Response.AddHeader("content-disposition", "inline;filename=Ek1.pdf;");
            // download ettirmek için:
            Response.ContentType = "application/pdf";
            Response.BinaryWrite(output.ToArray());
            Response.End();
        }
コード例 #4
0
ファイル: BaseRepo.cs プロジェクト: sakirdemirhan/MuzikBurada
 public void UpdateUser(Kullanici obj)
 {
     MyContext.db.Users.AddOrUpdate(obj);
     //MyContext.db.Entry(obj).State = System.Data.Entity.EntityState.Modified;
     MyContext.db.SaveChanges();
 }