Exemplo n.º 1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static Hashtable Insert(Model.MMMConfigScramble model, Hashtable MyHs)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into MMMConfigScramble(");
            strSql.Append("PayLimitTimes,ConfirmLimitTimes,OpenTime,OpenSwitch,FreezeTimes,ScrambleReward,ScrambleLiXiDays,DisappearTimes)");
            strSql.Append(" values (");
            strSql.Append("@PayLimitTimes,@ConfirmLimitTimes,@OpenTime,@OpenSwitch,@FreezeTimes,@ScrambleReward,@ScrambleLiXiDays,@DisappearTimes)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@PayLimitTimes",     SqlDbType.Int,       4),
                new SqlParameter("@ConfirmLimitTimes", SqlDbType.Int,       4),
                new SqlParameter("@OpenTime",          SqlDbType.VarChar, 100),
                new SqlParameter("@OpenSwitch",        SqlDbType.Bit,       1),
                new SqlParameter("@FreezeTimes",       SqlDbType.Int,       4),
                new SqlParameter("@ScrambleReward",    SqlDbType.Decimal,   9),
                new SqlParameter("@ScrambleLiXiDays",  SqlDbType.Int,       4),
                new SqlParameter("@DisappearTimes",    SqlDbType.Int, 4)
            };
            parameters[0].Value = model.PayLimitTimes;
            parameters[1].Value = model.ConfirmLimitTimes;
            parameters[2].Value = model.OpenTime;
            parameters[3].Value = model.OpenSwitch;
            parameters[4].Value = model.FreezeTimes;
            parameters[5].Value = model.ScrambleReward;
            parameters[6].Value = model.ScrambleLiXiDays;
            parameters[7].Value = model.DisappearTimes;

            string guid = Guid.NewGuid().ToString();

            strSql.AppendFormat(";select '{0}'", guid);
            MyHs.Add(strSql.ToString(), parameters);
            return(MyHs);
        }
Exemplo n.º 2
0
        /// <summary>
        ///  实体转换
        /// <summary>
        private static Model.MMMConfigScramble TranEntity(DataRow row)
        {
            if (row != null)
            {
                Model.MMMConfigScramble model = new Model.MMMConfigScramble();

                if (row["PayLimitTimes"] != null && row["PayLimitTimes"].ToString() != "")
                {
                    model.PayLimitTimes = int.Parse(row["PayLimitTimes"].ToString());
                }
                if (row["ConfirmLimitTimes"] != null && row["ConfirmLimitTimes"].ToString() != "")
                {
                    model.ConfirmLimitTimes = int.Parse(row["ConfirmLimitTimes"].ToString());
                }
                if (row["OpenTime"] != null)
                {
                    model.OpenTime = row["OpenTime"].ToString();
                }
                if (row["OpenSwitch"] != null && row["OpenSwitch"].ToString() != "")
                {
                    if ((row["OpenSwitch"].ToString() == "1") || (row["OpenSwitch"].ToString().ToLower() == "true"))
                    {
                        model.OpenSwitch = true;
                    }
                    else
                    {
                        model.OpenSwitch = false;
                    }
                }
                if (row["FreezeTimes"] != null && row["FreezeTimes"].ToString() != "")
                {
                    model.FreezeTimes = int.Parse(row["FreezeTimes"].ToString());
                }
                if (row["ScrambleReward"] != null && row["ScrambleReward"].ToString() != "")
                {
                    model.ScrambleReward = decimal.Parse(row["ScrambleReward"].ToString());
                }
                if (row["ScrambleLiXiDays"] != null && row["ScrambleLiXiDays"].ToString() != "")
                {
                    model.ScrambleLiXiDays = int.Parse(row["ScrambleLiXiDays"].ToString());
                }
                if (row["DisappearTimes"] != null && row["DisappearTimes"].ToString() != "")
                {
                    model.DisappearTimes = int.Parse(row["DisappearTimes"].ToString());
                }

                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static Hashtable Update(Model.MMMConfigScramble model, Hashtable MyHs)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update MMMConfigScramble set ");
            strSql.Append("PayLimitTimes=@PayLimitTimes,");
            strSql.Append("ConfirmLimitTimes=@ConfirmLimitTimes,");
            strSql.Append("OpenTime=@OpenTime,");
            strSql.Append("OpenSwitch=@OpenSwitch,");
            strSql.Append("FreezeTimes=@FreezeTimes,");
            strSql.Append("ScrambleReward=@ScrambleReward,");
            strSql.Append("ScrambleLiXiDays=@ScrambleLiXiDays,");
            strSql.Append("DisappearTimes=@DisappearTimes");
            SqlParameter[] parameters =
            {
                new SqlParameter("@PayLimitTimes",     SqlDbType.Int,       4),
                new SqlParameter("@ConfirmLimitTimes", SqlDbType.Int,       4),
                new SqlParameter("@OpenTime",          SqlDbType.VarChar, 100),
                new SqlParameter("@OpenSwitch",        SqlDbType.Bit,       1),
                new SqlParameter("@FreezeTimes",       SqlDbType.Int,       4),
                new SqlParameter("@ScrambleReward",    SqlDbType.Decimal,   9),
                new SqlParameter("@ScrambleLiXiDays",  SqlDbType.Int,       4),
                new SqlParameter("@DisappearTimes",    SqlDbType.Int, 4)
            };
            parameters[0].Value = model.PayLimitTimes;
            parameters[1].Value = model.ConfirmLimitTimes;
            parameters[2].Value = model.OpenTime;
            parameters[3].Value = model.OpenSwitch;
            parameters[4].Value = model.FreezeTimes;
            parameters[5].Value = model.ScrambleReward;
            parameters[6].Value = model.ScrambleLiXiDays;
            parameters[7].Value = model.DisappearTimes;

            string guid = Guid.NewGuid().ToString();

            strSql.AppendFormat(" ;select '{0}'", guid);
            MyHs.Add(strSql.ToString(), parameters);
            DAL.MMMConfigScramble.TModel = null;
            return(MyHs);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static bool Update(Model.MMMConfigScramble model)
 {
     return(DAL.CommonBase.RunHashtable(Update(model, new Hashtable())));
 }
Exemplo n.º 5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static bool Insert(Model.MMMConfigScramble model)
 {
     return(DAL.CommonBase.RunHashtable(Insert(model, new Hashtable())));
 }
Exemplo n.º 6
0
 public static bool Update(Model.MMMConfigScramble model)
 {
     return(WE_Project.DAL.MMMConfigScramble.Update(model));
 }
Exemplo n.º 7
0
 public static Hashtable Update(Model.MMMConfigScramble model, Hashtable MyHs)
 {
     return(WE_Project.DAL.MMMConfigScramble.Update(model, MyHs));
 }
Exemplo n.º 8
0
 public static bool Insert(Model.MMMConfigScramble model)
 {
     return(WE_Project.DAL.MMMConfigScramble.Insert(model));
 }
Exemplo n.º 9
0
 public static Hashtable Insert(Model.MMMConfigScramble model, Hashtable MyHs)
 {
     return(WE_Project.DAL.MMMConfigScramble.Insert(model, MyHs));
 }