Exemplo n.º 1
0
        public static ListItem GetListItem(EWinStatus type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
Exemplo n.º 2
0
 public static bool Equals(EWinStatus type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
        public void UpdateStatus(EWinStatus status, List <int> winnerIDList)
        {
            string sqlString =
                $"UPDATE {TABLE_NAME} SET {LotteryWinnerAttribute.Status} = '{EWinStatusUtils.GetValue(status)}' WHERE ID IN ({TranslateUtils.ToSqlInStringWithoutQuote(winnerIDList)})";

            if (status == EWinStatus.Cashed)
            {
                sqlString =
                    $"UPDATE {TABLE_NAME} SET {LotteryWinnerAttribute.Status} = '{EWinStatusUtils.GetValue(status)}', {LotteryWinnerAttribute.CashDate} = getdate() WHERE ID IN ({TranslateUtils.ToSqlInStringWithoutQuote(winnerIDList)})";
            }

            ExecuteNonQuery(sqlString);
        }
Exemplo n.º 4
0
 public static string GetText(EWinStatus type)
 {
     if (type == EWinStatus.Won)
     {
         return("已中奖");
     }
     else if (type == EWinStatus.Applied)
     {
         return("已提交信息");
     }
     else if (type == EWinStatus.Cashed)
     {
         return("已兑奖");
     }
     else
     {
         throw new Exception();
     }
 }
Exemplo n.º 5
0
 public static string GetValue(EWinStatus type)
 {
     if (type == EWinStatus.Won)
     {
         return("Won");
     }
     else if (type == EWinStatus.Applied)
     {
         return("Applied");
     }
     else if (type == EWinStatus.Cashed)
     {
         return("Cashed");
     }
     else
     {
         throw new Exception();
     }
 }
Exemplo n.º 6
0
 public static bool Equals(string typeStr, EWinStatus type)
 {
     return(Equals(type, typeStr));
 }