public void CreateStudent() { var Name = "Preethi"; var DepartmentId = 1; StudentDetailBS studentDetailBS = new StudentDetailBS(); ClsStudentResult result = studentDetailBS.ProcessSave(new BusinessObject.StudentDetailBO() { Name = Name, DepartmentId = DepartmentId }); }
protected void btn_Click(object sender, EventArgs e) { var Name = txtStudent.Text; var DepartmentId = Convert.ToInt32(ddlDepartment.SelectedValue); StudentDetailBS studentDetailBS = new StudentDetailBS(); ClsStudentResult result = studentDetailBS.ProcessSave(new BusinessObject.StudentDetailBO() { Name = Name, DepartmentId = DepartmentId }); if (result.Success) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Inserted');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + result.ErrorDesc + "');", true); } }