Exemple #1
0
        public static bool FromDBTable(this AccountPermissionData item, DataRow row)
        {
            if (row == null)
            {
                return(false);
            }

            DBUtility.AsValue(row, "AccountDBKey", out item.AccountDBKey);
            DBUtility.AsValueEnum(row, "PermissionType", out item.PermissionType);
            DBUtility.AsValue(row, "Level", out item.Level);
            DBUtility.AsValue(row, "RegisterTime", out item.RegisterTime);
            return(true);
        }
Exemple #2
0
 public bool FromDataTable(DataTable table)
 {
     try
     {
         return(DBUtility.AsValue(table.Rows[0], "Count", out Count, 0));
     }
     catch (Exception ex)
     {
         Count = 0;
         NLog.LogManager.GetCurrentClassLogger().Error(ex);
         return(false);
     }
 }
Exemple #3
0
        public static bool FromDBTable(this AccountBasicData item, DataRow row)
        {
            if (row == null)
            {
                return(false);
            }

            DBUtility.AsValue(row, "AccountDBKey", out item.AccountDBKey);
            DBUtility.AsValue(row, "CreateTime", out item.CreateTime);
            DBUtility.AsValue(row, "GivenName", out item.GivenName);
            DBUtility.AsValue(row, "SurName", out item.SurName);
            DBUtility.AsValue(row, "Username", out item.Username);
            DBUtility.AsValue(row, "EMail", out item.EMail);
            DBUtility.AsValue(row, "Password", out item.Password);
            DBUtility.AsValue(row, "RegionCodeForNumber", out item.RegionCodeForNumber);
            DBUtility.AsValue(row, "CountryCode", out item.CountryCode);
            DBUtility.AsValue(row, "NationalNumber", out item.NationalNumber);
            return(true);
        }
Exemple #4
0
            public bool FromDataTable(DataTable table)
            {
                try
                {
                    if (table.Rows.Count == 0)
                    {
                        return(false);
                    }

                    var row = table.Rows[0];

                    DBUtility.AsValue(row, "MachineDBKey", out MachineDBKey);
                    DBUtility.AsValue(row, "MacAddress", out MacAddress);
                    DBUtility.AsValue(row, "Port", out Port);
                    return(true);
                }
                catch
                {
                    return(false);
                }
            }