Example #1
0
        ///<summary>Returns Color.White if no match found.</summary>
        public static Color GetColor(DefCat myCat, long myDefNum)
        {
            //No need to check RemotingRole; no call to db.
            Def def = Defs.GetDefsForCategory(myCat).LastOrDefault(x => x.DefNum == myDefNum);

            return(def == null ? Color.White : def.ItemColor);
        }
		///<summary>Must check security before allowing this window to open.</summary>
		public FormDefinitions(DefCat selectedCat){
			InitializeComponent();// Required for Windows Form Designer support
			SelectedCat=(int)selectedCat;
			tbDefs.CellDoubleClicked += new OpenDental.ContrTable.CellEventHandler(tbDefs_CellDoubleClicked);
			tbDefs.CellClicked += new OpenDental.ContrTable.CellEventHandler(tbDefs_CellClicked);
			Lan.F(this);
		}
Example #3
0
 ///<summary>Returns true if this category has definitions that can be hidden and we want to disallow hiding all definitions.</summary>
 public static bool IsHidable(DefCat category)
 {
     if (category == DefCat.AdjTypes ||
         category == DefCat.ApptConfirmed ||
         category == DefCat.ApptProcsQuickAdd ||
         category == DefCat.BillingTypes ||
         category == DefCat.BlockoutTypes ||
         category == DefCat.ClaimPaymentGroups ||
         category == DefCat.ClaimPaymentTracking
         //|| category==DefCat.ClinicSpecialty //ClinicSpecialties can be hidden and we want to allow users to hide ALL specialties if they so desire.
         || category == DefCat.CommLogTypes ||
         category == DefCat.ContactCategories ||
         category == DefCat.Diagnosis ||
         category == DefCat.ImageCats ||
         category == DefCat.InsuranceFilingCodeGroup ||
         category == DefCat.LetterMergeCats ||
         category == DefCat.PaymentTypes ||
         category == DefCat.PaySplitUnearnedType ||
         category == DefCat.ProcButtonCats ||
         category == DefCat.ProcCodeCats ||
         category == DefCat.Prognosis ||
         category == DefCat.ProviderSpecialties ||
         category == DefCat.RecallUnschedStatus ||
         category == DefCat.TaskPriorities ||
         category == DefCat.TxPriorities)
     {
         return(true);
     }
     return(false);
 }
Example #4
0
        ///<summary>Returns the named def.  If it can't find the name, then it returns the first def in the category.</summary>
        public static long GetByExactNameNeverZero(DefCat myCat, string itemName)
        {
            //No need to check RemotingRole; no call to db.
            List <Def> listDefs = Defs.GetDefsForCategory(myCat);
            Def        def;

            //We have been getting bug submissions from customers where listDefs will be null (e.g. DefCat.ProviderSpecialties cat itemName "General")
            //Therefore, we should check for null or and entirely empty category first before looking for a match.
            if (listDefs == null || listDefs.Count == 0)
            {
                //There are no defs for the category passed in, create one because this method should never return zero.
                def           = new Def();
                def.Category  = myCat;
                def.ItemOrder = 0;
                def.ItemName  = itemName;
                Defs.Insert(def);
                Defs.RefreshCache();
                return(def.DefNum);
            }
            //From this point on, we know our list of definitions contains at least one def.
            def = listDefs.FirstOrDefault(x => x.ItemName == itemName);
            if (def != null)
            {
                return(def.DefNum);
            }
            //Couldn't find a match so return the first definition from our list as a last resort.
            return(listDefs[0].DefNum);
        }
Example #5
0
        public static void DeleteAllForCategory(DefCat defCat)
        {
            string command = $"DELETE FROM definition WHERE Category={POut.Int((int)defCat)}";

            DataCore.NonQ(command);
            Defs.RefreshCache();
        }
Example #6
0
        ///<summary>Returns empty string if no match found.</summary>
        public static string GetValue(DefCat myCat, long myDefNum)
        {
            //No need to check RemotingRole; no call to db.
            Def def = Defs.GetDefsForCategory(myCat).LastOrDefault(x => x.DefNum == myDefNum);

            return(def == null ? "" : def.ItemValue);
        }
Example #7
0
        ///<summary></summary>
        public static bool GetHidden(DefCat myCat, long myDefNum)
        {
            //No need to check RemotingRole; no call to db.
            Def def = GetDef(myCat, myDefNum);

            return(def == null ? false : def.IsHidden);
        }
Example #8
0
        ///<summary>Throws an exception if there are no definitions in the category provided.  This is to preserve old behavior.</summary>
        public static Def GetFirstForCategory(DefCat defCat, bool isShort = false)
        {
            //No need to check RemotingRole; no call to db.
            List <Def> listDefs = GetDefsForCategory(defCat, isShort);

            return(listDefs.First());
        }
Example #9
0
        ///<summary>Returns definitions that are associated to the defCat, fKey, and defLinkType passed in.</summary>
        public static List <Def> GetDefsByDefLinkFKey(DefCat defCat, long fKey, DefLinkType defLinkType)
        {
            //No need to check RemotingRole; no call to db.
            List <DefLink> listDefLinks = DefLinks.GetDefLinksByType(defLinkType).FindAll(x => x.FKey == fKey);

            return(Defs.GetDefs(defCat, listDefLinks.Select(x => x.DefNum).Distinct().ToList()));
        }
Example #10
0
 ///<summary>Must check security before allowing this window to open.</summary>
 public FormDefinitions(DefCat selectedCat)
 {
     InitializeComponent();            // Required for Windows Form Designer support
     SelectedCat = (int)selectedCat;
     tbDefs.CellDoubleClicked += new OpenDental.ContrTable.CellEventHandler(tbDefs_CellDoubleClicked);
     tbDefs.CellClicked       += new OpenDental.ContrTable.CellEventHandler(tbDefs_CellClicked);
     Lan.F(this);
 }
Example #11
0
		///<summary>Get one def from Long.  Returns null if not found.  Only used for very limited situations.  Other Get functions tend to be much more useful since they don't return null.  There is also BIG potential for silent bugs if you use this.ItemOrder instead of GetOrder().</summary>
		public static Def GetDef(DefCat myCat,long myDefNum) {
			for(int i=0;i<DefC.Long[(int)myCat].GetLength(0);i++) {
				if(DefC.Long[(int)myCat][i].DefNum==myDefNum) {
					return DefC.Long[(int)myCat][i].Copy();
				}
			}
			return null;
		}
Example #12
0
 /// <summary></summary>
 public MultInputItem(string promptingText, FieldValueType valueType, ArrayList currentValues, EnumType enumerationType, DefCat defCategory, ReportFKType fKType)
 {
     PromptingText   = promptingText;
     ValueType       = valueType;
     CurrentValues   = currentValues;
     EnumerationType = enumerationType;
     DefCategory     = defCategory;
     FKType          = fKType;
 }
Example #13
0
 /// <summary></summary>
 public MultInputItem(string promptingText,FieldValueType valueType,ArrayList currentValues,EnumType enumerationType,DefCat defCategory,ReportFKType fKType)
 {
     PromptingText=promptingText;
     ValueType=valueType;
     CurrentValues=currentValues;
     EnumerationType=enumerationType;
     DefCategory=defCategory;
     FKType=fKType;
 }
Example #14
0
        public static List <Def> GetDefsNoCache(DefCat defCat)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <Def> >(MethodBase.GetCurrentMethod(), defCat));
            }
            string command = "SELECT * FROM definition WHERE Category = " + POut.Int((int)defCat);

            return(Crud.DefCrud.SelectMany(command));
        }
Example #15
0
 public DefCatOptions(DefCat defCat, bool canDelete = false, bool canEditName = true, bool canHide = true, bool enableColor = false, bool enableValue = false,
                      bool isValidDefNum            = false)
 {
     DefCat        = defCat;
     CanDelete     = canDelete;
     CanEditName   = canEditName;
     CanHide       = canHide;
     EnableColor   = enableColor;
     EnableValue   = enableValue;
     IsValueDefNum = isValidDefNum;
 }
Example #16
0
        ///<summary>Pass in a list of all defs to save from making deep copies of the cache if you are going to call this method repeatedly.</summary>
        public static string GetName(DefCat myCat, long myDefNum, List <Def> listDefs = null)
        {
            //No need to check RemotingRole; no call to db.
            if (myDefNum == 0)
            {
                return("");
            }
            Def def = GetDef(myCat, myDefNum, listDefs);

            return(def == null ? "" : def.ItemName);
        }
Example #17
0
 ///<summary>Get one def from Long.  Returns null if not found.  Only used for very limited situations.  Other Get functions tend to be much more useful since they don't return null.  There is also BIG potential for silent bugs if you use this.ItemOrder instead of GetOrder().</summary>
 public static Def GetDef(DefCat myCat, long myDefNum)
 {
     for (int i = 0; i < DefC.Long[(int)myCat].GetLength(0); i++)
     {
         if (DefC.Long[(int)myCat][i].DefNum == myDefNum)
         {
             return(DefC.Long[(int)myCat][i].Copy());
         }
     }
     return(null);
 }
Example #18
0
 ///<summary></summary>
 public static bool GetHidden(DefCat myCat, long myDefNum)
 {
     for (int i = 0; i < DefC.Long[(int)myCat].GetLength(0); i++)
     {
         if (DefC.Long[(int)myCat][i].DefNum == myDefNum)
         {
             return(DefC.Long[(int)myCat][i].IsHidden);
         }
     }
     return(false);
 }
Example #19
0
        ///<summary></summary>
        public static Def CreateDefinition(DefCat category, string itemName, string itemValue = "", Color itemColor = new Color())
        {
            Def def = new Def();

            def.Category  = category;
            def.ItemColor = itemColor;
            def.ItemName  = itemName;
            def.ItemValue = itemValue;
            Defs.Insert(def);
            return(def);
        }
Example #20
0
 ///<summary>Overload for ValueKind ForeignKey.</summary>
 public ParameterField(string thisName, FieldValueType thisValueType, ArrayList theseDefaultValues, string thisPromptingText, string thisSnippet, ReportFKType thisReportFKType)
 {
     name            = thisName;
     valueType       = thisValueType;
     defaultValues   = theseDefaultValues;
     promptingText   = thisPromptingText;
     snippet         = thisSnippet;
     enumerationType = EnumType.ApptStatus;       //arbitrary
     defCategory     = DefCat.AccountColors;      //arbitrary
     fKeyType        = thisReportFKType;
 }
Example #21
0
		///<summary>Returns 0 if it can't find the named def.  If the name is blank, then it returns the first def in the category.</summary>
		public static long GetByExactName(DefCat myCat,string itemName) {
			if(itemName=="") {
				return DefC.Long[(int)myCat][0].DefNum;//return the first one in the list
			}
			for(int i=0;i<DefC.Long[(int)myCat].GetLength(0);i++) {
				if(DefC.Long[(int)myCat][i].ItemName==itemName) {
					return DefC.Long[(int)myCat][i].DefNum;
				}
			}
			return 0;
		}
Example #22
0
		///<summary></summary>
		public static string GetName(DefCat myCat,long myDefNum) {
			if(myDefNum==0){
				return "";
			}
			for(int i=0;i<DefC.Long[(int)myCat].GetLength(0);i++) {
				if(DefC.Long[(int)myCat][i].DefNum==myDefNum) {
					return DefC.Long[(int)myCat][i].ItemName;
				}
			}
			return "";
		}
Example #23
0
 ///<summary>This is how parameters are generally added.  The currentValues and outputValue will be determined during the Report.SubmitQuery call.</summary>
 public ParameterField(string thisName,FieldValueType thisValueType,object thisDefaultValue,string thisPromptingText,string thisSnippet)
 {
     name=thisName;
     valueType=thisValueType;
     defaultValues=new ArrayList();
     defaultValues.Add(thisDefaultValue);
     promptingText=thisPromptingText;
     snippet=thisSnippet;
     enumerationType=EnumType.ApptStatus;//arbitrary
     defCategory=DefCat.AccountColors;//arbitrary
     fKeyType=ReportFKType.None;
 }
Example #24
0
 ///<summary>This is how parameters are generally added.  The currentValues and outputValue will be determined during the Report.SubmitQuery call.</summary>
 public ParameterField(string thisName, FieldValueType thisValueType, object thisDefaultValue, string thisPromptingText, string thisSnippet)
 {
     name          = thisName;
     valueType     = thisValueType;
     defaultValues = new ArrayList();
     defaultValues.Add(thisDefaultValue);
     promptingText   = thisPromptingText;
     snippet         = thisSnippet;
     enumerationType = EnumType.ApptStatus;       //arbitrary
     defCategory     = DefCat.AccountColors;      //arbitrary
     fKeyType        = ReportFKType.None;
 }
Example #25
0
 ///<summary>Gets the order of the def within Short or -1 if not found.</summary>
 public static int GetOrder(DefCat myCat, long myDefNum)
 {
     //gets the index in the list of unhidden (the Short list).
     for (int i = 0; i < DefC.Short[(int)myCat].GetLength(0); i++)
     {
         if (DefC.Short[(int)myCat][i].DefNum == myDefNum)
         {
             return(i);
         }
     }
     return(-1);
 }
 ///<summary>Passing in a list of Defs will make those defs pre-selected and highlighted when this window loads.  For AutoNoteCategories this is
 ///used to select a parent category for the current category, but we want to prevent an infinite loop so defNumCur is used to exclude the
 ///currently selected def and any direct-line descendants from being selected as the category's parent.</summary>
 public FormDefinitionPicker(DefCat cat, List <Def> listDefs = null, long defNumCur = 0)
 {
     InitializeComponent();
     Lan.F(this);
     if (listDefs != null)
     {
         ListSelectedDefs = listDefs;               //initially, selected defs and list defs are the same. However, ListSelectedDefs changes while _listDefInitial doesn't.
         _listDefInitial  = new List <Def>(listDefs);
     }
     gridMain.Title = cat.ToString();
     FillListDefs(cat, defNumCur);
 }
Example #27
0
        ///<summary></summary>
        public static string GetValue(DefCat myCat, long myDefNum)
        {
            string retStr = "";

            for (int i = 0; i < DefC.Long[(int)myCat].GetLength(0); i++)
            {
                if (DefC.Long[(int)myCat][i].DefNum == myDefNum)
                {
                    retStr = DefC.Long[(int)myCat][i].ItemValue;
                }
            }
            return(retStr);
        }
Example #28
0
        ///<summary></summary>
        public static Color GetColor(DefCat myCat, long myDefNum)
        {
            Color retCol = Color.White;

            for (int i = 0; i < DefC.Long[(int)myCat].GetLength(0); i++)
            {
                if (DefC.Long[(int)myCat][i].DefNum == myDefNum)
                {
                    retCol = DefC.Long[(int)myCat][i].ItemColor;
                }
            }
            return(retCol);
        }
Example #29
0
        ///<summary>Returns 0 if it can't find the named def.  If the name is blank, then it returns the first def in the category.</summary>
        public static long GetByExactName(DefCat myCat, string itemName)
        {
            //No need to check RemotingRole; no call to db.
            List <Def> listDefs = Defs.GetDefsForCategory(myCat);

            //jsalmon - The following line doesn't make much sense because the def list could be empty but this is preserving old behavior...
            if (itemName == "")
            {
                return(listDefs[0].DefNum);               //return the first one in the list
            }
            Def def = listDefs.FirstOrDefault(x => x.ItemName == itemName);

            return(def == null ? 0 : def.DefNum);
        }
Example #30
0
 ///<summary>Returns 0 if it can't find the named def.  If the name is blank, then it returns the first def in the category.</summary>
 public static long GetByExactName(DefCat myCat, string itemName)
 {
     if (itemName == "")
     {
         return(DefC.Long[(int)myCat][0].DefNum);               //return the first one in the list
     }
     for (int i = 0; i < DefC.Long[(int)myCat].GetLength(0); i++)
     {
         if (DefC.Long[(int)myCat][i].ItemName == itemName)
         {
             return(DefC.Long[(int)myCat][i].DefNum);
         }
     }
     return(0);
 }
Example #31
0
 ///<summary></summary>
 public static string GetName(DefCat myCat, long myDefNum)
 {
     if (myDefNum == 0)
     {
         return("");
     }
     for (int i = 0; i < DefC.Long[(int)myCat].GetLength(0); i++)
     {
         if (DefC.Long[(int)myCat][i].DefNum == myDefNum)
         {
             return(DefC.Long[(int)myCat][i].ItemName);
         }
     }
     return("");
 }
Example #32
0
 ///<summary></summary>
 public static string GetName(DefCat myCat, int myDefNum)
 {
     if (myDefNum == 0)
     {
         return("");
     }
     if (Long == null)
     {
         Refresh();
     }
     for (int i = 0; i < Long[(int)myCat].GetLength(0); i++)
     {
         if (Long[(int)myCat][i].DefNum == myDefNum)
         {
             return(Long[(int)myCat][i].ItemName);
         }
     }
     return("");
 }
        ///<summary>Fills local list from cache and removes any that should not be available to select given the currently selected DefNum.  Used to
        ///prevent infinite loop error if a descendant category is made the parent of an ancestor.  The currently selected Def and any direct-line
        ///descendants are removed from the list so they cannot be selected as the current def's parent.
        ///If defNumCur is 0 or invalid, returns Defs.GetListLong.</summary>
        private void FillListDefs(DefCat cat, long defNumCur)
        {
            _listDefs = Defs.GetDefsForCategory(cat);
            Def defCur = _listDefs.FirstOrDefault(x => x.DefNum == defNumCur);

            if (defCur == null)           //either defNumCur is 0 or it is an invalid DefNum, either way nothing to exclude
            {
                return;
            }
            List <long> listInvalidNums = new List <long>()
            {
                defCur.DefNum
            };

            for (int i = 0; i < listInvalidNums.Count; i++)
            {
                string defNumStr = listInvalidNums[i].ToString();
                listInvalidNums.AddRange(_listDefs.FindAll(x => x.ItemValue == defNumStr).Select(x => x.DefNum));
            }
            _listDefs.RemoveAll(x => listInvalidNums.Contains(x.DefNum));
        }
Example #34
0
 ///<summary>Returns the named def.  If it can't find the name, then it returns the first def in the category.</summary>
 public static long GetByExactNameNeverZero(DefCat myCat, string itemName)
 {
     if (itemName == "")
     {
         return(DefC.Long[(int)myCat][0].DefNum);               //return the first one in the list
     }
     for (int i = 0; i < DefC.Long[(int)myCat].GetLength(0); i++)
     {
         if (DefC.Long[(int)myCat][i].ItemName == itemName)
         {
             return(DefC.Long[(int)myCat][i].DefNum);
         }
     }
     if (DefC.Long[(int)myCat].Length == 0)
     {
         Def def = new Def();
         def.Category  = myCat;
         def.ItemOrder = 0;
         def.ItemName  = itemName;
         Defs.Insert(def);
         Defs.RefreshCache();
     }
     return(DefC.Long[(int)myCat][0].DefNum);           //return the first one in the list
 }
Example #35
0
File: DefC.cs Project: mnisl/OD
		///<summary></summary>
		public static bool GetHidden(DefCat myCat,long myDefNum) {
			Def[][] arrayDefs=GetArrayLong();
			for(int i=0;i<arrayDefs[(int)myCat].GetLength(0);i++) {
				if(arrayDefs[(int)myCat][i].DefNum==myDefNum) {
					return arrayDefs[(int)myCat][i].IsHidden;
				}
			}
			return false;
		}
Example #36
0
File: DefC.cs Project: mnisl/OD
		///<summary></summary>
		public static Color GetColor(DefCat myCat,long myDefNum) {
			Color retCol=Color.White;
			Def[][] arrayDefs=GetArrayLong();
			for(int i=0;i<arrayDefs[(int)myCat].GetLength(0);i++) {
				if(arrayDefs[(int)myCat][i].DefNum==myDefNum) {
					retCol=arrayDefs[(int)myCat][i].ItemColor;
				}
			}
			return retCol;
		}
Example #37
0
File: DefC.cs Project: mnisl/OD
		///<summary>Returns the named def.  If it can't find the name, then it returns the first def in the category.</summary>
		public static long GetByExactNameNeverZero(DefCat myCat,string itemName) {
			Def[][] arrayDefs=GetArrayLong();
			if(itemName=="") {
				return arrayDefs[(int)myCat][0].DefNum;//return the first one in the list
			}
			for(int i=0;i<arrayDefs[(int)myCat].GetLength(0);i++) {
				if(arrayDefs[(int)myCat][i].ItemName==itemName) {
					return arrayDefs[(int)myCat][i].DefNum;
				}
			}
			if(arrayDefs[(int)myCat].Length==0) {
				Def def=new Def();
				def.Category=myCat;
				def.ItemOrder=0;
				def.ItemName=itemName;
				Defs.Insert(def);
				Defs.RefreshCache();
			}
			Def[][] arrayDefsUpdated=GetArrayLong();//The cache could have changed by this point.  Grab it again just in case.
			return arrayDefsUpdated[(int)myCat][0].DefNum;//return the first one in the list
		}
Example #38
0
 ///<summary>Gets a list of defs for one category.</summary>
 public static Def[] GetList(DefCat defCat)
 {
     return(Short[(int)defCat]);
 }
Example #39
0
		///<summary></summary>
		public void AddInputItem(string myPromptingText,FieldValueType myValueType,ArrayList myCurrentValues,EnumType myEnumerationType,DefCat myDefCategory,ReportFKType myFKType){
			MultInput2.AddInputItem(myPromptingText,myValueType,myCurrentValues,myEnumerationType,myDefCategory,myFKType);
		}
Example #40
0
		/// <summary></summary>
		public void AddInputItem(string promptingText,FieldValueType valueType,ArrayList currentValues,EnumType enumerationType,DefCat defCategory,ReportFKType fKType){
			multInputItems.Add(new MultInputItem(promptingText,valueType,currentValues,enumerationType,defCategory,fKType));
		}
Example #41
0
 ///<summary></summary>
 public static bool GetHidden(DefCat myCat,long myDefNum)
 {
     for(int i=0;i<DefC.Long[(int)myCat].GetLength(0);i++) {
         if(DefC.Long[(int)myCat][i].DefNum==myDefNum) {
             return DefC.Long[(int)myCat][i].IsHidden;
         }
     }
     return false;
 }
Example #42
0
 ///<summary></summary>
 public static Color GetColor(DefCat myCat,long myDefNum)
 {
     Color retCol=Color.White;
     for(int i=0;i<DefC.Long[(int)myCat].GetLength(0);i++) {
         if(DefC.Long[(int)myCat][i].DefNum==myDefNum) {
             retCol=DefC.Long[(int)myCat][i].ItemColor;
         }
     }
     return retCol;
 }
Example #43
0
File: DefC.cs Project: mnisl/OD
		///<summary></summary>
		public static string GetValue(DefCat myCat,long myDefNum) {
			string retStr="";
			Def[][] arrayDefs=GetArrayLong();
			for(int i=0;i<arrayDefs[(int)myCat].GetLength(0);i++) {
				if(arrayDefs[(int)myCat][i].DefNum==myDefNum) {
					retStr=arrayDefs[(int)myCat][i].ItemValue;
				}
			}
			return retStr;
		}
Example #44
0
        /// <summary>Overload for ValueKind defCat.</summary>
        public void AddParameter(string myName,FieldValueType myValueType
			,ArrayList myDefaultValues,string myPromptingText,string mySnippet,DefCat myDefCategory)
        {
            parameterFields.Add(new ParameterField(myName,myValueType,myDefaultValues,myPromptingText,mySnippet,myDefCategory));
        }
Example #45
0
File: DefC.cs Project: mnisl/OD
		///<summary>Gets a list of non-hidden defs for one category.</summary>
		public static Def[] GetList(DefCat defCat) {
			Def[][] arrayDefs=GetArrayShort();
			return arrayDefs[(int)defCat];
		}
Example #46
0
File: DefC.cs Project: mnisl/OD
		///<summary>Get one def from Long.  Returns null if not found.  Only used for very limited situations.  Other Get functions tend to be much more useful since they don't return null.  There is also BIG potential for silent bugs if you use this.ItemOrder instead of GetOrder().</summary>
		public static Def GetDef(DefCat myCat,long myDefNum) {
			Def[][] arrayDefs=GetArrayLong();
			for(int i=0;i<arrayDefs[(int)myCat].GetLength(0);i++) {
				if(arrayDefs[(int)myCat][i].DefNum==myDefNum) {
					return arrayDefs[(int)myCat][i].Copy();
				}
			}
			return null;
		}
Example #47
0
File: DefC.cs Project: mnisl/OD
		///<summary>Returns 0 if it can't find the named def.  If the name is blank, then it returns the first def in the category.</summary>
		public static long GetByExactName(DefCat myCat,string itemName) {
			Def[][] arrayDefs=GetArrayLong();
			if(itemName=="") {
				return arrayDefs[(int)myCat][0].DefNum;//return the first one in the list
			}
			for(int i=0;i<arrayDefs[(int)myCat].GetLength(0);i++) {
				if(arrayDefs[(int)myCat][i].ItemName==itemName) {
					return arrayDefs[(int)myCat][i].DefNum;
				}
			}
			return 0;
		}
Example #48
0
 ///<summary>Returns the named def.  If it can't find the name, then it returns the first def in the category.</summary>
 public static long GetByExactNameNeverZero(DefCat myCat,string itemName)
 {
     if(itemName=="") {
         return DefC.Long[(int)myCat][0].DefNum;//return the first one in the list
     }
     for(int i=0;i<DefC.Long[(int)myCat].GetLength(0);i++) {
         if(DefC.Long[(int)myCat][i].ItemName==itemName) {
             return DefC.Long[(int)myCat][i].DefNum;
         }
     }
     if(DefC.Long[(int)myCat].Length==0) {
         Def def=new Def();
         def.Category=myCat;
         def.ItemOrder=0;
         def.ItemName=itemName;
         Defs.Insert(def);
         Defs.RefreshCache();
     }
     return DefC.Long[(int)myCat][0].DefNum;//return the first one in the list
 }
Example #49
0
File: DefC.cs Project: mnisl/OD
		///<summary></summary>
		public static string GetName(DefCat myCat,long myDefNum) {
			if(myDefNum==0){
				return "";
			}
			Def[][] arrayDefs=GetArrayLong();
			for(int i=0;i<arrayDefs[(int)myCat].GetLength(0);i++) {
				if(arrayDefs[(int)myCat][i].DefNum==myDefNum) {
					return arrayDefs[(int)myCat][i].ItemName;
				}
			}
			return "";
		}
		///<summary>Overload for ValueKind ForeignKey.</summary>
		public ParameterField(string thisName,FieldValueType thisValueType,ArrayList theseDefaultValues,string thisPromptingText,string thisSnippet,ReportFKType thisReportFKType){
			name=thisName;
			valueType=thisValueType;
			defaultValues=theseDefaultValues;
			promptingText=thisPromptingText;
			snippet=thisSnippet;
			enumerationType=EnumType.ApptStatus;//arbitrary
			defCategory=DefCat.AccountColors;//arbitrary
			fKeyType=thisReportFKType;
		}
Example #51
0
 ///<summary>Gets a list of defs for one category.</summary>
 public static Def[] GetList(DefCat defCat)
 {
     return Short[(int)defCat];
 }
Example #52
0
File: DefC.cs Project: mnisl/OD
		///<summary>Gets the order of the def within Short or -1 if not found.</summary>
		public static int GetOrder(DefCat myCat,long myDefNum) {
			//gets the index in the list of unhidden (the Short list).
			Def[][] arrayDefs=GetArrayShort();
			for(int i=0;i<arrayDefs[(int)myCat].GetLength(0);i++) {
				if(arrayDefs[(int)myCat][i].DefNum==myDefNum) {
					return i;
				}
			}
			return -1;
		}
Example #53
0
		/// <summary>Overload for using DefCat.</summary>
		public void AddInputItem(string promptingText,FieldValueType valueType,ArrayList currentValues,DefCat defCategory){
			if(currentValues==null)
				currentValues=new ArrayList();
			multInputItems.Add(new MultInputItem(promptingText,valueType,currentValues,EnumType.ApptStatus,defCategory,ReportFKType.None));
		}
Example #54
0
 ///<summary>Gets the order of the def within Short or -1 if not found.</summary>
 public static int GetOrder(DefCat myCat,long myDefNum)
 {
     //gets the index in the list of unhidden (the Short list).
     for(int i=0;i<DefC.Short[(int)myCat].GetLength(0);i++) {
         if(DefC.Short[(int)myCat][i].DefNum==myDefNum) {
             return i;
         }
     }
     return -1;
 }
Example #55
0
 /// <summary>Overload for ValueKind defCat.</summary>
 public void AddParameter(string myName, FieldValueType myValueType
                          , ArrayList myDefaultValues, string myPromptingText, string mySnippet, DefCat myDefCategory)
 {
     parameterFields.Add(new ParameterField(myName, myValueType, myDefaultValues, myPromptingText, mySnippet, myDefCategory));
 }
Example #56
0
 ///<summary></summary>
 public static string GetValue(DefCat myCat,long myDefNum)
 {
     string retStr="";
     for(int i=0;i<DefC.Long[(int)myCat].GetLength(0);i++) {
         if(DefC.Long[(int)myCat][i].DefNum==myDefNum) {
             retStr=DefC.Long[(int)myCat][i].ItemValue;
         }
     }
     return retStr;
 }