Exemplo n.º 1
0
    public static void Update()
    {
        SystemAreaCode.Update();

        List <SystemOrgRegionVM> Regionlist = new List <SystemOrgRegionVM>();
        DataTable dt = DB.GetDataTable("SELECT ID,[OrgID],[RegionID]  FROM [dbo].[R_RegionAndOrg]", "ConnDB");

        EntityS.FillModel(Regionlist, dt);
        SystemOrgRegion.dictOrgRegion = Regionlist.OrderBy(item => item.OrgID)
                                        .GroupBy(item => item.OrgID)
                                        .ToDictionary(IGrouping => IGrouping.Key, IGrouping => IGrouping.ToList());
        dt.Dispose();

        List <SystemOrgRegionCountyVM> Countylist = new List <SystemOrgRegionCountyVM>();

        dt = DB.GetDataTable(" SELECT [id] ,[OrgID] ,[CountyID] FROM [dbo].[R_RegionCountyAndOrg] ", "ConnDB");
        EntityS.FillModel(Countylist, dt);
        SystemOrgRegion.dictOrgCounty = Countylist.OrderBy(item => item.OrgID)
                                        .GroupBy(item => item.OrgID)
                                        .ToDictionary(IGrouping => IGrouping.Key, IGrouping => IGrouping.ToList());

        dt.Dispose();


        List <SystemRegionSettingVM> Settinglist = new List <SystemRegionSettingVM>();

        dt = DB.GetDataTable(" SELECT [RegionID] , [CountyID] ,[TownID] ,[VillageID],SettingID FROM [dbo].[R_RegionSetting] ", "ConnDB");
        EntityS.FillModel(Settinglist, dt);
        SystemOrgRegion.dictRegionSetting = Settinglist.OrderBy(item => item.RegionID)
                                            .GroupBy(item => item.RegionID)
                                            .ToDictionary(IGrouping => IGrouping.Key, IGrouping => IGrouping.ToList());

        dt.Dispose();
    }
Exemplo n.º 2
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));
        }
    }
Exemplo n.º 3
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);
    }
Exemplo n.º 4
0
    /// <summary>
    /// 轄區所屬County
    /// </summary>
    /// <param name="OrgID"></param>
    /// <returns></returns>
    public static List <SystemAreaCodeVM> GetRegionCountyList(int OrgID)
    {
        List <SystemAreaCodeVM> list = SystemAreaCode.GetCountyList();

        SystemOrgVM OrgVM = SystemOrg.GetVM(OrgID);

        //判斷是哪種level
        if (OrgVM.OrgLevel == 4)  //衛生所
        {
            List <int> RegionCountyIDs          = new List <int>();
            List <SystemOrgRegionVM> RegionList = GetOrgRegion(OrgID);

            foreach (SystemOrgRegionVM r in RegionList)
            {
                List <SystemRegionSettingVM> SettingList = GetOrgRegionSetting(r.RegionID);
                foreach (SystemRegionSettingVM s in SettingList)
                {
                    RegionCountyIDs.Add(s.CountyID);
                }
            }

            list = list.Where(ac => RegionCountyIDs.Contains(ac.ID)).ToList();
        }
        else
        if (OrgVM.OrgLevel == 3 || OrgVM.OrgLevel == 2)    //衛生局 管制中心
        {
            List <SystemOrgRegionCountyVM> CountyList = GetOrgRegionCounty(OrgID);
            List <int> RegionCountyIDs = new List <int>();
            foreach (SystemOrgRegionCountyVM rc in CountyList)
            {
                RegionCountyIDs.Add(rc.CountyID);
            }
            list = list.Where(ac => RegionCountyIDs.Contains(ac.ID)).ToList();
        }
        //level 1全部


        return(list);
    }
Exemplo n.º 5
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));
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);
        int    pgNow;
        int    pgSize;
        int    CountyID = 0;
        int    TownID   = 0;
        string BirthDateS;
        string BirthDateE;
        string CaseName;
        string CaseIdNo;
        string SearchReason;
        string SearchConditions = "";
        int    SearcResultCount = 0;
        int    IsSearch         = 0;
        int    SearchKind       = 3;


        BirthDateS = Request.Form["BirthDateS"] ?? "";
        BirthDateE = Request.Form["BirthDateE"] ?? "";
        if (BirthDateS != "")
        {
            try
            {
                //BirthDateS = Convert.ToDateTime(BirthDateS).ToString("yyyyMMdd");
                BirthDateS = TaiwanYear.ToDateTime(BirthDateS).ToString("yyyyMMdd");
            }
            catch {
                BirthDateS = "";
            }
        }
        if (BirthDateE != "")
        {
            try
            {
                // BirthDateE = Convert.ToDateTime(BirthDateE).ToString("yyyyMMdd");
                BirthDateE = TaiwanYear.ToDateTime(BirthDateE).ToString("yyyyMMdd");
            }
            catch
            {
                BirthDateE = "";
            }
        }

        CaseName = Request.Form["CaseName"] ?? "";
        CaseIdNo = Request.Form["CaseIdNo"] ?? "";


        int.TryParse(Request.Form["pgNow"], out pgNow);
        int.TryParse(Request.Form["pgSize"], out pgSize);
        int.TryParse(Request.Form["CountyID"], out CountyID);
        int.TryParse(Request.Form["TownID"], out TownID);
        int.TryParse(Request.Form["IsSearch"], out IsSearch);
        SearchReason = Request.Form["SearchReason"] ?? "";


        List <UserProfileListVM> list = new List <UserProfileListVM>();
        PageVM  rtn = new PageVM();
        DataSet ds  = new DataSet();


        try
        {
            using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
            {
                using (SqlCommand cmd = new SqlCommand("dbo.usp_CaseUser_xGetUserList", sc))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@pgNow", pgNow == 0 ? 1 : pgNow);
                    cmd.Parameters.AddWithValue("@pgSize", pgSize == 0 ? 10 : pgSize);
                    cmd.Parameters.AddWithValue("@BirthDateS", BirthDateS);
                    cmd.Parameters.AddWithValue("@BirthDateE", BirthDateE);
                    cmd.Parameters.AddWithValue("@CaseName", CaseName);
                    cmd.Parameters.AddWithValue("@CaseIdNo", CaseIdNo);
                    cmd.Parameters.AddWithValue("@CountyID", CountyID);
                    cmd.Parameters.AddWithValue("@TownID", TownID);
                    //cmd.Parameters.AddWithValue("@IsSearch", IsSearch);
                    //cmd.Parameters.AddWithValue("@SearchReason", SearchReason);

                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        sc.Open();
                        da.Fill(ds);
                    }
                }
            }

            SearcResultCount = Convert.ToInt32(ds.Tables[1].Rows[0][0]);

            EntityS.FillModel(list, ds.Tables[0]);
            EntityS.FillModel(rtn, ds.Tables[1]);
        }
        catch
        {
        }
        finally {
            //記下查詢紀錄

            if (IsSearch == 1)
            {
                if (CaseName != "")
                {
                    SearchConditions += "姓名:" + CaseName;
                }
                if (CaseIdNo != "")
                {
                    SearchConditions += "身份證號:" + CaseIdNo;
                }
                if (BirthDateS != "")
                {
                    SearchConditions += "生日起日:" + BirthDateS;
                }
                if (BirthDateE != "")
                {
                    SearchConditions += "生日迄日:" + BirthDateE;
                }
                if (CountyID != 0)
                {
                    SearchConditions += "戶籍縣市:" + SystemAreaCode.GetName(CountyID);
                }
                if (TownID != 0)
                {
                    SearchConditions += "戶籍鄉鎮:" + SystemAreaCode.GetName(TownID);
                }

                Session["SearchID"] = Convert.ToInt32(DBUtil.DBOp("ConnDB", " exec [dbo].[usp_CaseUser_xAddSearchLog] {0}, {1}, {2} ,{3} ,{4}", new string[] { AuthServer.GetLoginUser().ID.ToString(), SearchConditions, SearchReason, SearcResultCount.ToString(), SearchKind.ToString() }, NSDBUtil.CmdOpType.ExecuteScalar));
            }
        }
        rtn.message = list;

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
Exemplo n.º 7
0
    protected void CompareCaseUser()
    {
        string Col = "";

        if (Session["ModifiedCaseToCheck"] != null)
        {
            //欲修改資料
            m = (CaseUserProfile)Session["ModifiedCaseToCheck"];
            //原資料
            c = new CaseUserProfile(m.CaseID);


            foreach (PropertyInfo prop in c.GetType().GetProperties())
            {
                string ValBefore = Convert.ToString(GetProperty(c, prop.Name));
                string ValAfter  = Convert.ToString(GetProperty(m, prop.Name));
                if (ValBefore != ValAfter)
                {
                    Col += prop.Name + ",";
                }
                //取得有變動的屬性
            }
            #region MyRegion


            //if (m.BirthDate != c.BirthDate) Col += GetPropertyName(() => c.BirthDate) + ",";
            //if (m.IdNo != c.IdNo) Col += GetPropertyName(() => c.IdNo) + ",";
            //if (m.PassportNo != c.PassportNo) Col += GetPropertyName(() => c.PassportNo) + ",";
            //if (m.ResNo != c.ResNo) Col += GetPropertyName(() => c.ResNo) + ",";
            //if (m.ChName != c.ChName) Col += GetPropertyName(() => c.ChName) + ",";
            //if (m.Gender != c.Gender) Col += GetPropertyName(() => c.Gender) + ",";
            //if (m.HouseNo != c.HouseNo) Col += GetPropertyName(() => c.HouseNo) + ",";
            //if (m.ResCounty != c.ResCounty) Col += GetPropertyName(() => c.ResCounty) + ",";
            //if (m.ResTown != c.ResTown) Col += GetPropertyName(() => c.ResTown) + ",";
            //if (m.PregWeek != c.PregWeek) Col += GetPropertyName(() => c.PregWeek) + ",";
            //if (m.BirthNum != c.BirthNum) Col += GetPropertyName(() => c.BirthNum) + ",";
            //if (m.BirthSeq != c.BirthSeq) Col += GetPropertyName(() => c.BirthSeq) + ",";
            //if (m.BirthWeight != c.BirthWeight) Col += GetPropertyName(() => c.BirthWeight) + ",";
            //if (m.BirthPlace != c.BirthPlace) Col += GetPropertyName(() => c.BirthPlace) + ",";
            //if (m.Deliver != c.Deliver) Col += GetPropertyName(() => c.Deliver) + ",";
            //if (m.DeliverOrg != c.DeliverOrg) Col += GetPropertyName(() => c.DeliverOrg) + ",";
            //if (m.MarryStatus != c.MarryStatus) Col += GetPropertyName(() => c.MarryStatus) + ",";
            //if (m.ResVillage != c.ResVillage) Col += GetPropertyName(() => c.ResVillage) + ",";
            //if (m.ResAddr != c.ResAddr) Col += GetPropertyName(() => c.ResAddr) + ",";
            //if (m.ResNei != (c.ResNei == "0" ? "" : c.ResNei)) Col += GetPropertyName(() => c.ResNei) + ",";
            //if (m.EnName != c.EnName) Col += GetPropertyName(() => c.EnName) + ",";
            //if (m.OtherNo != c.OtherNo) Col += GetPropertyName(() => c.OtherNo) + ",";
            #endregion
            //這些欄位需要上傳file


            //再去看哪些需要 uploadfile



            if (Col != "")
            {
                #region 再去看哪些需要 uploadfile
                DataTable dt = (DataTable)DBUtil.DBOp("ConnDB"
                                                      , " SELECT NiisFieldName ,  ID, FieldDiscription, FileToCheck,SystemCodeKey  FROM   C_CaseCheck_FieldCheck where NiisFieldName in (select data from dbo.fn_slip_str({0},',') ) "
                                                      , new string[] { Col }
                                                      , NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable);


                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow r in dt.Rows)
                    {
                        string ViewBefore    = Convert.ToString(GetProperty(c, r["NiisFieldName"].ToString()));
                        string ViewAfter     = Convert.ToString(GetProperty(m, r["NiisFieldName"].ToString()));
                        string ValBefore     = Convert.ToString(GetProperty(c, r["NiisFieldName"].ToString()));
                        string ValAfter      = Convert.ToString(GetProperty(m, r["NiisFieldName"].ToString()));
                        string SystemCodeKey = r["SystemCodeKey"].ToString();

                        if (SystemCodeKey != "")
                        {
                            if (SystemCodeKey.Contains("County") || SystemCodeKey.Contains("Town") || SystemCodeKey.Contains("Village"))
                            {
                                ViewBefore = SystemAreaCode.GetName(Convert.ToInt32(Convert.ToString(GetProperty(c, r["NiisFieldName"].ToString()))));
                                ViewAfter  = SystemAreaCode.GetName(Convert.ToInt32(Convert.ToString(GetProperty(m, r["NiisFieldName"].ToString()))));
                            }
                            else
                            {
                                int iViewBefore = 0;
                                int.TryParse(Convert.ToString(GetProperty(c, r["NiisFieldName"].ToString())), out iViewBefore);
                                int iViewAfter = 0;
                                int.TryParse(Convert.ToString(GetProperty(m, r["NiisFieldName"].ToString())), out iViewAfter);

                                ViewBefore = SystemCode.GetName(r["SystemCodeKey"].ToString(), iViewBefore);
                                ViewAfter  = SystemCode.GetName(r["SystemCodeKey"].ToString(), iViewAfter);
                            }
                        }

                        CheckFieldVM cf = new CheckFieldVM();
                        cf.ID               = Convert.ToInt32(r["ID"]);
                        cf.FieldName        = r["NiisFieldName"].ToString();
                        cf.FieldDiscription = r["FieldDiscription"].ToString();
                        cf.ValBefore        = ValBefore;
                        cf.ValAfter         = ValAfter;
                        cf.ViewBefore       = ViewBefore;
                        cf.ViewAfter        = ViewAfter;
                        cf.FileCheck        = r["FileToCheck"].ToString();
                        CheckFieldVMList.Add(cf);
                        //變成一個list 之後好操作
                    }
                }
                #endregion
            }
        }


        if (Col == "" || CheckFieldVMList.Count == 0)
        {
            Response.Redirect("UserProfileList.aspx");
        }
    }
Exemplo n.º 8
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));
        }
    }
Exemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //long Process_MemoryStart = 0;
        //long Process_MemoryEnd = 0;
        //System.Diagnostics.Process MyProcess = System.Diagnostics.Process.GetCurrentProcess();
        //Process_MemoryStart = MyProcess.PrivateMemorySize64;

        //Response.Write(Process_MemoryStart);
        //Console.WriteLine(Process_MemoryStart);

        //Console.WriteLine(GC.GetTotalMemory(true).ToString());

        SystemCode.Update();
        SystemRole.Update();
        SystemRoleOrg.Update();
        SystemAreaCode.Update();


        //Process_MemoryEnd = MyProcess.PrivateMemorySize64;
        //Response.Write(Process_MemoryEnd);
        //Console.WriteLine(Process_MemoryEnd);
        //HomeUrlVM vm =new HomeUrlVM();
        //vm.PageUrl = "/System/CodeM/CodeSetting.aspx";
        //vm.date = DateTime.Now;
        //string s = JsonConvert.SerializeObject(vm);
        //s=QueryStringEncryptToolS.Encrypt(s);
        //s = HttpUtility.UrlEncode(s);
        //Response.Write(s);
        //Response.End();

        //HomeUrlSecret secret = new HomeUrlSecret();
        //secret.RedirectUrl = "Home";

        //string s=JsonConvert.SerializeObject(secret);

        //UrlParameterEncryptT EncryptT = new UrlParameterEncryptT();
        //UrlParameterDecryptT DecryptT = new UrlParameterDecryptT();

        //s = EncryptT.GetOutSecretJsonWithEncrypt(secret);
        //string ss = s;
        //int cc = s.Length;
        //Response.Write(s);
        //Response.Write("<br/>");
        //Response.Write(s.Length);
        //s = HttpUtility.UrlEncode(s);
        //Response.Write("<br/>");
        //Response.Write(s);
        //Response.Write("<br/>");
        //Response.Write(s.Length);
        //Response.Write("<br/>");
        //string a = Request["o"]??"";
        //int b = 0;
        //int.TryParse(Request["c"] ?? "0", out b);
        //HomeUrlSecret secret2 = new HomeUrlSecret();
        //secret2 = DecryptT.GetUrlSecret<HomeUrlSecret>(ss, TimeSpan.FromDays(1), cc);
        //if(secret2.IsValid==true)
        //    Response.Write("2Checksum驗證成功");
        //else
        //    Response.Write("2Checksum驗證失敗");
        //Response.End();
    }
Exemplo n.º 11
0
    public CaseUserProfile(int CaseUserID) : base()
    {
        DataTable dt = (DataTable)DBUtil.DBOp("ConnDB",
                                              "dbo.usp_CaseUser_xGetCaseUserWithMother {0}",
                                              new string[] { CaseUserID.ToString() },
                                              NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable);

        SystemCode.Update();
        SystemAreaCode.Update();

        if (dt.Rows.Count > 0)
        {
            CaseID       = CaseUserID;
            BirthDate    = dt.Rows[0]["BirthDateSimple"].ToString();
            IdNo         = dt.Rows[0]["IdNo"].ToString();
            PassportNo   = dt.Rows[0]["PassportNo"].ToString();
            ResNo        = dt.Rows[0]["ResNo"].ToString();
            OtherNo      = dt.Rows[0]["OtherNo"].ToString();
            Name         = dt.Rows[0]["ChName"].ToString();
            EngName      = dt.Rows[0]["EnName"].ToString();
            Gender       = dt.Rows[0]["Gender"].ToString();
            GenderName   = SystemCode.GetName("CaseUser_Gender", Convert.ToInt32(Gender));
            HouseNo      = dt.Rows[0]["HouseNo"].ToString();
            ONationality = dt.Rows[0]["ONationality"].ToString();

            Language = dt.Rows[0]["Language"].ToString().Split(',');
            foreach (string s in Language)
            {
                if (s != "")
                {
                    LanguageName += SystemCode.GetName("CaseUser_Language", Convert.ToInt32(s)) + ",";
                }
            }

            LanguageName = (LanguageName != null ? LanguageName.TrimEnd(',') :"");

            Capacity = dt.Rows[0]["Capacity"].ToString().Split(',');
            foreach (string s in Capacity)
            {
                if (s != "")
                {
                    CapacityName += SystemCode.GetName("CaseUser_Capacity", Convert.ToInt32(s)) + ",";
                }
            }
            CapacityName = (CapacityName != null ? CapacityName.TrimEnd(',') : "");

            ConCounty = dt.Rows[0]["ConCounty"].ToString();
            if (ConCounty != "")
            {
                ConCountyName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ConCounty"]));
            }

            ConTown = dt.Rows[0]["ConTown"].ToString();
            if (ConTown != "")
            {
                ConTownName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ConTown"]));
            }

            ConVillage = dt.Rows[0]["ConVillage"].ToString();
            if (ConVillage != "")
            {
                ConVillageName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ConVillage"]));
            }

            ConAddr = dt.Rows[0]["ConAddr"].ToString();

            ResCounty = dt.Rows[0]["ResCounty"].ToString();
            if (ResCounty != "")
            {
                ConCountyName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ResCounty"]));
            }

            ResTown = dt.Rows[0]["ResTown"].ToString();
            if (ResTown != "")
            {
                ResTownName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ResTown"]));
            }

            ResVillage = dt.Rows[0]["ResVillage"].ToString();
            if (ResVillage != "")
            {
                ResVillageName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ResVillage"]));
            }

            ResAddr = dt.Rows[0]["ResAddr"].ToString();

            MotherName      = dt.Rows[0]["MotherName"].ToString();
            MotherIdNo      = dt.Rows[0]["MotherIdNo"].ToString();
            MotherBirthDate = dt.Rows[0]["MotherBirthDateSimple"].ToString();



            // PregWeek = dt.Rows[0]["PregWeek"].ToString();
            // BirthNum = dt.Rows[0]["BirthNum"].ToString();
            // BirthSeq = dt.Rows[0]["BirthSeq"].ToString();
            //BirthWeight  = dt.Rows[0]["BirthWeight"].ToString();
            //BirthPlace = dt.Rows[0]["BirthPlace"].ToString();
            // Deliver  = dt.Rows[0]["Deliver"].ToString();
            //  DeliverOrg = dt.Rows[0]["DeliverOrg"].ToString();
            //  MarryStatus  = dt.Rows[0]["MarryStatus"].ToString();

            //  EduLevel = dt.Rows[0]["EduLevel"].ToString();
            //  ElemSchool = dt.Rows[0]["ElemSchool"].ToString();
            //Occupation = dt.Rows[0]["Occupation"].ToString();
            // EduLevel = dt.Rows[0]["EduLevel"].ToString();
            //EduLevel = dt.Rows[0]["EduLevel"].ToString();

            //  ResAddr  = dt.Rows[0]["ResAddr"].ToString();

            //  BirthMulti = dt.Rows[0]["BirthMulti"].ToString();
        }
    }
Exemplo n.º 12
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();
        }
    }
Exemplo n.º 13
0
    protected void Page_Init(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            BirthDate.Attributes.Add("onclick", "WdatePicker({ dateFmt: 'yyyMMdd', lang: 'zh-tw' })");
            BirthDateImg.Attributes.Add("onclick", "WdatePicker({ el:'" + BirthDate.ClientID + "',dateFmt: 'yyyMMdd', lang: 'zh-tw' })");

            //  SystemCode.UpdateSystemCode();
            if (SystemCode.dict.ContainsKey("CaseUser_ONationality"))
            {
                List <SystemCodeVM> SystemCodeList = SystemCode.dict["CaseUser_ONationality"];

                foreach (SystemCodeVM sc in SystemCodeList)
                {
                    ddlONationality.Items.Add(new ListItem(sc.EnumName, sc.EnumValue.ToString()));
                }
            }

            if (SystemCode.dict.ContainsKey("CaseUser_Language"))
            {
                List <SystemCodeVM> SystemCodeList = SystemCode.dict["CaseUser_Language"];

                foreach (SystemCodeVM sc in SystemCodeList)
                {
                    cblLang.Items.Add(new ListItem(sc.EnumName, sc.EnumValue.ToString()));
                }
            }

            if (SystemCode.dict.ContainsKey("CaseUser_Capacity"))
            {
                List <SystemCodeVM> SystemCodeList = SystemCode.dict["CaseUser_Capacity"];

                foreach (SystemCodeVM sc in SystemCodeList)
                {
                    cblCapacity.Items.Add(new ListItem(sc.EnumName, sc.EnumValue.ToString()));
                }
            }


            // SystemAreaCode.Update();


            #region 戶籍地址
            //ddlResCounty.Items.Add(new ListItem("請選擇縣市", "0"));
            //ddlResCounty.Enabled = false;
            //ddlResTown.Items.Add(new ListItem("鄉鎮市區", "0"));
            //ddlResTown.Enabled = false;
            //ddlResVillage.Items.Add(new ListItem("村里", "0"));
            //ddlResVillage.Enabled = false;
            #endregion
            #region 聯絡地址

            CountyAry = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetCountyList());
            //  List<SystemAreaCodeVM> CityList = SystemAreaCode.GetCountyList();
            ddlConCounty.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlConCounty.Attributes.Add("ng-change", "SelectConCountyChange()");
            ddlConCounty.Attributes.Add("ng-model", "VM.SelectCounty");
            ddlConCounty.Attributes.Add("class", "ConCounty");
            ddlConCounty.Items[0].Attributes.Add("ng-repeat", "option in VM.CountyAry");
            //    foreach (SystemAreaCodeVM sc in CityList) ddlConCounty.Items.Add(new ListItem(sc.AreaName, sc.ID.ToString()));


            ddlConTown.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlConTown.Attributes.Add("class", "ConTown");
            ddlConTown.Attributes.Add("ng-change", "SelectConTownChange()");
            ddlConTown.Attributes.Add("ng-model", "VM.SelectTown");
            ddlConTown.Items[0].Attributes.Add("ng-repeat", "option in VM.TownAry");

            ddlConVillage.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlConVillage.Attributes.Add("class", "ConVillage");
            ddlConVillage.Attributes.Add("ng-model", "VM.SelectVillage");
            ddlConVillage.Items[0].Attributes.Add("ng-repeat", "option in VM.VillageAry");
            #endregion

            #region 戶籍地址


            ResCountyAry = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetCountyList());
            ddlResCounty.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlResCounty.Attributes.Add("ng-change", "SelectResCountyChange()");
            ddlResCounty.Attributes.Add("ng-model", "VM.SelectResCounty");
            ddlResCounty.Attributes.Add("class", "ResCounty");
            ddlResCounty.Items[0].Attributes.Add("ng-repeat", "option in VM.ResCountyAry");


            ddlResTown.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlResTown.Attributes.Add("class", "ResTown");
            ddlResTown.Attributes.Add("ng-change", "SelectResTownChange()");
            ddlResTown.Attributes.Add("ng-model", "VM.SelectResTown");
            ddlResTown.Items[0].Attributes.Add("ng-repeat", "option in VM.ResTownAry");

            ddlResVillage.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlResVillage.Attributes.Add("class", "ResVillage");
            ddlResVillage.Attributes.Add("ng-model", "VM.SelectResVillage");
            ddlResVillage.Items[0].Attributes.Add("ng-repeat", "option in VM.ResVillageAry");
            #endregion
        }
    }
Exemplo n.º 14
0
    protected void SetAttr(DataTable dt)
    {
        if (dt.Rows.Count > 0)
        {
            int iGender, iONationality, iImmiType
            , iConCounty, iConTown, iConVillage, iConNei
            , iResCounty, iResTown, iResVillage, iResNei
            , iPregWeek, iBirthNum, iBirthSeq, iBirthWeight
            , iBirthPlace, iDeliver, iBirthMulti
            , iRegionID, iMainContactCaseID;



            CaseID     = Convert.ToInt32(dt.Rows[0]["CaseID"]);
            BirthDate  = dt.Rows[0]["BirthDateSimple"].ToString();
            IdNo       = dt.Rows[0]["IdNo"].ToString();
            PassportNo = dt.Rows[0]["PassportNo"].ToString();
            ResNo      = dt.Rows[0]["ResNo"].ToString();
            OtherNo    = dt.Rows[0]["OtherNo"].ToString();
            ChName     = dt.Rows[0]["ChName"].ToString();
            EnName     = dt.Rows[0]["EnName"].ToString();
            HouseNo    = dt.Rows[0]["HouseNo"].ToString();
            Language   = dt.Rows[0]["Language"].ToString().Split(',');
            foreach (string s in Language)
            {
                if (s != "")
                {
                    LanguageName += SystemCode.GetName("CaseUser_Language", Convert.ToInt32(s)) + ",";
                }
            }

            LanguageName = (LanguageName != null ? LanguageName.TrimEnd(',') : "");

            Capacity = dt.Rows[0]["Capacity"].ToString().Split(',');
            foreach (string s in Capacity)
            {
                if (s != "")
                {
                    CapacityName += SystemCode.GetName("CaseUser_Capacity", Convert.ToInt32(s)) + ",";
                }
            }
            CapacityName = (CapacityName != null ? CapacityName.TrimEnd(',') : "");



            TelDayArea   = dt.Rows[0]["TelDayArea"].ToString();
            TelDayNo     = dt.Rows[0]["TelDayNo"].ToString();
            TelDayExt    = dt.Rows[0]["TelDayExt"].ToString();
            TelNightArea = dt.Rows[0]["TelNightArea"].ToString();
            TelNightNo   = dt.Rows[0]["TelNightNo"].ToString();
            TelNightExt  = dt.Rows[0]["TelNightExt"].ToString();
            ConAddr      = dt.Rows[0]["ConAddr"].ToString();
            ResAddr      = dt.Rows[0]["ResAddr"].ToString();

            DeliverOrg  = dt.Rows[0]["DeliverOrg"].ToString();
            MarryStatus = dt.Rows[0]["MarryStatus"].ToString();
            ElemSchool  = dt.Rows[0]["ElemSchool"].ToString();
            Occupation  = dt.Rows[0]["Occupation"].ToString();
            EduLevel    = dt.Rows[0]["EduLevel"].ToString();

            BirthPlaceOther = dt.Rows[0]["BirthPlaceOther"].ToString();

            int.TryParse(dt.Rows[0]["ONationality"].ToString(), out iONationality);
            int.TryParse(dt.Rows[0]["ImmiType"].ToString(), out iImmiType);
            int.TryParse(dt.Rows[0]["Gender"].ToString(), out iGender);

            int.TryParse(dt.Rows[0]["ConCounty"].ToString(), out iConCounty);
            int.TryParse(dt.Rows[0]["ConTown"].ToString(), out iConTown);
            int.TryParse(dt.Rows[0]["ConVillage"].ToString(), out iConVillage);
            int.TryParse(dt.Rows[0]["ConNei"].ToString(), out iConNei);

            int.TryParse(dt.Rows[0]["ResCounty"].ToString(), out iResCounty);
            int.TryParse(dt.Rows[0]["ResTown"].ToString(), out iResTown);
            int.TryParse(dt.Rows[0]["ResVillage"].ToString(), out iResVillage);
            int.TryParse(dt.Rows[0]["ResNei"].ToString(), out iResNei);

            int.TryParse(dt.Rows[0]["PregWeek"].ToString(), out iPregWeek);
            int.TryParse(dt.Rows[0]["BirthNum"].ToString(), out iBirthNum);
            int.TryParse(dt.Rows[0]["BirthSeq"].ToString(), out iBirthSeq);
            int.TryParse(dt.Rows[0]["BirthWeight"].ToString(), out iBirthWeight);
            int.TryParse(dt.Rows[0]["BirthPlace"].ToString(), out iBirthPlace);
            int.TryParse(dt.Rows[0]["Deliver"].ToString(), out iDeliver);
            int.TryParse(dt.Rows[0]["BirthMulti"].ToString(), out iBirthMulti);
            int.TryParse(dt.Rows[0]["RegionID"].ToString(), out iRegionID);
            int.TryParse(dt.Rows[0]["MainContactID"].ToString(), out iMainContactCaseID);


            ONationality = iONationality;
            ImmiType     = iImmiType;
            Gender       = iGender;

            ConCounty  = iConCounty;
            ConTown    = iConTown;
            ConVillage = iConVillage;
            ConNei     = iConNei;

            ResCounty  = iResCounty;
            ResTown    = iResTown;
            ResVillage = iResVillage;
            ResNei     = iResNei;


            PregWeek          = iPregWeek;
            BirthNum          = iBirthNum;
            BirthSeq          = iBirthSeq;
            BirthWeight       = iBirthWeight;
            BirthPlace        = iBirthPlace;
            Deliver           = iDeliver;
            BirthMulti        = iBirthMulti;
            RegionID          = iRegionID;
            MainContactCaseID = iMainContactCaseID;

            //    RegionName = dt.Rows[0]["RegionName"].ToString();
            // SystemRegion.Update();
            RegionName     = SystemRegion.GetName(RegionID);
            ImmiTypeName   = SystemCode.GetName("CaseUser_ImmiType", ImmiType);
            GenderName     = SystemCode.GetName("CaseUser_Gender", Gender);
            ConCountyName  = SystemAreaCode.GetName(ConCounty);
            ConTownName    = SystemAreaCode.GetName(ConTown);
            ConVillageName = SystemAreaCode.GetName(ConVillage);
            ResCountyName  = SystemAreaCode.GetName(ResCounty);
            ResTownName    = SystemAreaCode.GetName(ResTown);
            ResVillageName = SystemAreaCode.GetName(ResVillage);



            if (dt.Columns.Contains("CreateInfo"))
            {
                CreateInfo = dt.Rows[0]["CreateInfo"].ToString();
            }
            if (dt.Columns.Contains("ModifyInfo"))
            {
                ModifyInfo = dt.Rows[0]["ModifyInfo"].ToString();
            }



            if (dt.Columns.Contains("MotherName"))
            {
                MotherName = dt.Rows[0]["MotherName"].ToString();
            }
            if (dt.Columns.Contains("MotherIdNo"))
            {
                MotherIdNo = dt.Rows[0]["MotherIdNo"].ToString();
            }
            if (dt.Columns.Contains("MotherBirthDateSimple"))
            {
                MotherBirthDate = dt.Rows[0]["MotherBirthDateSimple"].ToString();
            }



            GetMobiles();
            GetEmails();



            try
            {
                AgeCalculatorT AgeCal = new AgeCalculatorT();
                DateTime       b      = new DateTime();
                DateTime.TryParse(dt.Rows[0]["BirthDate"].ToString(), out b);
                AgeTip = AgeCal.GetAge(b);
            }
            catch
            {
            }
        }
    }
Exemplo n.º 15
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
        }
    }
Exemplo n.º 16
0
    protected void Page_Init(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            int.TryParse(Request.Form["i"], out CaseID);


            BirthDate.Attributes.Add("onclick", "WdatePicker({ dateFmt: 'yyyMMdd', lang: 'zh-tw' })");
            BirthDateImg.Attributes.Add("onclick", "WdatePicker({ el:'" + BirthDate.ClientID + "',dateFmt: 'yyyMMdd', lang: 'zh-tw' })");
            SystemCodeControl.ServerSelect(ref ddlONationality, "CaseUser_ONationality");
            SystemCodeControl.ServerCheckBox(ref cblLang, "CaseUser_Language");
            cblLang.Attributes.Add("style", "display:inline-block;");
            SystemCodeControl.ServerSelect(ref ddlBirthMulti, "CaseUser_BirthMulti");
            SystemCodeControl.ServerSelect(ref ddlGender, "CaseUser_Gender");


            //身份別有4種
            DataTable CapDt = (DataTable)DBUtil.DBOp("ConnDB", "SELECT [ID] ,[CapacityCate] ,[TypeName] ,[bCanEdit]  FROM [dbo].[C_CaseUserCapacity_Type] order by [CapacityCate] ,[ID]", new string[] { }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable);


            foreach (DataRow r in CapDt.Rows)
            {
                CheckBoxList cblist = (CheckBoxList)form1.FindControl("cblCapacity_" + r["CapacityCate"].ToString());
                ListItem     li     = new ListItem(r["TypeName"].ToString(), r["ID"].ToString());
                li.Enabled = Convert.ToBoolean(r["bCanEdit"]);

                if (li.Enabled || CaseID > 0)
                {
                    cblist.Items.Add(li);
                }



                if (cblist.Items.Count > 0 || CaseID > 0)
                {
                    form1.FindControl("tr_cblCapacity_" + r["CapacityCate"].ToString()).Visible = true;
                }
            }


            #region 聯絡地址

            CountyAry = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetCountyList());

            ddlConCounty.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlConCounty.Attributes.Add("ng-change", "SelectConCountyChange()");
            ddlConCounty.Attributes.Add("ng-model", "VM.SelectCounty");
            ddlConCounty.Attributes.Add("class", "ConCounty");
            ddlConCounty.Items[0].Attributes.Add("ng-repeat", "option in VM.CountyAry");


            ddlConTown.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlConTown.Attributes.Add("class", "ConTown");
            ddlConTown.Attributes.Add("ng-change", "SelectConTownChange()");
            ddlConTown.Attributes.Add("ng-model", "VM.SelectTown");
            ddlConTown.Items[0].Attributes.Add("ng-repeat", "option in VM.TownAry");

            ddlConVillage.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlConVillage.Attributes.Add("class", "ConVillage");
            ddlConVillage.Attributes.Add("ng-model", "VM.SelectVillage");
            ddlConVillage.Items[0].Attributes.Add("ng-repeat", "option in VM.VillageAry");
            #endregion

            #region 戶籍地址


            ResCountyAry = Newtonsoft.Json.JsonConvert.SerializeObject(SystemAreaCode.GetCountyList());
            ddlResCounty.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlResCounty.Attributes.Add("ng-change", "SelectResCountyChange()");
            ddlResCounty.Attributes.Add("ng-model", "VM.SelectResCounty");
            ddlResCounty.Attributes.Add("class", "ResCounty");
            ddlResCounty.Items[0].Attributes.Add("ng-repeat", "option in VM.ResCountyAry");


            ddlResTown.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlResTown.Attributes.Add("class", "ResTown");
            ddlResTown.Attributes.Add("ng-change", "SelectResTownChange()");
            ddlResTown.Attributes.Add("ng-model", "VM.SelectResTown");
            ddlResTown.Items[0].Attributes.Add("ng-repeat", "option in VM.ResTownAry");

            ddlResVillage.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            ddlResVillage.Attributes.Add("class", "ResVillage");
            ddlResVillage.Attributes.Add("ng-model", "VM.SelectResVillage");
            ddlResVillage.Items[0].Attributes.Add("ng-repeat", "option in VM.ResVillageAry");
            #endregion



            ddlMainContact.Items.Add(new ListItem("{{option.N}}", "{{option.I}}"));
            //ddlMainContact.Attributes.Add("ng-change", "SelectConCountyChange()");
            ddlMainContact.Attributes.Add("ng-model", "VM.SelectMainContact");
            ddlMainContact.Attributes.Add("class", "SelectMainContact");
            ddlMainContact.Items[0].Attributes.Add("ng-repeat", "option in VM.MainContactAry");
            // ddlMainContact.Items[0].Attributes.Add("selected", "{{ option.S == '1' ? 'selected' : '' }}");

            //ltDDLCommentKind.Text = HtmlSelect("","ddlCommentKind", "CaseUser_RemarkType", "");
        }
    }