Beispiel #1
0
 protected static MySqlParameter[] GetParameters(UrsuserextInfo item)
 {
     return(new MySqlParameter[] {
         GetParameter("?ExtNumber", MySqlDbType.Int32, 11, item.ExtNumber),
         GetParameter("?ExtCHTInfo", MySqlDbType.Text, -1, item.ExtCHTInfo)
     });
 }
Beispiel #2
0
        public static UrsuserextInfo GetItem(int?ExtNumber)
        {
            if (ExtNumber == null)
            {
                return(null);
            }
            if (itemCacheTimeout <= 0)
            {
                return(dal.GetItem(ExtNumber));
            }
            string key   = string.Concat("DC2016_BLL_Ursuserext_", ExtNumber);
            string value = RedisHelper.Get(key);

            if (!string.IsNullOrEmpty(value))
            {
                try { return(new UrsuserextInfo(value)); } catch { }
            }
            UrsuserextInfo item = dal.GetItem(ExtNumber);

            if (item == null)
            {
                return(null);
            }
            RedisHelper.Set(key, item.Stringify(), itemCacheTimeout);
            return(item);
        }
Beispiel #3
0
 private static void RemoveCache(UrsuserextInfo item)
 {
     if (item == null)
     {
         return;
     }
     RedisHelper.Remove(string.Concat("DC2016_BLL_Ursuserext_", item.ExtNumber));
 }
Beispiel #4
0
 public static DC2016.DAL.Ursuserext.SqlUpdateBuild UpdateDiy(UrsuserextInfo item, int?ExtNumber)
 {
     if (itemCacheTimeout > 0)
     {
         RemoveCache(item != null ? item : GetItem(ExtNumber));
     }
     return(new DC2016.DAL.Ursuserext.SqlUpdateBuild(item, ExtNumber));
 }
Beispiel #5
0
 public static int Update(UrsuserextInfo item)
 {
     if (itemCacheTimeout > 0)
     {
         RemoveCache(item);
     }
     return(dal.Update(item));
 }
Beispiel #6
0
 public static UrsuserextInfo Insert(UrsuserextInfo item)
 {
     item = dal.Insert(item);
     if (itemCacheTimeout > 0)
     {
         RemoveCache(item);
     }
     return(item);
 }
Beispiel #7
0
        public static bool CreateUser(int number, string acct, int qq, string mobile, string idcard, string extinfo)
        {
            if (number < 10000)
            {
                return(false);
            }
            bool        isexisted = Ursacct.IsExistNumber(number);
            UrsacctInfo acctInfo  = new UrsacctInfo()
            {
                AcctNumber = number,
                AcctEMail  = acct
            };

            Ursacct.Insert(acctInfo);

            if (!isexisted)
            {
                //rc &= URSUserInfo.Create(Operator, ACCT_Number, USRI_QQ, USRI_Mobile, USRI_IDCard);
                UrsuserInfo userInfo = new UrsuserInfo()
                {
                    UrsNumber   = number,
                    UrsQQ       = qq,
                    UrsMobile   = mobile,
                    UrsIDCard   = idcard,
                    UrsBirthDay = null,
                    UrsTime     = null
                };
                Ursuser.Insert(userInfo);

                //rc &= URSUserExtInfo.Create(Operator, ACCT_Number, UEXT_CHTInfo);
                UrsuserextInfo userExtInfo = new UrsuserextInfo()
                {
                    ExtNumber  = number,
                    ExtCHTInfo = extinfo
                };
                Ursuserext.Insert(userExtInfo);
            }
            return(true);
        }
Beispiel #8
0
 public SqlUpdateBuild(UrsuserextInfo item, int?ExtNumber)
 {
     _item  = item;
     _where = SqlHelper.Addslashes("`ExtNumber` = {0}", ExtNumber);
 }
Beispiel #9
0
 public int Update(UrsuserextInfo item)
 {
     return(new SqlUpdateBuild(null, item.ExtNumber)
            .SetExtCHTInfo(item.ExtCHTInfo).ExecuteNonQuery());
 }
Beispiel #10
0
 public UrsuserextInfo Insert(UrsuserextInfo item)
 {
     SqlHelper.ExecuteNonQuery(TSQL.Insert, GetParameters(item));
     return(item);
 }