public int BusinessUpdateAddPhysician(EntityPhysician objEn)
        {
            int result;

            SqlParameter[] objPara = new SqlParameter[7];

            objPara[0]       = new SqlParameter("@FirstName", SqlDbType.VarChar, 20);
            objPara[0].Value = objEn.FirstName;

            objPara[1]       = new SqlParameter("@LastName", SqlDbType.VarChar, 20);
            objPara[1].Value = objEn.LastName;

            objPara[2]       = new SqlParameter("@YearsOfExperience", SqlDbType.Int);
            objPara[2].Value = objEn.YearsOfExperience;

            objPara[3]       = new SqlParameter("@DepartmentId", SqlDbType.VarChar, 4);
            objPara[3].Value = objEn.DepartmentId;

            objPara[4]       = new SqlParameter("@StateId", SqlDbType.VarChar, 2);
            objPara[4].Value = objEn.StateId;

            objPara[5]       = new SqlParameter("@PlanId", SqlDbType.VarChar, 4);
            objPara[5].Value = objEn.PlanId;

            objPara[6]       = new SqlParameter("@EduQualification", SqlDbType.VarChar, 20);
            objPara[6].Value = objEn.EduQualification;

            result = objDataAddPhysician.DataUpdateAddPhysician(objPara);

            return(result);
        }
Exemplo n.º 2
0
        public DataTable businessFillPhysicianResult(EntityPhysician objEntity)
        {
            SqlParameter[] objPara = new SqlParameter[3];
            objPara[0]       = new SqlParameter("@StateId", SqlDbType.VarChar, 2);
            objPara[0].Value = objEntity.StateId;
            objPara[1]       = new SqlParameter("@PlanId", SqlDbType.VarChar, 4);
            objPara[1].Value = objEntity.PlanId;
            objPara[2]       = new SqlParameter("@DepartmentId", SqlDbType.VarChar, 4);
            objPara[2].Value = objEntity.DepartmentId;
            DataTable objTable = new DataTable();

            objTable.Clear();
            objTable = objData.dataFillPhysicianResult(objPara).Tables["SearchPhysicianResult"];
            return(objTable);
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //Submit Button:submit the Physician Information to the DataBase
            BusinessAddPhysician objBus = new BusinessAddPhysician();
            EntityPhysician      objEn  = new EntityPhysician();

            objEn.FirstName = tbFirstName.Text;
            objEn.LastName  = tbLastName.Text;
            if (cbDepartment.SelectedIndex == 0)
            {
                //Show error message
            }
            else
            {
                objEn.DepartmentId = cbDepartment.SelectedValue; //Same as: SelectedItem.Value
                                                                 //Gives the value of the selected index.
            }

            objEn.EduQualification  = tbEducationalQualification.Text;
            objEn.YearsOfExperience = Convert.ToInt32(tbYearsOfExperience.Text);

            if (cbPlan.SelectedIndex == 0)
            {
                //Show error message
            }
            else
            {
                objEn.PlanId = cbPlan.SelectedValue;
            }

            if (cbState.SelectedIndex == 0)
            {
                //Show Error message
            }
            else
            {
                objEn.StateId = cbState.SelectedValue;
            }


            int result;

            result = objBus.BusinessUpdateAddPhysician(objEn);
        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            EntityPhysician objEn = new EntityPhysician();

            if (cbState.SelectedIndex == 0)
            {
                //Error Message
            }
            else
            {
                objEn.StateId = cbState.SelectedValue;
            }

            if (cbPlan.SelectedIndex == 0)
            {
                //Error Message
            }
            else
            {
                objEn.PlanId = cbPlan.SelectedValue;
            }

            if (cbDepartment.SelectedIndex == 0)
            {
                //Error Message
            }
            else
            {
                objEn.DepartmentId = cbDepartment.SelectedValue;
            }

            BusinessSearchPhysician bus = new BusinessSearchPhysician();
            DataTable dt;

            dt = bus.businessFillPhysicianResult(objEn);
            gvSearchPhysicianResult.DataSource = dt;
            gvSearchPhysicianResult.DataBind();
        }