コード例 #1
0
ファイル: Home.aspx.cs プロジェクト: vinayasshetty/ad5
    protected void btninsert_Click(object sender, EventArgs e)
    {
        EmpServiceClient proxy = new EmpServiceClient("BasicHttpBinding_IEmpService");

        var result = new tbl_employee
        {
            Ecode  = int.Parse(txtecode.Text),
            Ename  = txtename.Text,
            salary = int.Parse(txtsalary.Text),
            deptid = int.Parse(txtdeptid.Text)
        };

        proxy.AddEmployee(result);
        GridView1.DataSource = proxy.GetAllEmps().ToList();
        GridView1.DataBind();
    }
コード例 #2
0
        protected void btnAddEmp_Click(object sender, EventArgs e)
        {
            Employee emp = new Employee
            {
                Ecode  = int.Parse(txtEcode.Text),
                Ename  = TxtEname.Text,
                Salary = int.Parse(txtSalary.Text),
                Deptid = int.Parse(txtDeptid.Text)
            };

            EmpServiceClient proxy = new EmpServiceClient();

            proxy.AddEmployee(emp);
            lblMsg.Text = "Record inserted";

            GridView1.DataSource = proxy.GetAllEmps().ToList();
            GridView1.DataBind();
        }