protected void btnSave_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(txtPrice.Value))
        {
            Owen.Common.JSHelper.Alert(this, "请输入价格!");
            return;
        }
        decimal p;
        if (!decimal.TryParse(txtPrice.Value, out p))
        {
            Owen.Common.JSHelper.Alert(this, "请输入正确的格式!");
            return;
        }
        Owen.Model.Model_Medical mMedical = new Owen.BLL.BLL_Medical().GetEntity(medicalId);
        if (mMedical != null)
        {
            mMedical.Price = p;
            mMedical.MedicalID = medicalId;
            if (new Owen.BLL.BLL_Medical().UpdateEntity(mMedical))
            {
                Owen.Common.JSHelper.Alert(this, "修改成功!", "MedicalList.aspx");
            }
            else
            {
                Owen.Common.JSHelper.Alert(this, "修改失败,请稍后再试!");
                return;
            }
        }

    }
    protected void Page_Load(object sender, EventArgs e)
    {
        medicalId = Owen.Common.Utils.GetQueryInt("medicalId");
        action = Owen.Common.Utils.GetQueryString("action");

        if (medicalId == 0)
            Response.Redirect("MedicalList.aspx");
        if (!Page.IsPostBack)
        {
            Owen.Model.Model_Medical mMedical = new Owen.BLL.BLL_Medical().GetEntity(medicalId);
            if (mMedical != null && mMedical.Price != 0.00M)
                txtPrice.Value = mMedical.Price.ToString();
        }
    }
    /// <summary>
    /// 初始加载
    /// </summary>
    private void OnStart(object sender, EventArgs e)
    {
        Owen.Model.Model_Medical model = new Owen.BLL.BLL_Medical().GetEntity(medicalId);
        if (model == null) return;
        txtPatientMobile.Text = model.PatientMobile;
        txtPatientBirth.Text = model.PatientBirth;
        txtPatientAge.Text = model.PatientAge.ToString();
        txtPatientName.Text = model.PatientName;
        txtSurgery.Text = model.Surgery;
        txtHospitalNumber.Text = model.HospitalNumber;
        txtPatientMobile.Text = model.PatientMobile;

        //医生Id
        int doctorId = model.DoctorID;
        ddlDoctor.SelectedValue = doctorId.ToString();
        if (model.mDoctor == null) return;
        int hosId = model.mDoctor.HospitalID;
        ddlHospital.SelectedValue = hosId.ToString();

    }
    /// <summary>
    /// 初始加载
    /// </summary>
    private void OnStart(object sender, EventArgs e)
    {
        Owen.Model.Model_Medical model = new Owen.BLL.BLL_Medical().GetEntity(medicalId);

        if (model == null) return;

        txtPatientMobile.Text = model.PatientMobile;
        txtPatientBirth.Text = model.PatientBirth;
        txtPatientAge.Text = model.PatientAge.ToString();
        ddlPatientSex.SelectedValue = model.PatientSex.ToString();
        txtPatientName.Text = model.PatientName;
        txtSurgery.Text = model.Surgery;
        txtHospitalNumber.Text = model.HospitalNumber;
        txtPatientMobile.Text = model.PatientMobile;

        //医生Id
        int doctorId = model.DoctorID;
        //根据医生Id得到所属的医院
        if (model.mDoctor == null) return;
        int hosId = model.mDoctor.HospitalID;


        //根据医院Id得到所属的城市Id
        Owen.Model.Model_Hospital mHospital = new Owen.BLL.BLL_Hospital().GetEntity(hosId);
        if (mHospital == null) return;
        int cityId = mHospital.CityID;

        //根据城市Id得到省(直辖市)Id
        Owen.Model.Model_City mCity = new Owen.BLL.BLL_City().GetEntity(cityId);
        if (mCity == null) return;
        int province = mCity.ProvinceID;


        ddlHospital.SelectedValue = hosId.ToString();
        ddlHospital_SelectedIndexChanged(sender, e);

        ddlDoctor.SelectedValue = doctorId.ToString();
    }