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(); }
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(); }