internal override string FormatedGenericValue(string valueToFormat, GenericDataFieldAttribute genericFieldInfo, IDatabaseProvider db)
 {
     if (genericFieldInfo.PropertyName == "JobStatusText")
     {
         var jobStatus = valueToFormat.ToEnum <CalendarJobStatusEnum>();
         return(jobStatus.GetDescription());
     }
     if (genericFieldInfo.PropertyName == "JobMethodText")
     {
         var calendarJobMethod = valueToFormat.ToEnum <CalendarJobMethodEnum>();
         return(calendarJobMethod.GetDescription());
     }
     if (genericFieldInfo.PropertyName == "UserIdText")
     {
         if (valueToFormat.IsInteger())
         {
             var u = db.DbAuth.GetUser(valueToFormat.ToInteger());
             return(u.DisplayName);
         }
     }
     if (genericFieldInfo.PropertyName == "MemoItemIdText")
     {
         if (valueToFormat.IsInteger())
         {
             var u = db.DbCalendar.Get(new CalendarSearchParameters {
                 ID = valueToFormat.ToInteger()
             }).FirstOrDefault();
             return(u.title);
         }
     }
     return(base.FormatedGenericValue(valueToFormat, genericFieldInfo, db));
 }
Exemplo n.º 2
0
 internal override string FormatedGenericValue(string valueToFormat, GenericDataFieldAttribute genericFieldInfo, IDatabaseProvider db)
 {
     if (genericFieldInfo.PropertyName == "DepositTypeText")
     {
         var jobStatus = valueToFormat.ToEnum <DepositTypeEnum>();
         return(jobStatus.GetDescription());
     }
     return(base.FormatedGenericValue(valueToFormat, genericFieldInfo, db));
 }
Exemplo n.º 3
0
 internal override string FormatedGenericValue(string valueToFormat, GenericDataFieldAttribute genericFieldInfo, IDatabaseProvider db)
 {
     if (genericFieldInfo.PropertyName == "UserIdText")
     {
         if (valueToFormat.IsInteger())
         {
             var u = db.DbAuth.GetUser(valueToFormat.ToInteger());
             return(u.DisplayName);
         }
     }
     if (genericFieldInfo.PropertyName == "ClientIdText")
     {
         return(StringCipher.Decrypt(valueToFormat));
     }
     return(base.FormatedGenericValue(valueToFormat, genericFieldInfo, db));
 }
Exemplo n.º 4
0
 internal override string FormatedGenericValue(string valueToFormat, GenericDataFieldAttribute genericFieldInfo, IDatabaseProvider db)
 {
     if (genericFieldInfo.PropertyName == "UsersToShareText")
     {
         var usersToShare = valueToFormat.ParseXml <List <int> >();
         var users        = db.DbAuth.GetUsers(new UserSearchParameters {
             Ids = usersToShare
         });
         return(string.Join(",", users.Select(x => x.DisplayName).ToList()));
     }
     if (genericFieldInfo.PropertyName == "OwnerUserIdText")
     {
         if (valueToFormat.IsInteger())
         {
             var u = db.DbAuth.GetUser(valueToFormat.ToInteger());
             return(u.DisplayName);
         }
     }
     return(base.FormatedGenericValue(valueToFormat, genericFieldInfo, db));
 }
Exemplo n.º 5
0
 internal override string FormatedGenericValue(string valueToFormat, GenericDataFieldAttribute genericFieldInfo, IDatabaseProvider db)
 {
     if (genericFieldInfo.PropertyName == "UserIdText")
     {
         if (valueToFormat.IsInteger())
         {
             var u = db.DbAuth.GetUser(valueToFormat.ToInteger());
             return(u.DisplayName);
         }
     }
     if (genericFieldInfo.PropertyName == "LastLoggedText")
     {
         if (valueToFormat.IsDateTime())
         {
             var days = (DateTime.Now - valueToFormat.ToDateTime()).Hours;
             return($" לפני {days} שעות");
         }
     }
     return(base.FormatedGenericValue(valueToFormat, genericFieldInfo, db));
 }
Exemplo n.º 6
0
 internal override string FormatedGenericValue(string valueToFormat, GenericDataFieldAttribute genericFieldInfo, IDatabaseProvider db)
 {
     if (genericFieldInfo.PropertyName == "EscorterIdText")
     {
         if (valueToFormat.IsInteger())
         {
             var u = db.DbAuth.GetUser(valueToFormat.ToInteger());
             return(u.DisplayName);
         }
     }
     if (genericFieldInfo.PropertyName == "ParentIdIdText")
     {
         if (valueToFormat.IsInteger())
         {
             var u = db.DbGenericData.GetSingleGenericData(new GenericDataSearchParameters {
                 Id = valueToFormat.ToInteger(), FromType = typeof(Parent)
             });
             return((u as Parent).ParentName);
         }
     }
     return(base.FormatedGenericValue(valueToFormat, genericFieldInfo, db));
 }
Exemplo n.º 7
0
 internal virtual string FormatedGenericValue(string valueToFormat, GenericDataFieldAttribute genericFieldInfo, IDatabaseProvider db)
 {
     return(string.Empty);
 }
Exemplo n.º 8
0
 internal string GetFormatedValue(Type genericDataType, string valueToFormat, GenericDataFieldAttribute genericFieldInfo, IDatabaseProvider db)
 {
     return(FormatedGenericValue(valueToFormat, genericFieldInfo, db));
 }