示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

        ViewPower   = base.GetPower(PowerList[0]);
        UpdatePower = base.GetPower(PowerList[1]);

        if (this.IsPostBack == false)
        {
            var codes = SystemCode.dict["CodeM_SchoolCode_EnableState"];

            ddEnState.Items.Add(new ListItem("請選擇", "0"));
            foreach (var item in codes)
            {
                ddEnState.Items.Add(new ListItem(item.EnumName, item.EnumValue.ToString()));
            }

            ddEnState.SelectedValue = "0";

            CountyJson  = JsonConvert.SerializeObject(SystemAreaCode.GetCountyList());
            TownJson    = JsonConvert.SerializeObject(SystemAreaCode.GetTownList(County));
            VillageJson = JsonConvert.SerializeObject(SystemAreaCode.GetVillageList(Town));
        }
    }
示例#2
0
    /// <summary>
    /// 轄區所屬Village
    /// </summary>
    /// <param name="OrgID"></param>
    /// <param name="TownID"></param>
    /// <returns></returns>
    public static List <SystemAreaCodeVM> GetRegionVillageList(int OrgID, int TownID)
    {
        SystemOrgVM             OrgVM = SystemOrg.GetVM(OrgID);
        List <SystemAreaCodeVM> list  = SystemAreaCode.GetVillageList(TownID);

        if (OrgVM.OrgLevel == 4)  //衛生所
        {
            List <int> RegionVillageIDs = new List <int>();

            List <SystemOrgRegionVM> RegionList = GetOrgRegion(OrgID);
            foreach (SystemOrgRegionVM r in RegionList)
            {
                if (SystemOrgRegion.dictRegionSetting.ContainsKey(r.RegionID))
                {
                    RegionVillageIDs.AddRange(dictRegionSetting[r.RegionID].Select(l => l.VillageID).Distinct());
                }
            }
            list = list.Where(ac => RegionVillageIDs.Contains(ac.ID)).ToList();
        }
        return(list);
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ViewPower   = base.GetPower(PowerList[0]);
        UpdatePower = base.GetPower(PowerList[1]);

        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(true);
        base.BodyClass = "class='bodybg'";

        int.TryParse(Request["i"], out ID);

        if (ID == 0)
        {
            string script = "<script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }

        if (UpdatePower.HasPower == false)
        {
            tbAddress.Enabled = false;
            tbTel.Enabled     = false;
            tbVaccine.Enabled = false;
            ddAgState.Enabled = false;
            //tbDepartment.Enabled = false;
        }

        if (this.IsPostBack == false)
        {
            DataSet ds = new DataSet();

            using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
            {
                using (SqlCommand cmd = new SqlCommand("dbo.usp_ParameterM_xGetAgencyByID", sc))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@AgencyInfoID", ID);
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        sc.Open();
                        da.Fill(ds);
                    }
                }
            }


            AgencyInfoVM        VM   = new AgencyInfoVM();
            List <AddVaccineVM> list = new List <AddVaccineVM>();

            EntityS.FillModel(VM, ds.Tables[0]);
            EntityS.FillModel(list, ds.Tables[1]);


            var dict = SystemCode.GetDict("LocationSettingM_Divisions");

            StateListAry = JsonConvert.SerializeObject(dict);

            var codes = SystemCode.dict["ParameterM_LocationSetting_AgencyState"];

            ddAgState.Items.Add(new ListItem("請選擇", "0"));
            foreach (var item in codes)
            {
                ddAgState.Items.Add(new ListItem(item.EnumName, item.EnumValue.ToString()));
            }

            ddAgState.SelectedValue = VM.AgencyState.ToString();
            lblBsState.Text         = VM.BusinessStateString;
            //tbDepartment.Text = VM.Department;

            County  = VM.AgencyCounty;
            Town    = VM.AgencyTown;
            Village = VM.AgencyVillage;



            tbAddress.Text  = VM.AgencyAddress;
            tbTel.Text      = VM.AgencyPhoneNumber;
            tbSchedule.Text = VM.InoculationSchedule;

            lblName.Text  = VM.AgencyName;
            lblCode.Text  = VM.AgencyCode;
            tbOrg.Text    = VM.OrgName;
            hfOrgID.Value = VM.OrgID.ToString();
            //tbDepartment.Text = VM.Department;

            tbVaccine.Text = string.Join(",", list.Select(item => item.VaccineCName));
            tbOther        = VM.DepartmentOther;
            switch (VM.ReportingType)
            {
            case 1:
                rb1.Checked = true;
                break;

            case 2:
                rb2.Checked = true;
                break;

            case 3:
                rb3.Checked = true;
                break;
            }

            if (VM.IsSimpleFlu == false)
            {
                rbB1.Checked = true;
            }
            else
            {
                rbB2.Checked = true;
            }
            tbOtherIDs  = VM.DepartmentIDs;
            CountyJson  = JsonConvert.SerializeObject(SystemAreaCode.GetCountyList());
            TownJson    = JsonConvert.SerializeObject(SystemAreaCode.GetTownList(County));
            VillageJson = JsonConvert.SerializeObject(SystemAreaCode.GetVillageList(Town));
        }
    }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

        ViewPower   = base.GetPower(PowerList[0]);
        UpdatePower = base.GetPower(PowerList[1]);

        ElementarySchoolID = GetNumber <int>("i");

        if (ElementarySchoolID == 0)
        {
            IsValid = false;
            string script = "<script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }
        if (this.IsPostBack == false)
        {
            uc1.TableName = "O_OrgLog";
            uc1.WhereDict = new Dictionary <string, object>()
            {
                { "@OrgID", ID }
            };

            DataTable dt = GetDataTable("ConnDB", "dbo.usp_CodeM_xGetElementarySchoolByID"
                                        , new Dictionary <string, object>()
            {
                { "@ElementarySchoolID", ElementarySchoolID }
            });
            SchoolCodeVM VM = new SchoolCodeVM();
            EntityS.FillModel(VM, dt);

            tbName.Text    = VM.SchoolName;
            tbCode.Text    = VM.SchoolCode;
            tbTel.Text     = VM.SchoolPhoneNumber;
            tbAddress.Text = VM.SchoolAddress;

            County  = VM.SchoolCounty;
            Town    = VM.SchoolTown;
            Village = VM.SchoolVillage;

            CountyName  = SystemAreaCode.GetName(VM.SchoolCounty);
            TownName    = SystemAreaCode.GetName(VM.SchoolTown);
            VillageName = SystemAreaCode.GetName(VM.SchoolVillage);

            var codes = SystemCode.dict["CodeM_SchoolCode_EnableState"];

            ddEnState.Items.Add(new ListItem("請選擇", "0"));
            foreach (var item in codes)
            {
                ddEnState.Items.Add(new ListItem(item.EnumName, item.EnumValue.ToString()));
            }

            ddEnState.SelectedValue = VM.EnableState.ToString();

            CountyJson  = JsonConvert.SerializeObject(SystemAreaCode.GetCountyList());
            TownJson    = JsonConvert.SerializeObject(SystemAreaCode.GetTownList(County));
            VillageJson = JsonConvert.SerializeObject(SystemAreaCode.GetVillageList(Town));
        }
    }
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

        ViewPower   = base.GetPower(PowerList[0]);
        UpdatePower = base.GetPower(PowerList[1]);

        //if (UpdatePower.HasPower)
        //{
        //    form1.DefaultButton = "btnSave";
        //}

        ID         = GetNumber <int>("i");
        ContractID = GetNumber <int>("i2");

        if (ID == 0)
        {
            IsValid = false;
            string script = "<script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }

        if (UpdatePower.HasPower == false)
        {
            tbAddress.Enabled  = false;
            tbTel.Enabled      = false;
            tbVaccine.Enabled  = false;
            ddlAgState.Enabled = false;
            //tbDepartment.Enabled = false;
        }
        if (this.IsPostBack == false)
        {
            uc1.TableName = "O_OrgLog";
            uc1.WhereDict = new Dictionary <string, object>()
            {
                { "@OrgID", ID }
            };

            DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_ParameterM_xGetAgencyByID"
                                         , new Dictionary <string, object>()
            {
                { "@AgencyInfoID", ID }
            });

            AgencyInfoVM        VM        = new AgencyInfoVM();
            List <AddVaccineVM> list      = new List <AddVaccineVM>();
            OrgContractVM       VM2       = new OrgContractVM();
            List <DayTimeVM>    ddListIn  = new List <DayTimeVM>();
            List <DayTimeVM>    ddListOut = new List <DayTimeVM>();
            EntityS.FillModel(VM, ds.Tables[0]);
            EntityS.FillModel(list, ds.Tables[1]);
            EntityS.FillModel(VM2, ds.Tables[2]);
            EntityS.FillModel(ddListIn, ds.Tables[3]);

            foreach (var item in ddListIn)
            {
                DayTimeVM inVM = new DayTimeVM();
                inVM.ID        = item.ID;
                inVM.Monday    = item.Monday;
                inVM.Tuesday   = item.Tuesday;
                inVM.Wednesday = item.Wednesday;
                inVM.Thursday  = item.Thursday;
                inVM.Friday    = item.Friday;
                inVM.Saturday  = item.Saturday;
                inVM.Sunday    = item.Sunday;
                inVM.TimeAry   = new List <Dictionary <string, string> >();
                foreach (DataRow dr in ds.Tables[4].Rows)
                {
                    if (item.ID == Convert.ToInt32(dr["BusinesssDayID"].ToString()))
                    {
                        Dictionary <string, string> ssee = new Dictionary <string, string>();
                        ssee.Add("ss", dr["StartTime"].ToString().Substring(0, 5));
                        ssee.Add("ee", dr["StartTime"].ToString().Substring(0, 5));
                        inVM.TimeAry.Add(ssee);
                    }
                }

                ddListOut.Add(inVM);
            }


            if (ddListOut.Count > 0)
            {
                ddListOutAry = JsonConvert.SerializeObject(ddListOut);
            }

            if (VM2.ID > 0)
            {
                ContractID       = VM2.ID;
                tbDateStart.Text = VM2.ContractStart.ToShortTaiwanDate();
                tbDateEnd.Text   = VM2.ContractEnd.ToShortTaiwanDate();
                tbDateStop.Text  = VM2.ContractStop.ToShortTaiwanDate();

                if (tbDateStart.Text.Length == 0)
                {
                    tbDateStart.Text = DateTime.Now.ToShortTaiwanDate();
                }
            }

            var dict = SystemCode.GetDict("LocationSettingM_Divisions");

            StateListAry = JsonConvert.SerializeObject(dict);

            var codes = SystemCode.dict["ParameterM_LocationSetting_AgencyState"];

            ddlAgState.Items.Add(new ListItem("請選擇", ""));
            foreach (var item in codes)
            {
                ddlAgState.Items.Add(new ListItem(item.EnumName, item.EnumValue.ToString()));
            }

            ddlAgState.SelectedValue = VM.AgencyState.ToString();
            AgencyState = VM.AgencyState.ToString();

            lblBsState.Text = VM.BusinessStateString;
            //tbDepartment.Text = VM.Department;

            County  = VM.AgencyCounty;
            Town    = VM.AgencyTown;
            Village = VM.AgencyVillage;

            CountyName  = SystemAreaCode.GetName(VM.AgencyCounty);
            TownName    = SystemAreaCode.GetName(VM.AgencyTown);
            VillageName = SystemAreaCode.GetName(VM.AgencyVillage);

            tbAddress.Text              = VM.AgencyAddress;
            tbTelZone.Text              = VM.PhoneAreaCode;
            tbTel.Text                  = VM.AgencyPhoneNumber;
            tbSchedule.Text             = VM.InoculationSchedule;
            ddlAgencyCate.SelectedValue = VM.AgencyCate.ToString();

            lblName.Text  = VM.AgencyName;
            lblCode.Text  = VM.AgencyCode;
            tbOrg.Text    = VM.OrgName;
            hfOrgID.Value = VM.OrgID.ToString();
            //tbDepartment.Text = VM.Department;

            tbVaccine.Text = string.Join(",", list.Select(item => item.VaccineCName));
            tbOther        = VM.DepartmentOther;
            switch (VM.ReportingType)
            {
            case 1:
                rb1.Checked = true;
                break;

            case 2:
                rb2.Checked = true;
                break;

            case 3:
                rb3.Checked = true;
                break;

            case 4:
                rb4.Checked = true;
                break;
            }

            if (VM.IsSimpleFlu == false)
            {
                rbB1.Checked = true;
            }
            else
            {
                rbB2.Checked = true;
            }
            tbOtherIDs  = VM.DepartmentIDs;
            CountyJson  = JsonConvert.SerializeObject(SystemAreaCode.GetCountyList());
            TownJson    = JsonConvert.SerializeObject(SystemAreaCode.GetTownList(County));
            VillageJson = JsonConvert.SerializeObject(SystemAreaCode.GetVillageList(Town));
        }
    }
示例#6
0
    protected void BindData()
    {
        DataSet ds = new DataSet();

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("dbo.usp_CaseUser_xGetCaseUser", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@CaseID", CaseID);
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(ds);
                }
            }
        }
        DataTable dt = ds.Tables[0];


        if (dt.Rows.Count > 0)
        {
            BirthDate.Text                = dt.Rows[0]["BirthDateSimple"].ToString();
            tbIdNo.Text                   = dt.Rows[0]["IdNo"].ToString();
            tbPassportNo.Text             = dt.Rows[0]["PassportNo"].ToString();
            tbResNo.Text                  = dt.Rows[0]["ResNo"].ToString();
            tbOtherNo.Text                = dt.Rows[0]["OtherNo"].ToString();
            tbName.Text                   = dt.Rows[0]["ChName"].ToString();
            tbEngName.Text                = dt.Rows[0]["EnName"].ToString();
            ddlGender.SelectedValue       = dt.Rows[0]["Gender"].ToString();
            tbHouseNo.Text                = dt.Rows[0]["HouseNo"].ToString();
            ddlONationality.SelectedValue = dt.Rows[0]["ONationality"].ToString();

            foreach (string s in dt.Rows[0]["Language"].ToString().Split(','))
            {
                foreach (ListItem i in cblLang.Items)
                {
                    if (i.Value == s)
                    {
                        i.Selected = true;
                    }
                }
            }
            ;
            foreach (string s in dt.Rows[0]["Capacity"].ToString().Split(','))
            {
                foreach (ListItem i in cblCapacity.Items)
                {
                    if (i.Value == s)
                    {
                        i.Selected = true;
                    }
                }
            }
            ;



            CountyInival  = dt.Rows[0]["ConCounty"].ToString();
            TownAry       = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetTownList(Convert.ToInt32(dt.Rows[0]["ConCounty"])));
            TownInival    = dt.Rows[0]["ConTown"].ToString();
            VillageAry    = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetVillageList(Convert.ToInt32(dt.Rows[0]["ConTown"])));
            VillageInival = dt.Rows[0]["ConVillage"].ToString();

            ResCountyInival  = dt.Rows[0]["ResCounty"].ToString();
            ResTownAry       = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetTownList(Convert.ToInt32(dt.Rows[0]["ConCounty"])));
            ResTownInival    = dt.Rows[0]["ResTown"].ToString();
            ResVillageAry    = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetVillageList(Convert.ToInt32(dt.Rows[0]["ConTown"])));
            ResVillageInival = dt.Rows[0]["ResVillage"].ToString();

            //if (SystemAreaCode.dict.ContainsKey("County"))
            //{
            //    List<SystemAreaCodeVM> SystemAreaCodeList = SystemAreaCode.dict["County"];
            //    ddlResCounty.Items.Clear();
            //    ddlResCounty.Items.Add(new ListItem("縣市", ""));
            //    foreach (SystemAreaCodeVM sc in SystemAreaCodeList)
            //     ddlResCounty.Items.Add(new ListItem(sc.AreaName, sc.ID.ToString()));

            //    ddlResCounty.SelectedValue = dt.Rows[0]["ResCounty"].ToString();

            //}
            //if (SystemAreaCode.dict.ContainsKey("Town"))
            //{
            //    List<SystemAreaCodeVM> SystemAreaCodeList = SystemAreaCode.dict["Town"];
            //    ddlResTown.Items.Clear();
            //    ddlResTown.Items.Add(new ListItem("鄉鎮市區", ""));
            //    foreach (SystemAreaCodeVM sc in SystemAreaCodeList)
            //        ddlResTown.Items.Add(new ListItem(sc.AreaName, sc.ID.ToString()));

            //    ddlResTown.SelectedValue = dt.Rows[0]["ResTown"].ToString();

            //}
            tbArea.Text                  = "";
            tbPregWeek.Text              = dt.Rows[0]["PregWeek"].ToString();
            tbBirthNum.Text              = dt.Rows[0]["BirthNum"].ToString();
            tbBirthSeq.Text              = dt.Rows[0]["BirthSeq"].ToString();
            tbBirthWeight.Text           = dt.Rows[0]["BirthWeight"].ToString();
            ddlBirthPlace.SelectedValue  = dt.Rows[0]["BirthPlace"].ToString();
            ddlDeliver.SelectedValue     = dt.Rows[0]["Deliver"].ToString();
            tbDeliverOrg.Text            = dt.Rows[0]["DeliverOrg"].ToString();
            ddlMarryStatus.SelectedValue = dt.Rows[0]["MarryStatus"].ToString();

            tbEduLevel.Text   = dt.Rows[0]["EduLevel"].ToString();
            tbElemSchool.Text = dt.Rows[0]["ElemSchool"].ToString();
            tbOccupation.Text = dt.Rows[0]["Occupation"].ToString();
            tbEduLevel.Text   = dt.Rows[0]["EduLevel"].ToString();
            tbEduLevel.Text   = dt.Rows[0]["EduLevel"].ToString();

            //cmd.Parameters.AddWithValue("@TelDayArea", "03");
            //cmd.Parameters.AddWithValue("@TelDayNo", "12345678");
            //cmd.Parameters.AddWithValue("@TelDayExt", "90");
            //cmd.Parameters.AddWithValue("@TelNightArea", "03");
            //cmd.Parameters.AddWithValue("@TelNightNo", "12345678");
            //cmd.Parameters.AddWithValue("@TelNightExt", "90");

            tbResAddr.Text    = dt.Rows[0]["ResAddr"].ToString();
            tbConAddr.Text    = dt.Rows[0]["ConAddr"].ToString();
            tbBirthMulti.Text = dt.Rows[0]["BirthMulti"].ToString();



            tbTelDayArea.Text = dt.Rows[0]["TelDayArea"].ToString();
            tbTelDayNo.Text   = dt.Rows[0]["TelDayNo"].ToString();
            tbTelDayExt.Text  = dt.Rows[0]["TelDayExt"].ToString();


            tbTelNightArea.Text = dt.Rows[0]["TelNightArea"].ToString();
            tbTelNightNo.Text   = dt.Rows[0]["TelNightNo"].ToString();
            tbTelNightExt.Text  = dt.Rows[0]["TelNightExt"].ToString();

            tbImmiType.Text = SystemCode.GetName("CaseUser_ImmiType", Convert.ToInt32(dt.Rows[0]["ImmiType"]));

            ltBirthDate.Text  = dt.Rows[0]["BirthDateSimple"].ToString();
            ltIdNo.Text       = dt.Rows[0]["IdNo"].ToString();
            ltName.Text       = dt.Rows[0]["ChName"].ToString();
            ltGender.Text     = ddlGender.SelectedItem.Text;
            MainContactInival = Convert.ToString(DBUtil.DBOp("ConnDB", " select isnull((SELECT  top 1 [ContactID]  FROM [dbo].[C_CaseUserContact] where [LogicDel]=0 and  [CaseID]={0} and [IsMain]=1),0) ", new string[] { CaseID.ToString() }, NSDBUtil.CmdOpType.ExecuteScalar));


            CaseIDdiv.Controls.Add(GetControlFromTag(CaseID.ToString()));

            BindComment();
            BindContact();
            BindMobile();
            BindEmail();
        }
    }
示例#7
0
    protected void BindData()
    {
        CaseUserProfile c = new  CaseUserProfile(CaseID);


        if (c.CaseID > 0)
        {
            BirthDate.Text                = c.BirthDate;
            tbIdNo.Text                   = c.IdNo;
            tbPassportNo.Text             = c.PassportNo;
            tbResNo.Text                  = c.ResNo;
            tbOtherNo.Text                = c.OtherNo;
            tbName.Text                   = c.ChName;
            tbEngName.Text                = c.EnName;
            ddlGender.SelectedValue       = c.Gender.ToString();
            tbHouseNo.Text                = c.HouseNo;
            ddlONationality.SelectedValue = c.ONationality.ToString();

            foreach (string s in c.Language)
            {
                foreach (ListItem i in cblLang.Items)
                {
                    if (i.Value == s)
                    {
                        i.Selected = true;
                    }
                }
            }
            ;
            foreach (string s in c.Capacity)
            {
                for (int i = 1; i <= 4; i++)
                {
                    CheckBoxList cblist = (CheckBoxList)form1.FindControl("cblCapacity_" + i.ToString());
                    foreach (ListItem li in cblist.Items)
                    {
                        if (li.Value == s)
                        {
                            li.Selected = true;
                        }
                    }
                    ;
                }
            }

            CountyInival  = c.ConCounty.ToString();
            TownAry       = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetTownList(Convert.ToInt32(c.ConCounty)));
            TownInival    = c.ConTown.ToString();
            VillageAry    = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetVillageList(Convert.ToInt32(c.ConTown)));
            VillageInival = c.ConVillage.ToString();

            ResCountyInival  = c.ResCounty.ToString();
            ResTownAry       = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetTownList(Convert.ToInt32(c.ResCounty)));
            ResTownInival    = c.ResTown.ToString();
            ResVillageAry    = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetVillageList(Convert.ToInt32(c.ResTown)));
            ResVillageInival = c.ResVillage.ToString();


            tbArea.Text                  = "";
            tbPregWeek.Text              = c.PregWeek.ToString();
            tbBirthNum.Text              = c.BirthNum.ToString();
            tbBirthSeq.Text              = c.BirthSeq.ToString();
            tbBirthWeight.Text           = c.BirthWeight.ToString();
            ddlBirthPlace.SelectedValue  = c.BirthPlace.ToString();
            ddlDeliver.SelectedValue     = c.Deliver.ToString();
            tbDeliverOrg.Text            = c.DeliverOrg;
            ddlMarryStatus.SelectedValue = c.MarryStatus;

            tbEduLevel.Text   = c.EduLevel;
            tbElemSchool.Text = c.ElemSchool;
            tbOccupation.Text = c.Occupation;
            tbEduLevel.Text   = c.EduLevel;


            tbResAddr.Text = c.ResAddr;
            tbConAddr.Text = c.ConAddr;

            tbResNei.Text = (c.ResNei == 0  ? "":c.ResNei.ToString());
            tbConNei.Text = (c.ConNei == 0 ? "" : c.ConNei.ToString());

            ddlBirthMulti.SelectedValue = c.BirthMulti.ToString();


            tbTelDayArea.Text = c.TelDayArea;
            tbTelDayNo.Text   = c.TelDayNo;
            tbTelDayExt.Text  = c.TelDayExt;


            tbTelNightArea.Text = c.TelNightArea;
            tbTelNightNo.Text   = c.TelNightNo;
            tbTelNightExt.Text  = c.TelNightExt;

            tbImmiType.Text = c.ImmiTypeName;
            tbArea.Text     = c.RegionName;

            ltBirthDate.Text = c.BirthDate;
            ltIdNo.Text      = c.IdNo;
            ltName.Text      = c.ChName;
            ltGender.Text    = Server.HtmlEncode(ddlGender.SelectedItem.Text);
            ltAgeTip.Text    = c.AgeTip;
            // MainContactInival =  Convert.ToString(DBUtil.DBOp("ConnDB", " select isnull((SELECT  top 1 [ContactID]  FROM [dbo].[C_CaseUserContact] where [LogicDel]=0 and  [CaseID]={0} and [IsMain]=1),0) ", new string[] { CaseID.ToString() }, NSDBUtil.CmdOpType.ExecuteScalar));
            // MainContactInival = c.MainContactCaseID.ToString();
            MainContactInival = Convert.ToString(DBUtil.DBOp("ConnDB", " select isnull((SELECT  top 1 [ContactID]  FROM [dbo].[C_CaseUserContact] where [LogicDel]=0 and  [CaseID]={0} and [IsMain]=1),0) ", new string[] { CaseID.ToString() }, NSDBUtil.CmdOpType.ExecuteScalar));
            CaseIDdiv.Controls.Add(GetControlFromTag(CaseID.ToString()));

            string MobileFormat = "<div class=\"MobileDetail\"><input name=\"tbMobileNo_{0}\"  type=\"text\" value=\"{1}\" class=\"text03 tbMobile\" /><a onclick =\"javascript:void(0);\" class=\"DelMobile\"><img src=\"/images/icon_del.png\" /></a><a onclick =\"javascript:void(0);\" class=\"AddMobile\"><img src=\"/images/icon_increase.png\" /></a></div>";
            foreach (UserMobile um in  c.Mobiles)
            {
                MobileDIV.Controls.Add(GetControlFromTag(string.Format(MobileFormat, um.ID, um.Mobile)));
            }

            string EmailFormat = "<div class=\"EmailDetail\"><input name=\"tbEmail_{0}\"  type=\"text\" value=\"{1}\" class=\"text03 tbEmail\" /><a onclick =\"javascript:void(0);\" class=\"DelEmail\"><img src=\"/images/icon_del.png\" /></a><a onclick =\"javascript:void(0);\" class=\"AddEmail\"><img src=\"/images/icon_increase.png\" /></a></div>";

            foreach (UserEmail ue in c.Emails)
            {
                EmailDIV.Controls.Add(GetControlFromTag(string.Format(EmailFormat, ue.ID, ue.Email)));
            }



            //info
            ltCreateInfo.Text = c.CreateInfo;
            ltModifyInfo.Text = c.ModifyInfo;
            //李小明 - 衛生福利部疾病管制署 - 104/5/19 14:23:45
        }
    }