Esempio n. 1
0
    protected void jousave_Click(object sender, EventArgs e)
    {
        Journalshared joupap = new Journalshared();

        joupap.Jtitle = txtJtitle.Text;

        joupap.Jcity = txtJcity.Text;

        joupap.Jclass = int.Parse(txtJclass.Text);

        joupap.Jsub = txtJsub.Text;



        HttpChannel chnl0 = new HttpChannel();

        ChannelServices.RegisterChannel(chnl0, false);

        IJournalManger serve = (IJournalManger)Activator.GetObject(typeof(IJournalManger), "http://localhost:1234/journalservice.soap");
        int            s     = serve.save(joupap);

        lblResult.Text    = "Journal Add succficly" + " AND  its ID      " + s;
        lblResult.Visible = true;
        jouresult.Visible = false;

        ChannelServices.UnregisterChannel(chnl0);
    }
Esempio n. 2
0
        public void modifaypaper(Journalshared current)
        {
            using (PaperindexDataClassDataContext db = new PaperindexDataClassDataContext())
            {
                journal jou = db.journals.SingleOrDefault(x => x.jouID == current.JId);

                jou.joucity      = current.Jcity;
                jou.journalTitle = current.Jtitle;
                jou.jousubject   = current.Jsub;
                jou.jouclass     = current.Jclass;


                db.SubmitChanges();

                Console.WriteLine("Modifay Journal IS EXECUTE ......" + DateTime.Now);
            }
        }
Esempio n. 3
0
 public int save(Journalshared current)
 {
     using (PaperindexDataClassDataContext db = new PaperindexDataClassDataContext())
     {
         journal jou = new journal
         {
             journalTitle = current.Jtitle,
             jouclass     = current.Jclass,
             joucity      = current.Jcity,
             jousubject   = current.Jsub
         };
         db.journals.InsertOnSubmit(jou);
         db.SubmitChanges();
         Console.WriteLine(" ADD Journal IS EXECUTE ......" + DateTime.Now);
         return(jou.jouID);
     }
 }
Esempio n. 4
0
    protected void joudel_Click(object sender, EventArgs e)
    {
        HttpChannel chn23 = new HttpChannel();

        ChannelServices.RegisterChannel(chn23, false);

        IJournalManger serve = (IJournalManger)Activator.GetObject(typeof(IJournalManger), "http://localhost:1234/journalservice.soap");

        Journalshared showjou = new Journalshared();
        int           d       = int.Parse(searchtxt.Text);


        serve.delete(d);
        jouresult.Visible = false;
        joudel.Visible    = false;
        lblResult.Text    = " Journal deleted Succeded ";
        lblResult.Visible = true;
        ChannelServices.UnregisterChannel(chn23);
    }
Esempio n. 5
0
        public Journalshared getById(int id)
        {
            using (PaperindexDataClassDataContext db = new PaperindexDataClassDataContext())
            {
                journal jou = db.journals.SingleOrDefault(x => x.jouID == id);

                Journalshared ps = new Journalshared();


                ps.Jtitle = jou.journalTitle;
                ps.Jcity  = jou.joucity;
                ps.Jclass = jou.jouclass;
                ps.Jsub   = jou.jousubject;


                Console.WriteLine("Retrive Journal IS EXECUTE ......" + DateTime.Now);
                return(ps);
            }
        }
Esempio n. 6
0
    protected void search_Click(object sender, EventArgs e)
    {
        Journalshared showjou = new Journalshared();

        int         p     = int.Parse(searchtxt.Text);
        HttpChannel chn22 = new HttpChannel();

        ChannelServices.RegisterChannel(chn22, false);

        IJournalManger serve = (IJournalManger)Activator.GetObject(typeof(IJournalManger), "http://localhost:1234/journalservice.soap");

        showjou = serve.getById(p);

        txtJtitle.Text = showjou.Jtitle;
        txtJcity.Text  = showjou.Jcity;
        txtJsub.Text   = showjou.Jsub;
        txtJclass.Text = Convert.ToString(showjou.Jclass);

        jouresult.Visible = true;
        joudel.Visible    = true;

        ChannelServices.UnregisterChannel(chn22);
    }
Esempio n. 7
0
    protected void joudmod_Click(object sender, EventArgs e)
    {
        HttpChannel chn33 = new HttpChannel();

        ChannelServices.RegisterChannel(chn33, false);

        IJournalManger serve = (IJournalManger)Activator.GetObject(typeof(IJournalManger), "http://localhost:1234/journalservice.soap");

        Journalshared showjou = new Journalshared();
        int           p       = int.Parse(searchtxt.Text);

        showjou.JId    = p;
        showjou.Jtitle = txtJtitle.Text;
        showjou.Jcity  = txtJcity.Text;
        showjou.Jsub   = txtJsub.Text;
        showjou.Jclass = int.Parse(txtJclass.Text);

        serve.modifaypaper(showjou);
        jouresult.Visible = false;
        joumod.Visible    = false;
        lblResult.Text    = " Journal Modfiy Succeded ";
        lblResult.Visible = true;
        ChannelServices.UnregisterChannel(chn33);
    }