Ejemplo n.º 1
0
 ///<Summary>Returns a defnum.  If no match, then it returns the first one in the list in that category.</Summary>
 public static int GetTypeAuto(CommItemTypeAuto typeauto)
 {
     for (int i = 0; i < DefB.Long[(int)DefCat.CommLogTypes].Length; i++)
     {
         if (DefB.Long[(int)DefCat.CommLogTypes][i].ItemValue == typeauto.ToString())
         {
             return(DefB.Long[(int)DefCat.CommLogTypes][i].DefNum);
         }
     }
     if (DefB.Long[(int)DefCat.CommLogTypes].Length > 0)
     {
         return(DefB.Long[(int)DefCat.CommLogTypes][0].DefNum);
     }
     return(0);
 }
Ejemplo n.º 2
0
 ///<Summary>Returns a defnum.  If no match, then it returns the first one in the list in that category.</Summary>
 public static long GetTypeAuto(CommItemTypeAuto typeauto)
 {
     //No need to check RemotingRole; no call to db.
     for (int i = 0; i < DefC.Long[(int)DefCat.CommLogTypes].Length; i++)
     {
         if (DefC.Long[(int)DefCat.CommLogTypes][i].ItemValue == typeauto.ToString())
         {
             return(DefC.Long[(int)DefCat.CommLogTypes][i].DefNum);
         }
     }
     if (DefC.Long[(int)DefCat.CommLogTypes].Length > 0)
     {
         return(DefC.Long[(int)DefCat.CommLogTypes][0].DefNum);
     }
     return(0);
 }
Ejemplo n.º 3
0
        ///<Summary>Returns a defnum.  If no match, then it returns the first one in the list in that category.
        ///If there are no defs in the category, 0 is returned.</Summary>
        public static long GetTypeAuto(CommItemTypeAuto typeauto)
        {
            //No need to check RemotingRole; no call to db.
            List <Def> listDefs = Defs.GetDefsForCategory(DefCat.CommLogTypes);
            Def        def      = listDefs.FirstOrDefault(x => x.ItemValue == typeauto.ToString());

            if (def != null)
            {
                return(def.DefNum);
            }
            if (listDefs.Count > 0)
            {
                return(listDefs[0].DefNum);
            }
            return(0);
        }
Ejemplo n.º 4
0
Archivo: Commlogs.cs Proyecto: mnisl/OD
		///<Summary>Returns a defnum.  If no match, then it returns the first one in the list in that category.</Summary>
		public static long GetTypeAuto(CommItemTypeAuto typeauto) {
			//No need to check RemotingRole; no call to db.
			Def[][] arrayDefs=DefC.GetArrayLong();
			for(int i=0;i<arrayDefs[(int)DefCat.CommLogTypes].Length;i++) {
				if(arrayDefs[(int)DefCat.CommLogTypes][i].ItemValue==typeauto.ToString()) {
					return arrayDefs[(int)DefCat.CommLogTypes][i].DefNum;
				}
			}
			if(arrayDefs[(int)DefCat.CommLogTypes].Length>0) {
				return arrayDefs[(int)DefCat.CommLogTypes][0].DefNum;
			}
			return 0;
		}