protected void ddlVisitReasonChange() { ddlVisitResult.Items.Clear(); ddlVisitResult.Items.Add(new ListItem("請選擇", "")); SystemCodeControl.ServerSelect(ref ddlVisitResult, "CaseVisit_VisitResult_Reason_" + ddlVisitReason.SelectedValue); tr_NotNeedOrReject.Visible = false; tr_PreBackDate.Visible = false; }
protected void Page_Init(object sender, EventArgs e) { if (!Page.IsPostBack) { tbVisitDate.Attributes.Add("onclick", "WdatePicker({ dateFmt: 'yyyMMdd', lang: 'zh-tw' })"); VisitDateImg.Attributes.Add("onclick", "WdatePicker({ el:'" + tbVisitDate.ClientID + "',dateFmt: 'yyyMMdd', lang: 'zh-tw' })"); tbVisitDate.Text = (DateTime.Now.Year - 1911).ToString() + DateTime.Now.ToString("MMdd"); tbPreBackDate.Attributes.Add("onclick", "WdatePicker({ dateFmt: 'yyyMMdd', lang: 'zh-tw' })"); PreBackDateImg.Attributes.Add("onclick", "WdatePicker({ el:'" + tbPreBackDate.ClientID + "',dateFmt: 'yyyMMdd', lang: 'zh-tw' })"); ddlVisitType.Items.Clear(); ddlVisitType.Items.Add(new ListItem("請選擇", "")); SystemCodeControl.ServerSelect(ref ddlVisitType, "CaseVisit_VisitType"); ddlVisitReason.Items.Clear(); ddlVisitReason.Items.Add(new ListItem("請選擇", "")); SystemCodeControl.ServerSelect(ref ddlVisitReason, "CaseVisit_VisitReason"); ddlVisitResult.Items.Clear(); ddlVisitResult.Items.Add(new ListItem("請選擇", "")); ddlVisitFileType.Items.Clear(); SystemCodeControl.ServerSelect(ref ddlVisitFileType, "CaseVisit_VisitFileType"); ddlCountry.Items.Clear(); ddlCountry.Items.Add(new ListItem("請選擇", "")); SystemCodeControl.ServerSelect(ref ddlCountry, "CaseUser_ONationality"); UserVM u = AuthServer.GetLoginUser(); tbKeyInMan.Text = u.UserName; tbVisitOrgName.Text = u.OrgName; tbKeyInMan.Enabled = false; tbVisitOrgName.Enabled = false; DataTable dt = (DataTable)DBUtil.DBOp("ConnUser" , "SELECT [ID] , [UserName] FROM [U_User] where [OrgID] = {0} " , new string[] { u.OrgID.ToString() } , NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable); ddlVisitMan.Items.Clear(); ddlVisitMan.Items.Add(new ListItem("請選擇", "")); foreach (DataRow r in dt.Rows) { ddlVisitMan.Items.Add(new ListItem(r["UserName"].ToString(), r["ID"].ToString())); } ddlVisitMan.SelectedValue = u.ID.ToString(); } }
protected void Page_Init(object sender, EventArgs e) { if (!Page.IsPostBack) { action = Request.Form["action"] ?? action; Session["RemarkAction"] = action; int.TryParse(Request.Form["CaseID"], out CaseID); Session["RemarkCaseID"] = CaseID; int.TryParse(Request.Form["RemarkID"], out RemarkID); Session["RemarkID"] = RemarkID; ddlRemarkType.Items.Add(new ListItem("請選擇", "")); SystemCodeControl.ServerSelect(ref ddlRemarkType, "CaseUser_RemarkType"); if (RemarkID != 0) { BindRemark(); } else {//defulat trFile.Attributes.Add("style", "display:none"); } } else { if (Session["RemarkAction"] != null) { action = Session["RemarkAction"].ToString(); } if (Session["RemarkCaseID"] != null) { int.TryParse(Session["RemarkCaseID"].ToString(), out CaseID); } if (Session["RemarkID"] != null) { int.TryParse(Session["RemarkID"].ToString(), out RemarkID); } } }
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", ""); } }
protected void ddlVisitResultChange(string[] Vac, DataTable dt) { string VisitResult = ddlVisitResult.SelectedValue; string VisitReason = ddlVisitReason.SelectedValue; phNotNeedOrReject.Controls.Clear(); tr_NotNeedOrReject.Visible = false; tr_PreBackDate.Visible = false; tr_Country.Visible = false; if (VisitReason == "1") { if (VisitResult == "5") { tr_PreBackDate.Visible = true; } else if (VisitResult == "6") { tr_Country.Visible = true; } else if (VisitResult == "1" || VisitResult == "2" || VisitResult == "3") { tr_NotNeedOrReject.Visible = true; if (VisitResult == "1") { ltThTitle.Text = "不需接種"; } else if (VisitResult == "2") { ltThTitle.Text = "拒絕接種"; } else if (VisitResult == "3") { ltThTitle.Text = "延後接種"; } for (int r = 0; r < Vac.Length; r++) //foreach (string v in Vac) { string v = Vac[r]; DataTable dts = (DataTable)DBUtil.DBOp("ConnDB", "SELECT '' as id,'請選擇' as VaccineCode union all SELECT VaccinIDnSeq ,VaccineCode FROM [dbo].[fn_GetVaccineCode] ({0})", new string[] { v }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable); DropDownList ddlVaccineCode = new DropDownList(); ddlVaccineCode.ID = "ddlVaccineCode_" + v; ddlVaccineCode.DataSource = dts; ddlVaccineCode.DataTextField = "VaccineCode"; ddlVaccineCode.DataValueField = "id"; ddlVaccineCode.DataBind(); RequiredFieldValidator rfv = new RequiredFieldValidator(); rfv.ID = "rfv_" + v; rfv.ControlToValidate = "ddlVaccineCode_" + v; rfv.InitialValue = ""; rfv.ErrorMessage = "*必填"; rfv.Display = ValidatorDisplay.Dynamic; rfv.ForeColor = System.Drawing.Color.Red; DropDownList ddlNotNeedOrRejectReason = new DropDownList(); ddlNotNeedOrRejectReason.ID = "ddlNotNeedOrRejectReason_" + v; ddlNotNeedOrRejectReason.Items.Add(new ListItem("請選擇", "")); SystemCodeControl.ServerSelect(ref ddlNotNeedOrRejectReason, "CaseVisit_VisitResult_NotNeedOrReject_" + ddlVisitResult.SelectedValue); RequiredFieldValidator rfvr = new RequiredFieldValidator(); rfvr.ID = "rfvr_" + v; rfvr.ControlToValidate = "ddlNotNeedOrRejectReason_" + v; rfvr.InitialValue = ""; rfvr.ErrorMessage = "*必填"; rfvr.Display = ValidatorDisplay.Dynamic; rfvr.ForeColor = System.Drawing.Color.Red; TextBox tbPrDate = new TextBox(); tbPrDate.ID = "tbPrDate_" + v; tbPrDate.Attributes.Add("onclick", "WdatePicker({ dateFmt: 'yyyMMdd', lang: 'zh-tw' })"); Image ImgPreDate = new Image(); ImgPreDate.ID = "ImgPreDate_" + v; ImgPreDate.ImageUrl = "/images/icon_calendar.png"; ImgPreDate.Attributes.Add("onclick", "WdatePicker({ el:'" + tbPrDate.ClientID + "',dateFmt: 'yyyMMdd', lang: 'zh-tw' })"); RequiredFieldValidator rfvt = new RequiredFieldValidator(); rfvt.ID = "rfvt_" + v; rfvt.ControlToValidate = "tbPrDate_" + v; rfvt.InitialValue = ""; rfvt.ErrorMessage = "*必填"; rfvt.Display = ValidatorDisplay.Dynamic; rfvt.ForeColor = System.Drawing.Color.Red; if (dt.Rows.Count > 0) { ddlVaccineCode.SelectedValue = dt.Rows[r]["VacIDnSeq"].ToString(); ddlNotNeedOrRejectReason.SelectedValue = dt.Rows[r]["VisitResultDetailID"].ToString(); tbPrDate.Text = dt.Rows[r]["PrejectDate"].ToString(); } phNotNeedOrReject.Controls.Add(ddlVaccineCode); phNotNeedOrReject.Controls.Add(rfv); if (VisitResult != "3") { phNotNeedOrReject.Controls.Add(ddlNotNeedOrRejectReason); phNotNeedOrReject.Controls.Add(rfvr); } else { phNotNeedOrReject.Controls.Add(tbPrDate); phNotNeedOrReject.Controls.Add(ImgPreDate); phNotNeedOrReject.Controls.Add(rfvt); } phNotNeedOrReject.Controls.Add(GetControlFromTag("<br/>")); } } } }
protected void dllInit() { ddlRS.Items.Add(new ListItem("請選擇", "")); SystemCodeControl.ServerSelect(ref ddlRS, "CaseUser_ContactRelationShip"); }