예제 #1
0
 public static int?ConvertToState(this CMS_SHOP user)
 {
     if (user == null)
     {
         return(null);
     }
     if (user.status == null)
     {
         return(null);
     }
     if (user.status.Value)
     {
         return(0);
     }
     return(1);
 }
예제 #2
0
 public static int?ConvertToSex(this CMS_SHOP user)
 {
     if (user == null)
     {
         return(null);
     }
     if (string.IsNullOrWhiteSpace(user.sex))
     {
         return(null);
     }
     if (user.sex == "女")
     {
         return(1);
     }
     else
     {
         return(0);
     }
 }