Ejemplo n.º 1
0
        public bool Add(int type, string title, string Number, string opentime, string NumberAll = "")
        {
            int num = LotterySum.SumNumber(Number);

            using (DbOperHandler dbOperHandler = new ComData().Doh())
            {
                NumberAll = string.IsNullOrEmpty(NumberAll) ? Number : NumberAll;
                dbOperHandler.Reset();
                dbOperHandler.AddFieldItem("Type", (object)type);
                dbOperHandler.AddFieldItem("Title", (object)title);
                dbOperHandler.AddFieldItem("Number", (object)Number);
                dbOperHandler.AddFieldItem("NumberAll", (object)NumberAll);
                dbOperHandler.AddFieldItem("Total", (object)num);
                dbOperHandler.AddFieldItem("Opentime", (object)opentime);
                dbOperHandler.AddFieldItem("IsFill", (object)"1");
                if (dbOperHandler.Insert("Sys_LotteryData") > 0)
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 2
0
 public void SaveUserRegLink(string UserId, decimal Point, string Url)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = string.Concat(new object[]
         {
             "UserId=",
             UserId,
             " and Point=",
             Point
         });
         if (dbOperHandler.Exist("N_UserRegLink"))
         {
             dbOperHandler.Reset();
             dbOperHandler.ConditionExpress = string.Concat(new object[]
             {
                 "UserId=",
                 UserId,
                 " and Point=",
                 Point
             });
             dbOperHandler.AddFieldItem("UserId", UserId);
             dbOperHandler.AddFieldItem("Point", Point);
             dbOperHandler.AddFieldItem("Url", Url);
             dbOperHandler.Update("N_UserRegLink");
         }
         else
         {
             dbOperHandler.Reset();
             dbOperHandler.AddFieldItem("UserId", UserId);
             dbOperHandler.AddFieldItem("Point", Point);
             dbOperHandler.AddFieldItem("Url", Url);
             dbOperHandler.Insert("N_UserRegLink");
         }
     }
 }