コード例 #1
0
		void BindDropDown ()
		{
			DropDownModel item;
			int cnt = 1;
			dEncounterTypelist = new List<DropDownModel> ();

			foreach (string str in ET) {
				item = new DropDownModel ();
				item.DropDownID = cnt;
				item.DropDownText = str;
				dEncounterTypelist.Add (item);
				item = null;
				cnt++;
			}

			uvMain.AddSubview (uvMainPatientinfo);
			dlPhyStatusList = new List<DropDownModel> ();
			cnt = 1;
			foreach (string str in PS) {
				item = new DropDownModel ();
				item.DropDownID = cnt;
				item.DropDownText = str;
				dlPhyStatusList.Add (item);
				item = null;
				cnt++;
			}

			DropDownViewController ddlbtn;// = new DropDownViewController (this);
			EncounterBtn.TouchUpInside += (object sender, EventArgs e) =>  {
				ddlbtn = new DropDownViewController (this);
				ddlbtn.SelectedValue=encounterTypeid;
				ddlbtn.DataSource = dEncounterTypelist;
				ddlbtn.PresentFromPopover (EncounterBtn);
				ddlbtn._Change += delegate {
					EncounterBtn.SetTitle (ddlbtn.SelectedText, UIControlState.Normal);
					encounterTypeid = ddlbtn.SelectedValue;
				};
			};

			PhysicalStatusBtn.TouchUpInside += (object sender, EventArgs e) => {
				ddlbtn = new DropDownViewController (this);
				ddlbtn.SelectedValue = physicalStatus;
				ddlbtn.DataSource = dlPhyStatusList;
				ddlbtn.PresentFromPopover (PhysicalStatusBtn);
				ddlbtn._Change += delegate {
					PhysicalStatusBtn.SetTitle (ddlbtn.SelectedText, UIControlState.Normal);
				};
			};
		}
コード例 #2
0
		void BindDropDown ()
		{
			DropDownModel item;
			int cnt = 1;
			dEncounterTypelist = new List<DropDownModel> ();

			foreach (string str in ET) {
				item = new DropDownModel ();
				item.DropDownID = cnt;
				item.DropDownText = str;
				dEncounterTypelist.Add (item);
				item = null;
				cnt++;
			}

			uvMain.AddSubview (uvMainPatientinfo);
			dlPhyStatusList = new List<DropDownModel> ();
			cnt = 1;
			foreach (string str in PS) {
				item = new DropDownModel ();
				item.DropDownID = cnt;
				item.DropDownText = str;
				dlPhyStatusList.Add (item);
				item = null;
				cnt++;
			}

			ddlPatientGenderList = new  List<DropDownModel> ();
			cnt = 1;
			foreach (string str in PatientGenderList) {
				item = new DropDownModel ();
				item.DropDownID = cnt;
				item.DropDownText = str;
				ddlPatientGenderList.Add (item);
				item = null;
				cnt++;
			}

			DropDownViewController ddlbtn;// = new DropDownViewController (this);
			EncounterBtn.TouchUpInside += (object sender, EventArgs e) =>  {
				ddlbtn = new DropDownViewController (this);
				ddlbtn.SelectedValue=encounterTypeid;
				ddlbtn.DataSource = dEncounterTypelist;
				ddlbtn.PresentFromPopover (EncounterBtn,320,250);
				ddlbtn._Change += delegate {
					EncounterBtn.SetTitle (ddlbtn.SelectedText, UIControlState.Normal);
					if(ddlbtn.SelectedText != string.Empty){
						encounterTypeid = ddlbtn.SelectedValue;
					}else{
						EncounterBtn.SetTitle ("Select", UIControlState.Normal);
						encounterTypeid = 0;
						cnt = 1;
						dEncounterTypelist.Clear();
						foreach (string str in ET) {
							item = new DropDownModel ();
							item.DropDownID = cnt;
							item.DropDownText = str;
							dEncounterTypelist.Add (item);
							item = null;
							cnt++;
						}
					}
					if(ddlbtn.SelectedText != string.Empty){
						ValidateAndUpdateProcedure("EncounterType",ddlbtn.SelectedText);
					}else{
						ValidateAndUpdateProcedure("EncounterType",string.Empty);
					}
				};
			};

			PhysicalStatusBtn.TouchUpInside += (object sender, EventArgs e) => {
				ddlbtn = new DropDownViewController (this);
				ddlbtn.SelectedValue = physicalStatus;
				ddlbtn.DataSource = dlPhyStatusList;
				ddlbtn.PresentFromPopover (PhysicalStatusBtn,320,300);
				ddlbtn._Change += delegate {
					PhysicalStatusBtn.SetTitle (ddlbtn.SelectedText, UIControlState.Normal);
					if(ddlbtn.SelectedText != string.Empty){
						physicalStatus = ddlbtn.SelectedValue;
					}else{
						PhysicalStatusBtn.SetTitle ("Select", UIControlState.Normal);
						physicalStatus = 0;
						dlPhyStatusList.Clear();
						cnt = 1;
						foreach (string str in PS) {
							item = new DropDownModel ();
							item.DropDownID = cnt;
							item.DropDownText = str;
							dlPhyStatusList.Add (item);
							item = null;
							cnt++;
						}
					}
					if(ddlbtn.SelectedText != string.Empty){
						ValidateAndUpdateProcedure("PhysicalStatus",ddlbtn.SelectedValue.ToString());
					}else{
						ValidateAndUpdateProcedure("PhysicalStatus",string.Empty);
					}
				};
			};

			uSEmergency.ValueChanged += async (object sender, EventArgs e) => {
				string SelectedValue = string.Empty;
				if (uSEmergency.On)
					SelectedValue = "1";
				else
					SelectedValue = "0";
				ValidateAndUpdateProcedure ("Emergency", SelectedValue);
			};

			btnPatientGender.TouchUpInside += (object sender, EventArgs e) => {
				
				txtpmrn.ResignFirstResponder();
				txtpFirstName.ResignFirstResponder();
				txtpLastName.ResignFirstResponder();

				ddlbtn = new DropDownViewController (this);
				ddlbtn.SelectedValue = patientGenderID;
				ddlbtn.DataSource = ddlPatientGenderList;
				ddlbtn.PresentFromPopover (btnPatientGender,300,130);
				ddlbtn._Change += delegate {
					btnPatientGender.SetTitle (ddlbtn.SelectedText, UIControlState.Normal);
					if(ddlbtn.SelectedText != string.Empty){
						patientGenderID = ddlbtn.SelectedValue;
					}else{
						btnPatientGender.SetTitle ("Select", UIControlState.Normal);
						patientGenderID = 0;
						ddlPatientGenderList.Clear();
						cnt = 1;
						foreach (string str in PatientGenderList) {
							item = new DropDownModel ();
							item.DropDownID = cnt;
							item.DropDownText = str;
							ddlPatientGenderList.Add (item);
							item = null;
							cnt++;
						}
					}
					SavePatientInfo();
				};
			};
		}
コード例 #3
0
 public void DismissPopOver(DropDownModel Item)
 {
     SelectedValue = Item.DropDownID;
     SelectedText = Item.DropDownText;
     _Change += new DropDownSelectedEvent(checkVal);
     popover.Dismiss(false);
     _Change.Invoke ();
 }