Beispiel #1
0
    protected void paperUpdate_Click(object sender, EventArgs e)
    {
        HttpChannel chn6 = new HttpChannel();

        ChannelServices.RegisterChannel(chn6, false);

        Ipaperservice serve   = (Ipaperservice)Activator.GetObject(typeof(Ipaperservice), "http://localhost:1234/papmanger.soap");
        papershare    showpap = new papershare();


        showpap.PId         = int.Parse(searchtxt.Text);
        showpap.PTitle      = txtPtitle.Text;
        showpap.JTitle      = txtPJtitle.Text;
        showpap.PAbstract   = txtPabstract.Text;
        showpap.Pauther     = txtPauthers.Text;
        showpap.PInumber    = int.Parse(txtin.Text);
        showpap.PKeywords   = txtkeywords.Text;
        showpap.PNofauthers = int.Parse(txtPnunmerofauthers.Text);
        showpap.PPagesF     = int.Parse(txtpj2.Text);
        showpap.PPagesN     = int.Parse(txtpj1.Text);
        showpap.PVnumber    = int.Parse(txtvn.Text);
        showpap.PYear       = int.Parse(txtYearofpublishing.Text);

        ValidationResult rest = serve.validate(showpap);

        if (rest.Ok == true)
        {
            serve.modifaypaper(showpap);
            paperresult.Visible = false;
            paperupdate.Enabled = false;
            paperupdate.Visible = false;
            lblResult.Text      = " Paper  Updated Succeded ";
            lblResult.Visible   = true;
            paperupdate.Visible = false;
        }

        else
        {
            errorresult.Text    = rest.Msg;
            errorresult.Visible = true;
            paperresult.Visible = true;
            paperupdate.Visible = true;
            paperupdate.Enabled = true;
        }
        ChannelServices.UnregisterChannel(chn6);
    }
Beispiel #2
0
    protected void papersave_Click(object sender, EventArgs e)
    {
        papershare savpap = new papershare();

        savpap.JTitle      = txtPJtitle.Text;
        savpap.PAbstract   = txtPabstract.Text;
        savpap.Pauther     = txtPauthers.Text;
        savpap.PInumber    = int.Parse(txtin.Text);
        savpap.PKeywords   = txtkeywords.Text;
        savpap.PNofauthers = int.Parse(txtPnunmerofauthers.Text);
        savpap.PPagesF     = int.Parse(txtpj2.Text);
        savpap.PPagesN     = int.Parse(txtpj1.Text);
        savpap.PTitle      = txtPtitle.Text;
        savpap.PVnumber    = int.Parse(txtvn.Text);
        savpap.PYear       = int.Parse(txtYearofpublishing.Text);


        HttpChannel chnl = new HttpChannel();

        ChannelServices.RegisterChannel(chnl, false);

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

        ValidationResult rest = serve.validate(savpap);

        if (rest.Ok == false)
        {
            errorresult.Text    = rest.Msg;
            errorresult.Visible = true;
        }

        else
        {
            int s = serve.addpaper(savpap);
            paperresult.Visible = false;
            errorresult.Text    = rest.Msg;
            errorresult.Visible = true;
            lblResult.Text      = "Paper Add succficly" + " its ID      " + s;
            lblResult.Visible   = true;
            papersave.Visible   = false;
            ClearTextFields();
        }
        ChannelServices.UnregisterChannel(chnl);
    }