public void AddSubCatItem(iProPQRSPortableLib.Type item) { AttribType SelectedItem=SelectedAllType.Find(u=>u.ProcAttribTypeID == item.ProcAttribTypeID ); UIView uvblock=new UIView(new CoreGraphics.CGRect(0,Ycord,380,60)); UISwitch usOption=new UISwitch(new CoreGraphics.CGRect(8,10,51,31)); usOption.Tag = item.ProcAttribTypeID; if (SelectedItem != null) { usOption.On = true; SaveAttribTypeList.Add (SelectedItem); SubCattextvalue.Add(item.Label); } usOption.ValueChanged += (object sender, EventArgs e) => { AttribType additem=new AttribType(); additem.IsHighLighted=false; additem.ProcAttribTypeID= item.ProcAttribTypeID; additem.ProcID=ProcID; additem.Value=item.Label; AttribType existingitem= SelectedAllType.Find(u=>u.ProcAttribTypeID == item.ProcAttribTypeID ); if(usOption.On) { if(existingitem == null) SaveAttribTypeList.Add (additem); SubCattextvalue.Add(item.Label); } else { SubCattextvalue.Remove(item.Label); if(existingitem != null) { existingitem.Value=""; SaveAttribTypeList.Remove (existingitem); SaveAttribTypeList.Add (existingitem); } } }; UILabel lbldesc=new UILabel(new CoreGraphics.CGRect(78,10,300,50)); lbldesc.Lines = 2; lbldesc.Text = item.Label; uslist.Add (usOption); UIView uvbreackline=new UIView(new CoreGraphics.CGRect(0,60,380,1)); uvbreackline.BackgroundColor = UIColor.Gray; uvblock.Add (usOption); uvblock.Add (lbldesc); uvblock.Add (uvbreackline); usSubCatView.Add (uvblock); Ycord = Ycord + 61; usSubCatView.SizeToFit (); usSubCatView.ContentSize = new SizeF (float.Parse (usSubCatView.Frame.Width.ToString ()), float.Parse (usSubCatView.Frame.Height.ToString ()) + (float)Ycord-100 ); }
public void BindPopupover(List<iProPQRSPortableLib.Option> items,List<string> Selecteditems,UIButton btnField,int FrameY,string labelName) { int uvwidth; ATlist.Clear (); List<CodePickerModel> alist = SetTypeDataSource(items, out uvwidth); mcp = new mCodePicker(this,uvwidth); mcp.TypeOfList = "Options"; if (ATlist.Count > 0) mcp.SelectedItems = ATlist; float x = 10;//(float)btnField.Frame.X; float y = 10;//(float)btnField.Frame.Y+FrameY; mcp.PresentFromPopover(btnField, x, y,uvwidth); mcp.mDataSource(alist); mcp._ValueChanged += async delegate { ATlist = mcp.SelectedItems; string finalText = " "; List<AttribType> procalist=new List<AttribType>(); AttribType procitem; int ProcID=0; if(procedureDetails != null && procedureDetails.ID != 0) ProcID = procedureDetails.ID; foreach (var item in ATlist) { procitem = new AttribType(); procitem.ProcAttribTypeID = item.ItemID; procitem.ProcID = ProcID; procitem.Value = item.ItemCode; procitem.IsHighLighted = false; procalist.Add(procitem); procitem = null; finalText = item.ItemText; } btnField.SetTitle(finalText.Trim(),UIControlState.Normal);; foreach (var sitem in Selecteditems) { string spid = ATlist.Where(w=>w.ItemCode == sitem).Select(s=>s.ItemCode).SingleOrDefault(); if(spid == string.Empty) { procitem=new AttribType(); procitem.ProcAttribTypeID = items[0].ProcAttribTypeID; procitem.ProcID = ProcID; procitem.Value = ""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; } } if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK"){ Console.WriteLine ("Patient Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved.", null, "ok", null).Show(); }else{ new UIAlertView("Error", procAttribtsobject.message, null, "ok", null).Show(); } } if(labelName == "CVCSterileTech"){ selectedLineCVCSterileTechIds.Clear(); foreach (var item in ATlist) { selectedLineCVCSterileTechIds.Add(item.ItemCode); } } ATlist.Clear(); }; }
public void BindPopupover(List<iProPQRSPortableLib.Type> items,List<int> Selecteditems,UILabel lblField,int FrameY,string labelName) { int uvwidth; ATlist.Clear(); items.Sort((xx,yy)=> xx.Label.CompareTo(yy.Label)); List<CodePickerModel> alist = SetTypeDataSource(items, out uvwidth); mcp = new mCodePicker(this,uvwidth,alist); // need to set Selected Items if (Selecteditems != null && Selecteditems.Count > 0) { CodePickerModel sitem; foreach (var item in Selecteditems) { sitem = new CodePickerModel (); sitem.ItemText = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Types.Where(u=>u.ProcAttribTypeID==item).Select(s=>s.Label).Single(); sitem.ItemID = item; ATlist.Add (sitem); } } if (ATlist.Count > 0) mcp.SelectedItems = ATlist; // float x = (float)lblField.Frame.X; float y = (float)lblField.Frame.Y+FrameY; mcp.PresentFromPopover(lblField, x, y,uvwidth); mcp.mDataSource(alist); mcp._ValueChanged += async delegate { int ProcID=0; if(procedureDetails != null && procedureDetails.ID != 0) ProcID = procedureDetails.ID; if(mcp.SelectedItems.Count > 0){ ATlist = mcp.SelectedItems; string finalText = string.Empty; List<AttribType> procalist=new List<AttribType>(); AttribType procitem; foreach (var item in ATlist){ procitem=new AttribType(); procitem.ProcAttribTypeID=item.ItemID; procitem.ProcID=ProcID; procitem.Value = "1"; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; finalText = finalText + "," + item.ItemText; } // SetTextboxValue(mCurrentTextBoxID, finalText.TrimStart(',')); lblField.Text = finalText.TrimStart(','); int mw=MeasureTextLine(finalText); int maxheight=30; if(mw>500) { maxheight=60; lblField.Lines=2; } else if(mw> 1000) { maxheight=90; lblField.Lines=2; } CoreGraphics.CGRect fram=lblField.Frame; fram.Height=maxheight; lblField.Frame=fram; foreach (var sitem in Selecteditems) { int spid = ATlist.Where(w=>w.ItemID == sitem).Select(s=>s.ItemID).SingleOrDefault(); if(spid==0) { procitem=new AttribType(); procitem.ProcAttribTypeID=sitem; procitem.ProcID=ProcID; procitem.Value=""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; } } if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK") { Console.WriteLine("Procedure Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved.", null, "ok", null).Show(); }else{ NavigationController.PopToRootViewController(true); Console.WriteLine("Procedure Info. Save failed."); // new UIAlertView("Error", procAttribtsobject.message, null, "ok", null).Show(); } } if(labelName=="AnesthesiaTechs"){ selectedAnesTechTypesIds.Clear(); foreach (var item in ATlist) { selectedAnesTechTypesIds.Add(item.ItemID); } }else if(labelName=="NerveBlock"){ selectedNerveBlockIds.Clear(); foreach (var item in ATlist) { selectedNerveBlockIds.Add(item.ItemID); } }else if(labelName=="SpecialTechs"){ selectedSpecialTechIds.Clear(); foreach (var item in ATlist) { selectedSpecialTechIds.Add(item.ItemID); } } ATlist.Clear(); } else { List<AttribType> procalist=new List<AttribType>(); AttribType procitem; foreach (var sitem in Selecteditems) { int spid = ATlist.Where(w=>w.ItemID == sitem).Select(s=>s.ItemID).SingleOrDefault(); if(spid==0) { procitem=new AttribType(); procitem.ProcAttribTypeID=sitem; procitem.ProcID=ProcID; procitem.Value=""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; } } if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK") { Console.WriteLine("Procedure Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved.", null, "ok", null).Show(); }else{ NavigationController.PopToRootViewController(true); Console.WriteLine("Procedure Info. Save failed."); // new UIAlertView("Error", procAttribtsobject.message, null, "ok", null).Show(); } } if(labelName=="SpecialTechs") selectedSpecialTechIds.Clear(); else if(labelName=="SpecialTechs") selectedSpecialTechIds.Clear(); else if(labelName=="NerveBlock") selectedNerveBlockIds.Clear(); lblField.Text=""; } UpdateProcedureStatus (); }; }
public async void BindmultilevelPopupover(List<iProPQRSPortableLib.Type> items,List<int> Selecteditems,List<int> SelectedSubitems,UILabel lblField,int FrameY,string labelName) { AppDelegate.pb.Start(this.View,"PLease wait"); items.Find (u => u.ProcAttribTypeID == 406).Label = "MAC"; if(labelName == "AnesthesiaTechs"){ //iProPQRSPortableLib.Consts.RcvdJSONDataResult =await AppDelegate.Current.pqrsMgr.GetMACCodes(); RcvdJSONData macCodes = iProPQRSPortableLib.Consts.RcvdJSONDataResult; if (macCodes != null && macCodes.results != null) { masterlistOfMacCodes = (List<MACCodesDetails>)JsonConvert.DeserializeObject (macCodes.results.ToString (), typeof(List<MACCodesDetails>)); } } int uvwidth; ATlist.Clear(); //patientProfile List<CodePickerModel> mainsubCatList=new List<CodePickerModel>(); //patientProfile.MACCodesList if (masterlistOfMacCodes != null) { foreach (var scitem in masterlistOfMacCodes) { CodePickerModel sc = new CodePickerModel (); sc.ItemCode = scitem.Code; sc.ItemID = 0; sc.ItemText = scitem.Name; mainsubCatList.Add (sc); sc = null; } } // need to set Selected Items if (Selecteditems != null && Selecteditems.Count > 0) { CodePickerModel sitem; foreach (var item in Selecteditems) { sitem = new CodePickerModel (); sitem.ItemText = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Types.Where(u=>u.ProcAttribTypeID==item).Select(s=>s.Label).Single(); sitem.ItemID = item; ATlist.Add (sitem); } } // string subcattext=string.Empty; SelectedSubcodeitems = new List<CodePickerModel> (); checkmaccode.Clear (); if (SelectedSubitems != null && SelectedSubitems.Count > 0 && patientProfile.MACCodesList != null) { subcattext = string.Empty; selectedsubAnesTechTypesIds.Clear (); CodePickerModel sitem; foreach (var item in patientProfile.MACCodesList) { selectedsubAnesTechTypesIds.Add (item.ProcCodeID.ToString ()); if (!checkmaccode.Contains (item.Code)) { CodePickerModel sc = new CodePickerModel (); sc.ItemCode = item.Code; sc.ItemID = item.ProcCodeID; sc.ItemText = item.Name; SelectedSubcodeitems.Add (sc); subcattext = subcattext + item.Code + ","; checkmaccode.Add (item.Code); sc = null; } } if(!string.IsNullOrEmpty(subcattext)) subcattext=" ("+subcattext.TrimEnd(',')+" )"; iProPQRSPortableLib.Type typeitem = items.Where (u => u.ProcAttribTypeID == 406).SingleOrDefault (); items.Remove (typeitem); typeitem.Label ="MAC " + subcattext; items.Add (typeitem); items.Sort((xx,yy)=> xx.ProcAttribTypeID.CompareTo(yy.ProcAttribTypeID)); } List<CodePickerModel> alist = SetTypeDataSource(items, out uvwidth); uvwidth = 600; mlcp = new mlsCodePicker(this,uvwidth,alist,mainsubCatList); uvwidth = 600; if (ATlist.Count > 0) mlcp.SelectedItems = ATlist; mlcp.SelectedSubItems = SelectedSubcodeitems; float x = (float)lblField.Frame.X; float y = (float)lblField.Frame.Y+FrameY; mlcp.TypeItemID = 406; mlcp.TypeValue = null; mlcp.isMainCatMultiSelect = true; mlcp.isMultiSelect = true; mlcp.PresentFromPopover(lblField, 10, y); AppDelegate.pb.Stop (); mlcp._ValueChanged += async delegate { int ProcID=0; if(procedureDetails != null && procedureDetails.ID != 0) ProcID = procedureDetails.ID; AppDelegate.pb.Start(this.View,"PLease wait"); if(mlcp.SelectedItems.Count > 0){ ATlist = mlcp.SelectedItems; SelectedSubcodeitems=mlcp.SelectedSubItems; string finalText = string.Empty; List<AttribType> procalist=new List<AttribType>(); AttribType procitem; string txtmac=string.Empty; foreach (var item in ATlist){ procitem=new AttribType(); procitem.ProcAttribTypeID=item.ItemID; procitem.ProcID=ProcID; procitem.Value = "1"; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; if(item.ItemID != 406) finalText = finalText + ", " + item.ItemText; else txtmac="MAC"; } // SetTextboxValue(mCurrentTextBoxID, finalText.TrimStart(',')); lblField.Text = finalText.TrimStart(',').TrimEnd(','); foreach (var sitem in Selecteditems) { List<int> spid = ATlist.Where(w=>w.ItemID == sitem).Select(s=>s.ItemID).ToList(); if(spid!=null && spid.Count == 0 ) { procitem=new AttribType(); procitem.ProcAttribTypeID=sitem; procitem.ProcID=ProcID; procitem.Value=""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; } } if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK") { List<int> Subids=new List<int>(); if(labelName=="AnesthesiaTechs"){ //var SelectedSubcode=SelectedSubcodeitems.Distinct(); foreach (var id in selectedsubAnesTechTypesIds) { int proccodeid=Convert.ToInt16(id); if(proccodeid!=0) { ReceiveContext deletecontext=await AppDelegate.Current.pqrsMgr.DeleteProcedureDiagnostic(proccodeid); if (deletecontext != null && deletecontext.status != null && deletecontext.status.ToUpper () == "OK") { } } } checkmaccode.Clear(); if(txtmac !=null && txtmac != "") { foreach (var subitem in SelectedSubcodeitems){ checkmaccode.Add(subitem.ItemCode); //finalText = finalText + ", " + subitem.ItemCode; UpdateProcedureDiagnostic(0,subitem.ItemCode,subitem.ItemText,418); selectedsubAnesTechTypesIds.Add(subitem.ItemID.ToString()); } } if(!string.IsNullOrEmpty(txtmac) && checkmaccode.Count > 0) { finalText=finalText.TrimEnd(',').TrimStart(',') +", MAC (" +String.Join(", ", checkmaccode.ToArray())+")"; lblField.Text=finalText; } else if(!string.IsNullOrEmpty(txtmac)) { lblField.Text=finalText.TrimEnd(',').TrimStart(',') +" ,MAC"; } //lblField.Text = finalText.TrimStart(','); } Console.WriteLine("Procedure Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved.", null, "ok", null).Show(); }else{ NavigationController.PopToRootViewController(true); Console.WriteLine("Procedure Info. Save failed."); // new UIAlertView("Error", procAttribtsobject.message, null, "ok", null).Show(); } } if(labelName=="AnesthesiaTechs"){ selectedAnesTechTypesIds.Clear(); foreach (var item in ATlist) { selectedAnesTechTypesIds.Add(item.ItemID); } //selectedsubAnesTechTypesIds //selectedsubAnesTechTypesIds.Clear(); //foreach (var item in SelectedSubcodeitems) { //selectedsubAnesTechTypesIds.Add(item.ItemID.ToString()); //} }else if(labelName=="NerveBlock"){ selectedNerveBlockIds.Clear(); foreach (var item in ATlist) { selectedNerveBlockIds.Add(item.ItemID); } }else if(labelName=="SpecialTechs"){ selectedSpecialTechIds.Clear(); foreach (var item in ATlist) { selectedSpecialTechIds.Add(item.ItemID); } } ATlist.Clear(); } else { lblField.Text=""; List<AttribType> procalist=new List<AttribType>(); AttribType procitem; foreach (var sitem in Selecteditems) { List<int> spid = ATlist.Where(w=>w.ItemID == sitem).Select(s=>s.ItemID).ToList(); if(spid!=null && spid.Count == 0 ) { procitem=new AttribType(); procitem.ProcAttribTypeID=sitem; procitem.ProcID=ProcID; procitem.Value=""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; } } if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK") { List<int> Subids=new List<int>(); if(labelName=="AnesthesiaTechs"){ //var SelectedSubcode=SelectedSubcodeitems.Distinct(); foreach (var id in selectedsubAnesTechTypesIds) { int proccodeid=Convert.ToInt16(id); if(proccodeid!=0) { ReceiveContext deletecontext=await AppDelegate.Current.pqrsMgr.DeleteProcedureDiagnostic(proccodeid); if (deletecontext != null && deletecontext.status != null && deletecontext.status.ToUpper () == "OK") { } } } } } } selectedAnesTechTypesIds.Clear(); if(patientProfile.MACCodesList!=null) patientProfile.MACCodesList.Clear(); } iProPQRSPortableLib.Consts.SelectedProcAttribtslist = await AppDelegate.Current.pqrsMgr.GetAllAttribTypesOfAProcedure(ProcID); var rootobject = await AppDelegate.Current.pqrsMgr.GetProcedureDiagnosticMaster(ProcID); patientProfile.MACCodesList = rootobject.result.FindAll(u=> u.ProcCodeTypeID == 418); AppDelegate.pb.Stop (); lblField.Text=lblField.Text.TrimStart(',').TrimEnd(','); UpdateProcedureStatus (); }; }
List<CodePickerModel> SelectedSubcodeitems=null;//new List<CodePickerModel>(); public void BindmultilevelPopupover(List<iProPQRSPortableLib.Option> items,List<Tuple<string,string>> Selecteditems, List<int> SelectedSubitems,UILabel btnField,int FrameY,UILabel hidenval,bool isMultiSelect) { int uvwidth; int vw; ATlist.Clear (); SelectedSubcodeitems=new List<CodePickerModel>(); List<CodePickerModel> alist = SetTypeDataSource(items, out uvwidth); List<CodePickerModel> SubRootList = SetTypeDataSource(nonPqrsTypeAS10Options, out uvwidth); mlcp = new mlsCodePicker(this,uvwidth,alist,SubRootList); uvwidth = 700; if (Selecteditems != null && Selecteditems.Count > 0) { CodePickerModel sitem; if (Selecteditems != null && Selecteditems.Count > 0 && !string.IsNullOrEmpty(Selecteditems[0].Item1)) { sitem = new CodePickerModel (); sitem = alist.Where (u => u.ItemID == Convert.ToInt16 (Selecteditems[0].Item1) && u.ItemCode == Selecteditems[0].Item2).SingleOrDefault (); ATlist.Add (sitem); } } if (SelectedSubitems != null && SelectedSubitems.Count > 0) { //CodePickerModel sitem; foreach (var subitem in SelectedSubitems) { //sitem = new CodePickerModel (); var sitem= SubRootList.Where (u => u.ItemID == subitem).ToList(); if(sitem.Count >0 ) SelectedSubcodeitems.Add (sitem[0]); } } if (ATlist.Count > 0) { string finaltext = "Serious adverse event ("; if (ATlist [0]!=null && ATlist [0].ItemID == 608 && ATlist [0].ItemCode == "B" && SelectedSubcodeitems.Count > 0) { foreach (var item in SelectedSubcodeitems) { finaltext = finaltext + item.ItemText + ","; } finaltext = finaltext.TrimEnd(',') + " )"; ATlist [0].ItemText = finaltext; } mlcp.SelectedItems = ATlist; } //if(SelectedSubcodeitems.Count > 0) mlcp.SelectedSubItems = SelectedSubcodeitems; float x = 10;//(float)btnField.Frame.X; float y = 10;//(float)btnField.Frame.Y+FrameY; mlcp.TypeItemID=608; mlcp.TypeValue="B"; mlcp.isMultiSelect = isMultiSelect; mlcp.PresentFromPopover(btnField, x, y); //SubRootData mlcp._ValueChanged += async delegate { ATlist = mlcp.SelectedItems; SelectedSubcodeitems=mlcp.SelectedSubItems; string finalText = " "; List<AttribType> procalist=new List<AttribType>(); AttribType procitem; int ProcID=0; if(procedureDetails != null && procedureDetails.ID != 0) ProcID = procedureDetails.ID; foreach (var item in ATlist) { procitem = new AttribType(); procitem.ProcAttribTypeID = item.ItemID; procitem.ProcID = ProcID; procitem.Value = item.ItemCode; procitem.IsHighLighted = false; procalist.Add(procitem); procitem = null; finalText = item.ItemText; } btnField.Text=finalText.Trim(); foreach (var sitem in Selecteditems) { string spid = ATlist.Where(w=>w.ItemCode == sitem.Item1).Select(s=>s.ItemCode).SingleOrDefault(); if(spid == string.Empty) { procitem=new AttribType(); procitem.ProcAttribTypeID = items[0].ProcAttribTypeID; procitem.ProcID = ProcID; procitem.Value = ""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; } } //SelectedSubitems.Clear(); foreach (var sitem in SelectedSubcodeitems) { procitem = new AttribType(); procitem.ProcAttribTypeID = sitem.ItemID; procitem.ProcID = ProcID; procitem.Value = sitem.ItemText; procitem.IsHighLighted = false; procalist.Add(procitem); procitem = null; } List<int> removeid=new List<int>(); foreach (var rsitem in SelectedSubitems) { var removeitem = mlcp.SelectedSubItems.Where(w=>w.ItemID == rsitem).ToList(); if(removeitem == null || removeitem.Count == 0) { procitem=new AttribType(); procitem.ProcAttribTypeID = rsitem; procitem.ProcID = ProcID; procitem.Value = ""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; removeid.Add(rsitem); } } foreach (var ri in removeid) { SelectedSubitems.Remove(SelectedSubitems.Where(u=>u==ri).SingleOrDefault()); mlcp.SelectedSubItems.Remove (mlcp.SelectedSubItems.Where(u=>u.ItemID==ri).SingleOrDefault()); } //SelectedSubitems.Clear(); if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK"){ Console.WriteLine ("Patient Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved.", null, "ok", null).Show(); }else{ new UIAlertView("Error", procAttribtsobject.message, null, "ok", null).Show(); } } foreach (var item in ATlist) { hidenval.Tag=item.ItemID; hidenval.Text=item.ItemCode; } ATlist.Clear(); iProPQRSPortableLib.Consts.SelectedProcAttribtslist = await AppDelegate.Current.pqrsMgr.GetAllAttribTypesOfAProcedure(ProcID); selectednonPqrsTypeAS10OptionsIds = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll(u => (nonPqrsTypeAS10Options.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).Select(xx=>xx.ProcAttribTypeID).ToList(); }; }
public void BindmultilevelPopupover(List<iProPQRSPortableLib.Option> masterMainList,List<iProPQRSPortableLib.Option> masterSubCatList,UILabel btnField,int FrameY,UILabel hidenval,UILabel lblhidensubcatval,bool isMultiSelect,int TypeItemID,string TypeValue) { int uvwidth; int vw; ATlist.Clear (); SelectedSubcodeitems=new List<CodePickerModel>(); List<CodePickerModel> alist = SetTypeDataSource(masterMainList, out uvwidth); List<CodePickerModel> SubRootList = SetTypeDataSource(masterSubCatList, out vw); uvwidth = 800; var selectedMainListIDs = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (masterMainList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList (); if (selectedMainListIDs != null && selectedMainListIDs.Count > 0) { //ATlist = = SetTypeDataSource(masterSubCatList, out uvwidth); CodePickerModel sitem; foreach (var smid in selectedMainListIDs) { var desclist=masterMainList.Where(u=>u.ProcAttribTypeID==smid.ProcAttribTypeID && u.Value == smid.Value).ToList(); sitem = new CodePickerModel (); sitem.ItemCode = smid.Value; sitem.ItemID = smid.ProcAttribTypeID; if (desclist.Count > 0) sitem.ItemText = desclist [0].Description; ATlist.Add (sitem); } } var selectedSubCatListIDs = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll(u => (masterSubCatList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList(); if (selectedSubCatListIDs != null && selectedSubCatListIDs.Count > 0) { CodePickerModel sitem; foreach (var smid in selectedSubCatListIDs) { var desclist=masterSubCatList.Where(u=>u.ProcAttribTypeID==smid.ProcAttribTypeID && u.Value == smid.Value).ToList(); sitem = new CodePickerModel (); sitem.ItemCode = smid.Value; sitem.ItemID = smid.ProcAttribTypeID; if (desclist.Count > 0) sitem.ItemText = desclist [0].Description; SelectedSubcodeitems.Add (sitem); } } //string TypeValue = "0582F"; if (alist.Count > 0 && SelectedSubcodeitems.Count > 0) { //"0582F" List<CodePickerModel> changeitems=new List<CodePickerModel>(); foreach (var Maincatitem in alist) { //"0582F" if (Maincatitem.ItemCode == TypeValue) { TypeValue = Maincatitem.ItemCode; string finaltext =Maincatitem.ItemText+ " ("; foreach (var item in SelectedSubcodeitems) { finaltext = finaltext + item.ItemText + ","; } finaltext = finaltext.TrimEnd(',') + " )"; Maincatitem.ItemText = finaltext; changeitems.Add(Maincatitem); } } foreach (var item in changeitems) { var changeitem = alist.Where (u => u.ItemCode == item.ItemCode).ToList(); alist.Remove (changeitem[0]); alist.Add (changeitem [0]); } } //FullDescription mlcp = new mlsCodePicker(this,uvwidth,alist,SubRootList); mlcp.SelectedItems = ATlist; if(SelectedSubcodeitems.Count > 0) mlcp.SelectedSubItems = SelectedSubcodeitems; float xcord = 10;//(float)btnField.Frame.X; float ycord = 10;//(float)btnField.Frame.Y+FrameY; mlcp.TypeItemID=TypeItemID;//alist[0].ItemID; mlcp.TypeValue=TypeValue; mlcp.isMultiSelect = isMultiSelect; mlcp.PresentFromPopover(btnField, xcord, ycord); //SubRootData mlcp._ValueChanged += async delegate { ATlist = mlcp.SelectedItems; if(ATlist[0].ItemID ==TypeItemID && ATlist[0].ItemCode=="0581F" || ATlist[0].ItemCode=="A") mlcp.SelectedSubItems.Clear(); SelectedSubcodeitems=mlcp.SelectedSubItems; string finalText = " "; List<AttribType> procalist=new List<AttribType>(); AttribType procitem; int ProcID=0; if(procedureDetails != null && procedureDetails.ID != 0) ProcID = procedureDetails.ID; foreach (var item in ATlist) { procitem = new AttribType(); procitem.ProcAttribTypeID = item.ItemID; procitem.ProcID = ProcID; procitem.Value = item.ItemCode; procitem.IsHighLighted = false; procalist.Add(procitem); procitem = null; finalText = item.ItemText; } btnField.Text=finalText.Trim(); foreach (var sitem in masterMainList) { string spid = ATlist.Where(w=>w.ItemID == sitem.ProcAttribTypeID).Select(s=>s.ItemCode).SingleOrDefault(); if(spid == string.Empty) { procitem=new AttribType(); procitem.ProcAttribTypeID = masterMainList[0].ProcAttribTypeID; procitem.ProcID = ProcID; procitem.Value = ""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; } } //SelectedSubitems.Clear(); string subtitles=string.Empty; if(SelectedSubcodeitems.Count > 0) { subtitles=" ("; foreach (var sitem in SelectedSubcodeitems) { procitem = new AttribType(); procitem.ProcAttribTypeID = sitem.ItemID; procitem.ProcID = ProcID; procitem.Value = sitem.ItemCode; procitem.IsHighLighted = false; procalist.Add(procitem); procitem = null; subtitles=subtitles+sitem.ItemText +","; } subtitles=subtitles.TrimEnd(',')+")"; //0583F if( mlcp.TypeValue != "0581F") btnField.Text=btnField.Text+subtitles; } List<int> removeid=new List<int>(); foreach (var rsitem in selectedSubCatListIDs) { var removeitem = mlcp.SelectedSubItems.Where(w=>w.ItemID == rsitem.ProcAttribTypeID).ToList(); if(removeitem == null || removeitem.Count == 0) { procitem=new AttribType(); procitem.ProcAttribTypeID = rsitem.ProcAttribTypeID; procitem.ProcID = ProcID; procitem.Value = ""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; removeid.Add(rsitem.ProcAttribTypeID); } } selectedSubCatListIDs.Clear(); if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK"){ Console.WriteLine ("Patient Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved.", null, "ok", null).Show(); }else{ new UIAlertView("Error", procAttribtsobject.message, null, "ok", null).Show(); } } foreach (var item in ATlist) { hidenval.Tag=item.ItemID; hidenval.Text=item.ItemCode; } ATlist.Clear(); iProPQRSPortableLib.Consts.SelectedProcAttribtslist = await AppDelegate.Current.pqrsMgr.GetAllAttribTypesOfAProcedure(ProcID); }; }
public void BindPopupover(List<iProPQRSPortableLib.Option> items,List<Tuple<string,string>> Selecteditems,UILabel lblField,int FrameY,UILabel hidenval) { int uvwidth; ATlist.Clear (); List<CodePickerModel> alist = SetTypeDataSource(items, out uvwidth); mcp = new mCodePicker(this,uvwidth); mcp.TypeOfList = "Options"; // need to set Selected Items if (Selecteditems != null && Selecteditems.Count > 0) { CodePickerModel sitem; if (Selecteditems != null && Selecteditems.Count > 0 && !string.IsNullOrEmpty(Selecteditems[0].Item1)) { sitem = new CodePickerModel (); sitem = alist.Where (u => u.ItemID == Convert.ToInt16 (Selecteditems[0].Item1) && u.ItemCode == Selecteditems[0].Item2).SingleOrDefault (); if(sitem != null) ATlist.Add (sitem); } } if (ATlist.Count > 0) mcp.SelectedItems = ATlist; float x = (float)lblField.Frame.X; float y = (float)lblField.Frame.Y+FrameY; mcp.PresentFromPopover(lblField, x, y,uvwidth); mcp.mDataSource(alist); mcp._ValueChanged += async delegate { List<AttribType> procalist=new List<AttribType>(); AttribType procitem; int ProcID=0; if(procedureDetails != null && procedureDetails.ID != 0) ProcID = procedureDetails.ID; if(mcp.SelectedItems.Count > 0){ ATlist = mcp.SelectedItems; string finalText = " "; foreach (var sitem in Selecteditems) { if(!string.IsNullOrEmpty(sitem.Item1) && !string.IsNullOrEmpty(sitem.Item2)) { string spid = ATlist.Where( w => w.ItemID == Convert.ToInt16(sitem.Item1) && w.ItemCode == sitem.Item2).Select(s=>s.ItemCode).SingleOrDefault(); if(spid == null) { procitem=new AttribType(); procitem.ProcAttribTypeID = Convert.ToInt16(sitem.Item1); procitem.ProcID = ProcID; procitem.Value = ""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; } } } foreach (var item in ATlist) { procitem = new AttribType(); procitem.ProcAttribTypeID = item.ItemID; procitem.ProcID = ProcID; procitem.Value = item.ItemCode; procitem.IsHighLighted = false; procalist.Add(procitem); procitem = null; finalText = finalText + ", " + item.ItemText; } lblField.Text = finalText.Trim().TrimStart(','); if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK"){ Console.WriteLine("Procedure, Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved." // , null, "ok", null).Show(); }else{ Console.WriteLine("Procedure, Info. Save failed."); // new UIAlertView("Error", procAttribtsobject.message // , null, "ok", null).Show(); }// } foreach (var item in ATlist) { hidenval.Tag=item.ItemID; hidenval.Text=item.ItemCode; } ATlist.Clear(); int lbldescwidth = 40; lblField.Lines = 1; int lbltextcount = lblField.Text.Length; if (lbltextcount < 58) { lbldescwidth = 40; lblField.Lines = 1; } else if (lbltextcount > 58 && lbltextcount < 114) { lbldescwidth = 55; lblField.Lines = 2; } else if (lbltextcount > 114) { lbldescwidth = 75; lblField.Lines = 3; } lblField.Frame = new CoreGraphics.CGRect (500, 8, 480, lbldescwidth); } }; }
public void qmBindPopupover(List<iProPQRSPortableLib.Option> items,UILabel lblField,int FrameY,int AttribTypeID) { int uvwidth; ATlist.Clear (); List<CodePickerModel> alist = SetTypeDataSource(items, out uvwidth); qmcp = new qmCodePicker(this,uvwidth,alist); AttribType selectedattribtitem = new AttribType(); if (iProPQRSPortableLib.Consts.SelectedProcAttribtslist == null) selectedattribtitem = null; // need to set Selected Items else selectedattribtitem = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.Where (u => u.ProcAttribTypeID == AttribTypeID).SingleOrDefault (); if (selectedattribtitem != null ) { CodePickerModel sitem; if (selectedattribtitem != null ) { sitem = new CodePickerModel (); sitem = alist.Where (u => u.ItemID == selectedattribtitem.ProcAttribTypeID && u.ItemCode == selectedattribtitem.Value).SingleOrDefault (); if(sitem != null) ATlist.Add (sitem); } } if (ATlist.Count > 0) qmcp.SelectedItems = ATlist; float x = (float)lblField.Frame.X; float y = (float)lblField.Frame.Y+FrameY; qmcp.PresentFromPopover(lblField, x, y,uvwidth); //qmcp.mDataSource(alist); qmcp._ValueChanged += async delegate { List<AttribType> procalist=new List<AttribType>(); AttribType procitem; int ProcID=0; if(procedureDetails != null && procedureDetails.ID != 0) ProcID = procedureDetails.ID; if(qmcp.SelectedItems.Count > 0){ ATlist = qmcp.SelectedItems; string finalText = " "; if(selectedattribtitem != null) { selectedattribtitem.Value=""; procalist.Add(selectedattribtitem); } foreach (var item in ATlist) { procitem = new AttribType(); procitem.ProcAttribTypeID = item.ItemID; procitem.ProcID = ProcID; procitem.Value = item.ItemCode; procitem.IsHighLighted = false; procalist.Add(procitem); procitem = null; finalText = finalText + ", " + item.ItemText; } lblField.Text = finalText.Trim().TrimStart(','); if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK"){ UpdateProcedureStatus (); Console.WriteLine("Procedure, Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved." // , null, "ok", null).Show(); }else{ Console.WriteLine("Procedure, Info. Save failed."); // new UIAlertView("Error", procAttribtsobject.message // , null, "ok", null).Show(); }// } int lbldescwidth = 40; lblField.Lines = 1; int lbltextcount = lblField.Text.Length; if (lbltextcount < 58) { lbldescwidth = 40; lblField.Lines = 1; } else if (lbltextcount > 58 && lbltextcount < 114) { lbldescwidth = 55; lblField.Lines = 2; } else if (lbltextcount > 114) { lbldescwidth = 75; lblField.Lines = 3; } if(AttribTypeID != 602) lblField.Frame = new CoreGraphics.CGRect (500, 8, 480, lbldescwidth); } else { if(selectedattribtitem != null) { selectedattribtitem.Value=""; procalist.Add(selectedattribtitem); } if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK"){ lblField.Text = ""; if(AttribTypeID != 602) lblField.Frame = new CoreGraphics.CGRect (500, 8, 480, 40); } } } ATlist.Clear(); iProPQRSPortableLib.Consts.SelectedProcAttribtslist = await AppDelegate.Current.pqrsMgr.GetAllAttribTypesOfAProcedure(ProcID); }; }
public void BindPopupover(List<iProPQRSPortableLib.Option> items,List<string> Selecteditems,UILabel lblField,int FrameY,string labelName) { int uvwidth; ATlist.Clear (); List<CodePickerModel> alist = SetTypeDataSource(items, out uvwidth); mcp = new mCodePicker(this,uvwidth); mcp.TypeOfList = "Options"; // need to set Selected Items if (Selecteditems != null && Selecteditems.Count > 0) { CodePickerModel sitem; foreach (var item in Selecteditems) { if (item != "selected") { sitem = new CodePickerModel (); sitem.ItemText = alist.Where (u => u.ItemCode == item).Select (s => s.ItemText).Single (); sitem.ItemID = items [0].ProcAttribTypeID; //For all Options, the ProcTypeID will be same sitem.ItemCode = item; ATlist.Add (sitem); } } } if (ATlist.Count > 0) mcp.SelectedItems = ATlist; float x = (float)lblField.Frame.X; float y = (float)lblField.Frame.Y+FrameY; mcp.PresentFromPopover(lblField, x, y,uvwidth); mcp.mDataSource(alist); mcp._ValueChanged += async delegate { int ProcID=0; if(procedureDetails != null && procedureDetails.ID != 0) ProcID = procedureDetails.ID; if(mcp.SelectedItems.Count > 0){ ATlist = mcp.SelectedItems; string finalText = " "; List<AttribType> procalist=new List<AttribType>(); AttribType procitem; foreach (var item in ATlist) { procitem = new AttribType(); procitem.ProcAttribTypeID = item.ItemID; procitem.ProcID = ProcID; procitem.Value = item.ItemCode; procitem.IsHighLighted = false; procalist.Add(procitem); procitem = null; finalText = finalText + ", " + item.ItemText; } lblField.Text = finalText.Trim().TrimStart(','); foreach (var sitem in Selecteditems) { string spid = ATlist.Where(w=>w.ItemCode == sitem).Select(s=>s.ItemCode).SingleOrDefault(); if(spid == null) { procitem=new AttribType(); procitem.ProcAttribTypeID = items[0].ProcAttribTypeID; procitem.ProcID = ProcID; procitem.Value = ""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; } } if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK"){ Console.WriteLine("Procedure, " +labelName + " Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved." // , null, "ok", null).Show(); }else{ Console.WriteLine("Procedure, " +labelName + " Info. Save failed."); // new UIAlertView("Error", procAttribtsobject.message // , null, "ok", null).Show(); } } if(labelName == "CVCSterileTech"){ selectedLineCVCSterileTechIds.Clear(); foreach (var item in ATlist) { selectedLineCVCSterileTechIds.Add(item.ItemCode); } } ATlist.Clear(); } else { List<AttribType> procalist=new List<AttribType>(); AttribType procitem; foreach (var sitem in Selecteditems) { string spid = ATlist.Where(w=>w.ItemCode == sitem).Select(s=>s.ItemCode).SingleOrDefault(); if(spid == null) { procitem=new AttribType(); procitem.ProcAttribTypeID = items[0].ProcAttribTypeID; procitem.ProcID = ProcID; procitem.Value = ""; procitem.IsHighLighted=false; procalist.Add(procitem); procitem=null; } } if(procalist != null && procalist.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procalist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK"){ Console.WriteLine("Procedure, " +labelName + " Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved." // , null, "ok", null).Show(); }else{ Console.WriteLine("Procedure, " +labelName + " Info. Save failed."); // new UIAlertView("Error", procAttribtsobject.message // , null, "ok", null).Show(); } } if(labelName == "CVCSterileTech"){ selectedLineCVCSterileTechIds.Clear(); } lblField.Text=""; } }; }
private async void UpdateOtherNotes() { List<AttribType> procAttribTypelist=new List<AttribType>(); AttribType typeAttrib = new AttribType(); typeAttrib.ProcID = procedureDetails.ID; typeAttrib.ProcAttribTypeID = 655; typeAttrib.Value = txtNotes.Text; typeAttrib.IsHighLighted = false; procAttribTypelist.Add(typeAttrib); var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procAttribTypelist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK"){ UpdateProcedureStatus (); Console.WriteLine ("Procedure Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved." // , null, "ok", null).Show(); }else{ Console.WriteLine ("Procedure Info. Save failed."); // new UIAlertView("Error", procAttribtsobject.message // , null, "ok", null).Show(); } }
private async void UpdateLineType(UISwitch switchObj,iProPQRSPortableLib.Type lineTypeObj) { List<AttribType> procAttribTypelist=new List<AttribType>(); AttribType typeAttrib = new AttribType(); typeAttrib.ProcID = procedureDetails.ID; typeAttrib.ProcAttribTypeID = lineTypeObj.ProcAttribTypeID; if(switchObj.On) typeAttrib.Value = "1"; else typeAttrib.Value = ""; typeAttrib.IsHighLighted = false; procAttribTypelist.Add(typeAttrib); var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(procAttribTypelist); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK"){ UpdateProcedureStatus (); Console.WriteLine ("Procedure Info. Successfully Saved."); // new UIAlertView("Procedure Info", "Successfully Saved." // , null, "ok", null).Show(); }else{ Console.WriteLine ("Procedure Info. Save failed."); // new UIAlertView("Error", procAttribtsobject.message // , null, "ok", null).Show(); } }
public override void ViewDidLoad() { base.ViewDidLoad (); if (iProPQRSPortableLib.Consts.SelectedProcAttribtslist != null) { SelectedAllType = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result; } uvMainCat.Layer.BorderColor=UIColor.Black.CGColor; uvMainCat.Layer.BorderWidth = 1; usSubCatView.UserInteractionEnabled = false; uvSubCatView.Layer.BorderColor=UIColor.Black.CGColor; uvSubCatView.Layer.BorderWidth = 1; if (masterMainList != null && masterMainList.Count > 0) { if (masterMainList.Count > 0) { ulMCItem1.Text = masterMainList [0].Description; usMCItem1.Tag = masterMainList [0].ProcAttribTypeID; AttribType SelectedItem=SelectedAllType.Find(u=>u.ProcAttribTypeID == masterMainList [0].ProcAttribTypeID && u.Value == masterMainList [0].Value); if (SelectedItem != null) { usMCItem1.On = true; SaveAttribTypeList.Add (SelectedItem); textvalue = masterMainList [0].Description; usSubCatView.UserInteractionEnabled = false; } usMCItem1.ValueChanged += (object sender, EventArgs e) => { AttribType additem=new AttribType(); additem.IsHighLighted=false; additem.ProcAttribTypeID= masterMainList [0].ProcAttribTypeID; additem.ProcID=ProcID; additem.Value=masterMainList [0].Value; textvalue=masterMainList [0].Description; AttribType existingitem= SelectedAllType.Find(u=>u.ProcAttribTypeID == masterMainList [0].ProcAttribTypeID && u.Value == masterMainList [0].Value); if(usMCItem1.On) { SelectedMCid=(int)usMCItem1.Tag; usSubCatView.UserInteractionEnabled=false; foreach (var switchitem in uslist) { if(switchitem !=null) switchitem.On=false; } SubCattextvalue.Clear(); List<AttribType> chaneitems=new List<AttribType>(); foreach (var Saveitem in SaveAttribTypeList) { Saveitem.Value=""; chaneitems.Add(Saveitem); } SaveAttribTypeList=chaneitems; if(existingitem == null) SaveAttribTypeList.Add (additem); usMCItem2.On=false; } else { if(existingitem != null) { existingitem.Value=""; SaveAttribTypeList.Remove (existingitem); } textvalue=""; } }; } if (masterMainList.Count > 1) { ulMCItem2.Text = masterMainList [1].Description; usMCItem2.Tag = masterMainList [1].ProcAttribTypeID; AttribType SelectedItem=SelectedAllType.Find(u=>u.ProcAttribTypeID == masterMainList [1].ProcAttribTypeID && u.Value == masterMainList [1].Value); if (SelectedItem != null) { usMCItem2.On = true; SaveAttribTypeList.Add (SelectedItem); textvalue = masterMainList [1].Description; usSubCatView.UserInteractionEnabled = true; } usMCItem2.ValueChanged += (object sender, EventArgs e) => { AttribType additem=new AttribType(); additem.IsHighLighted=false; additem.ProcAttribTypeID= masterMainList [1].ProcAttribTypeID; additem.ProcID=ProcID; additem.Value=masterMainList [1].Value; textvalue=masterMainList [1].Description; AttribType existingitem= SelectedAllType.Find(u=>u.ProcAttribTypeID == masterMainList [1].ProcAttribTypeID && u.Value == masterMainList [1].Value); if(usMCItem2.On) { SelectedMCid=(int)usMCItem2.Tag; usMCItem1.On=false; if(existingitem == null) SaveAttribTypeList.Add (additem); usSubCatView.UserInteractionEnabled=true; } else { if(existingitem != null) { existingitem.Value=""; SaveAttribTypeList.Remove (existingitem); } textvalue=""; } }; } } if (masterSubCatList != null && masterSubCatList.Count > 0) { foreach (var item in masterSubCatList) { AddSubCatItem (item); } } btnCancel.TouchUpInside+= (object sender, EventArgs e) => { DismissViewController(false,null); }; brnOk.TouchUpInside += async (object sender, EventArgs e) => { List<AttribType> AttribTypelist=new List<AttribType>(); //removing duplicate records foreach (var item1 in SaveAttribTypeList) { var ci=AttribTypelist.Find(u=>u.ProcAttribTypeID==item1.ProcAttribTypeID && u.Value == item1.Value); if(ci == null) AttribTypelist.Add(item1); } //adding uniq records //var result = String.Join(", ", SubCattextvalue.ToArray()); if(SubCattextvalue.Count >0 ) lblDesc.Text=textvalue +" ("+String.Join(", ", SubCattextvalue.ToArray())+ " )"; else lblDesc.Text=textvalue; SaveAttribTypeList=AttribTypelist; SaveAttribTypeList.Sort((xx,yy)=> xx.Value.CompareTo(yy.Value)); if(SaveAttribTypeList != null && SaveAttribTypeList.Count > 0 ){ var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(SaveAttribTypeList); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK") { iProPQRSPortableLib.Consts.SelectedProcAttribtslist = await AppDelegate.Current.pqrsMgr.GetAllAttribTypesOfAProcedure(ProcID); int descwidth = 40; lblDesc.Lines = 1; int textcount = lblDesc.Text.Length; if (textcount < 58) { descwidth = 40; lblDesc.Lines = 1; } else if (textcount > 58 && textcount <= 114) { descwidth = 55; lblDesc.Lines = 2; } else if (textcount > 114) { descwidth = 75; lblDesc.Lines = 3; } lblDesc.Frame = new CoreGraphics.CGRect (500, 8, 480, descwidth); DismissViewController(false,null); } } }; // Perform any additional setup after loading the view, typically from a nib. }
public override void ViewDidLoad() { base.ViewDidLoad (); masterMainList2 = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.FindAll(x => x.ProcAttribTypeID == 1001); if (iProPQRSPortableLib.Consts.SelectedProcAttribtslist != null) { SelectedAllType = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result; SelectedmasterMainList = SelectedAllType.FindAll (u => (masterMainList.Select (z => z.ProcAttribTypeID).Contains (u.ProcAttribTypeID))); SelectedmasterMainList2 = SelectedAllType.FindAll (u => (masterMainList2.Select (z => z.ProcAttribTypeID).Contains (u.ProcAttribTypeID))); SelectedmasterSubCatList = SelectedAllType.FindAll (u => (masterSubCatList.Select (z => z.ProcAttribTypeID).Contains (u.ProcAttribTypeID))); // SelectedmasterMainList = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (masterMainList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList (); // SelectedmasterMainList2 = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (masterMainList2.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList (); // SelectedmasterSubCatList = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (masterSubCatList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList (); } //CreateCurveAndShadow (uvMainCatView); //CreateCurveAndShadow (uvSubCatView); uvMainCatView.Layer.BorderColor=UIColor.Black.CGColor; uvMainCatView.Layer.BorderWidth = 1; uvMainCatView2.Layer.BorderColor=UIColor.Black.CGColor; uvMainCatView2.Layer.BorderWidth = 1; uvSubCatView.Layer.BorderColor=UIColor.Black.CGColor; uvSubCatView.Layer.BorderWidth = 1; // usSCItem1.Enabled = false; // usSCItem2.Enabled = false; // usSCItem3.Enabled = false; if (masterMainList2 != null && masterMainList2.Count > 0) { if (masterMainList2.Count > 0) { ulMC2Item1.Text = masterMainList2 [0].Description; usMC2Item1.Tag = masterMainList2 [0].ProcAttribTypeID; if (SelectedmasterMainList2.Count > 0) { AttribType selecteditem = SelectedAllType.Find (u => u.ProcAttribTypeID == masterMainList2 [0].ProcAttribTypeID && u.Value == masterMainList2 [0].Value); if (selecteditem != null) { usMC2Item1.On = true; buttonDesc=masterMainList2 [0].Description; SaveAttribTypeList.Add (selecteditem); usMC2Item2.On=false; }else usMC2Item1.On = false; } } PrevStatususMCItem2 = usMCItem1.On; usMC2Item1.ValueChanged += (object sender, EventArgs e) => { AttribType additem=new AttribType(); additem.IsHighLighted=false; additem.ProcAttribTypeID= masterMainList2 [0].ProcAttribTypeID; additem.ProcID=ProcID; additem.Value = masterMainList2 [0].Value; buttonDesc = masterMainList2[0].Description; if(usMC2Item1.On){ List<AttribType> removeitems=new List<AttribType>(); foreach (var item in SaveAttribTypeList) { item.Value=""; removeitems.Add(item); } SaveAttribTypeList=removeitems; SaveAttribTypeList.Add(additem); usMC2Item2.On=false; PrevStatususMCItem2=usMC2Item1.On; }else{ usMC2Item2.On=false; buttonDesc=""; List<AttribType> removeitems=new List<AttribType>(); foreach (var item in SaveAttribTypeList) { item.Value=""; removeitems.Add(item); } SaveAttribTypeList=removeitems; } }; ulMC2Item2.Text = masterMainList2 [1].Description; usMC2Item2.Tag = masterMainList2 [1].ProcAttribTypeID; if (SelectedmasterMainList2.Count > 0) { AttribType selecteditem = SelectedAllType.Find (u => u.ProcAttribTypeID == masterMainList2 [1].ProcAttribTypeID && u.Value == masterMainList2 [1].Value); if (selecteditem != null) { buttonDesc = masterMainList [1].Description; usMC2Item2.On = true; SaveAttribTypeList.Add (selecteditem); } else { usMC2Item2.On = false; } } usMC2Item2.ValueChanged += (object sender, EventArgs e) => { AttribType additem=new AttribType(); additem.IsHighLighted=false; additem.ProcAttribTypeID= masterMainList2 [1].ProcAttribTypeID; additem.ProcID=ProcID; additem.Value=masterMainList2 [1].Value; buttonDesc=masterMainList2[1].Description; if(usMC2Item2.On){ usMC2Item1.On=false; MainCat2=additem; }else{ usMC2Item1.On=false; buttonDesc=""; AttribType checkmItem=SaveAttribTypeList.Find(u=>u.ProcAttribTypeID == masterMainList2 [1].ProcAttribTypeID); if(checkmItem != null){ SaveAttribTypeList.Remove(checkmItem); checkmItem.Value=""; SaveAttribTypeList.Add(checkmItem); } } }; } if (masterMainList != null && masterMainList.Count > 0) { if (masterMainList.Count > 0) { ulMCItem1.Text = masterMainList [0].Description; usMCItem1.Tag = masterMainList [0].ProcAttribTypeID; if (SelectedmasterMainList.Count > 0) { AttribType selecteditem = SelectedAllType.Find (u => u.ProcAttribTypeID == masterMainList [0].ProcAttribTypeID && u.Value == masterMainList [0].Value); if (selecteditem != null) { usMCItem1.On = true; buttonDesc=masterMainList [0].Description; SaveAttribTypeList.Add (selecteditem); usMCItem2.On=false; }else usMCItem1.On = false; } } PrevStatususMCItem1 = usMCItem1.On; usMCItem1.ValueChanged += (object sender, EventArgs e) => { AttribType additem=new AttribType(); additem.IsHighLighted=false; additem.ProcAttribTypeID= masterMainList [0].ProcAttribTypeID; additem.ProcID=ProcID; additem.Value=masterMainList [0].Value; buttonDesc=masterMainList[0].Description; if(usMCItem1.On){ //MainCat=additem; List<AttribType> removeitems=new List<AttribType>(); foreach (var item in SaveAttribTypeList) { item.Value=""; removeitems.Add(item); } SaveAttribTypeList=removeitems; SaveAttribTypeList.Add(additem); usMCItem2.On=false; PrevStatususMCItem1=usMCItem1.On; }else{ usMCItem2.On=false; buttonDesc=""; List<AttribType> removeitems=new List<AttribType>(); foreach (var item in SaveAttribTypeList) { item.Value=""; removeitems.Add(item); } SaveAttribTypeList=removeitems; } }; if (masterMainList.Count > 1) { ulMCItem2.Text = masterMainList [1].Description; usMCItem2.Tag = masterMainList [1].ProcAttribTypeID; if (SelectedmasterMainList.Count > 0) { AttribType selecteditem = SelectedAllType.Find (u => u.ProcAttribTypeID == masterMainList [1].ProcAttribTypeID && u.Value == masterMainList [1].Value); if (selecteditem != null) { buttonDesc = masterMainList [1].Description; usMCItem2.On = true; SaveAttribTypeList.Add (selecteditem); } else { usMCItem2.On = false; } } usMCItem2.ValueChanged += (object sender, EventArgs e) => { AttribType additem=new AttribType(); additem.IsHighLighted=false; additem.ProcAttribTypeID= masterMainList [1].ProcAttribTypeID; additem.ProcID=ProcID; additem.Value=masterMainList [1].Value; buttonDesc=masterMainList[1].Description; if(usMCItem2.On){ usMCItem1.On=false; MainCat=additem; }else{ usMCItem1.On=false; buttonDesc=""; AttribType checkmItem=SaveAttribTypeList.Find(u=>u.ProcAttribTypeID == masterMainList [1].ProcAttribTypeID); if(checkmItem != null){ SaveAttribTypeList.Remove(checkmItem); checkmItem.Value=""; SaveAttribTypeList.Add(checkmItem); } } }; } } //svSubCatList if (masterSubCatList != null && masterSubCatList.Count > 0) { if (masterSubCatList.Count > 0) { ulSCItem1.Text = masterSubCatList [0].Description; usSCItem1.Tag = masterSubCatList [0].ProcAttribTypeID; if (SelectedmasterSubCatList.Count > 0) { AttribType selecteditem = SelectedAllType.Find (u => u.ProcAttribTypeID == masterSubCatList [0].ProcAttribTypeID && u.Value == masterSubCatList [0].Value); if (selecteditem != null) { usSCItem1.On = true; subcatdesc=masterSubCatList [0].Description; SaveAttribTypeList.Add (selecteditem); } else usSCItem1.On = false; } } usSCItem1.ValueChanged += (object sender, EventArgs e) => { AttribType additem=new AttribType(); additem.IsHighLighted=false; additem.ProcAttribTypeID= masterSubCatList [0].ProcAttribTypeID; additem.ProcID=ProcID; additem.Value=masterSubCatList [0].Value; subcatdesc=masterSubCatList [0].Description; if(usSCItem1.On){ usSCItem2.On=false; usSCItem3.On=false; MainSubCat=additem; }else{ usSCItem2.On=false; usSCItem3.On=false; } }; if (masterSubCatList.Count > 1) { ulSCItem2.Text = masterSubCatList [1].Description; usSCItem2.Tag = masterSubCatList [1].ProcAttribTypeID; if (SelectedmasterSubCatList.Count > 0) { AttribType selecteditem = SelectedAllType.Find (u => u.ProcAttribTypeID == masterSubCatList [1].ProcAttribTypeID && u.Value == masterSubCatList [1].Value); if (selecteditem != null) { usSCItem2.On = true; subcatdesc=masterSubCatList [1].Description; SaveAttribTypeList.Add (selecteditem); } else usSCItem2.On = false; } usSCItem2.ValueChanged += (object sender, EventArgs e) => { AttribType additem=new AttribType(); additem.IsHighLighted=false; additem.ProcAttribTypeID= masterSubCatList [1].ProcAttribTypeID; additem.ProcID=ProcID; additem.Value=masterSubCatList [1].Value; subcatdesc=masterSubCatList [1].Description; if(usSCItem2.On){ usSCItem1.On=false; usSCItem3.On=false; MainSubCat=additem; }else{ usSCItem1.On=false; usSCItem3.On=false; } }; } if (masterSubCatList.Count > 2) { ulSCItem3.Text = masterSubCatList [2].Description; usSCItem3.Tag = masterSubCatList [2].ProcAttribTypeID; if (SelectedmasterSubCatList.Count > 0) { AttribType selecteditem = SelectedAllType.Find (u => u.ProcAttribTypeID == masterSubCatList [2].ProcAttribTypeID && u.Value == masterSubCatList [2].Value); if (selecteditem != null) { subcatdesc=masterSubCatList [2].Description; usSCItem3.On = true; SaveAttribTypeList.Add (selecteditem); } else usSCItem3.On = false; } usSCItem3.ValueChanged += (object sender, EventArgs e) => { AttribType additem=new AttribType(); additem.IsHighLighted=false; additem.ProcAttribTypeID= masterSubCatList [2].ProcAttribTypeID; additem.ProcID=ProcID; additem.Value=masterSubCatList [2].Value; subcatdesc=masterSubCatList [2].Description; if(usSCItem3.On){ usSCItem1.On=false; usSCItem2.On=false; MainSubCat=additem; }else{ usSCItem1.On=false; usSCItem2.On=false; } }; } } btnCancel.TouchUpInside+= (object sender, EventArgs e) => { DismissViewController(false,null); }; btnok.TouchUpInside += async (object sender, EventArgs e) => { List<AttribType> AttribTypelist=new List<AttribType>(); //removing duplicate records foreach (var item1 in SaveAttribTypeList) { var ci=AttribTypelist.Find(u=>u.ProcAttribTypeID==item1.ProcAttribTypeID && u.Value == item1.Value); if(ci == null) AttribTypelist.Add(item1); } //adding uniq records SaveAttribTypeList=AttribTypelist; btnok.Enabled=false; AttribType checkmItem=SaveAttribTypeList.Find(u=>u.ProcAttribTypeID == MainCat.ProcAttribTypeID); if(checkmItem != null){ SaveAttribTypeList.Remove(checkmItem); checkmItem.Value=""; SaveAttribTypeList.Add(checkmItem); } if(MainCat!=null && MainCat.ProcAttribTypeID != 0) SaveAttribTypeList.Add(MainCat); AttribType checkm2Item=SaveAttribTypeList.Find(u=>u.ProcAttribTypeID == MainCat2.ProcAttribTypeID); if(checkm2Item != null){ SaveAttribTypeList.Remove(checkm2Item); checkm2Item.Value=""; SaveAttribTypeList.Add(checkm2Item); } if(MainCat2!=null && MainCat2.ProcAttribTypeID != 0) SaveAttribTypeList.Add(MainCat2); AttribType checksItem=SaveAttribTypeList.Find(u=>u.ProcAttribTypeID == MainSubCat.ProcAttribTypeID); if(checksItem != null) { SaveAttribTypeList.Remove(checksItem); checksItem.Value=""; SaveAttribTypeList.Add(checksItem); } if(MainSubCat!=null && MainSubCat.ProcAttribTypeID != 0) { SaveAttribTypeList.Add(MainSubCat); buttonDesc=buttonDesc+" ("+subcatdesc+ ")"; } // if(buttonDesc != null) // lblDesc.Text=buttonDesc; SaveAttribTypeList.Sort((xx,yy)=> xx.Value.CompareTo(yy.Value)); if(SaveAttribTypeList != null && SaveAttribTypeList.Count > 0 ){ SaveAttribTypeList = SaveAttribTypeList.FindAll(u => u.Value != ""); var procAttribtsobject = await AppDelegate.Current.pqrsMgr.UpdateProcAttribs(SaveAttribTypeList); if(procAttribtsobject != null && procAttribtsobject.status != null && procAttribtsobject.status.ToUpper() == "OK") { iProPQRSPortableLib.Consts.SelectedProcAttribtslist = await AppDelegate.Current.pqrsMgr.GetAllAttribTypesOfAProcedure(ProcID); int descwidth = 40; lblDesc.Lines = 1; // int textcount = lblDesc.Text.Length; // if (textcount < 58) { // descwidth = 40; // lblDesc.Lines = 1; // } else if (textcount > 58 && textcount <= 114) { // descwidth = 55; // lblDesc.Lines = 2; // } else if (textcount > 114) { // descwidth = 75; // lblDesc.Lines = 3; // } lblDesc.Frame = new CoreGraphics.CGRect (500, 8, 480, descwidth); var SelectedmasterMainList = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (masterMainList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList (); var SelectedmasterMainList2 = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (masterMainList2.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList (); var SelectedmasterSubCatList = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (masterSubCatList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList (); foreach (var item in SelectedmasterMainList) { Option opitem = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Find (u => u.ProcAttribTypeID == item.ProcAttribTypeID && u.Value == item.Value); if (opitem != null) { lblDesc.Text = lblDesc.Text + opitem.Description + ", "; } } foreach (var item in SelectedmasterMainList2) { Option opitem = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Find (u => u.ProcAttribTypeID == item.ProcAttribTypeID && u.Value == item.Value); if (opitem != null) { lblDesc.Text = lblDesc.Text + opitem.Description + ", "; } } foreach (var item in SelectedmasterSubCatList) { Option opitem = iProPQRSPortableLib.Consts.ProcAttribTypes.result.Options.Find (u => u.ProcAttribTypeID == item.ProcAttribTypeID && u.Value == item.Value); if (opitem != null) { lblDesc.Text = lblDesc.Text + opitem.Description + ", "; } } _ValueChanged += new UpdateQualityMetricsView(checkVal); _ValueChanged.Invoke (); DismissViewController(false,null); } } }; //SelectedmasterMainList = iProPQRSPortableLib.Consts.SelectedProcAttribtslist.result.FindAll (u => (masterMainList.Select (z => z.ProcAttribTypeID)).Contains (u.ProcAttribTypeID)).ToList (); // Perform any additional setup after loading the view, typically from a nib. }
public async void AddAttribtype(nint ProcAttribTypeID,string Value) { AttribType procitem=new AttribType(); procitem.ProcAttribTypeID=(int)ProcAttribTypeID; procitem.ProcID=ProcID; procitem.Value = Value; procitem.IsHighLighted=false; procalist.Add(procitem); }