/// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(KryptonAccessController.AccessDataBase.Model.TimeStandardOperateProcedure model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TimeStandardOperateProcedure set ");
            strSql.Append("TimeSOPName=@TimeSOPName,");
            strSql.Append("TimeSOPEnable=@TimeSOPEnable,");
            strSql.Append("TimeSOPLoop=@TimeSOPLoop,");
            strSql.Append("MonEnable=@MonEnable,");
            strSql.Append("TueEnable=@TueEnable,");
            strSql.Append("WedEnable=@WedEnable,");
            strSql.Append("ThuEnable=@ThuEnable,");
            strSql.Append("FriEnable=@FriEnable,");
            strSql.Append("SatEnable=@SatEnable,");
            strSql.Append("SunEnable=@SunEnable,");
            strSql.Append("TimePoint=@TimePoint,");
            strSql.Append("SOPID=@SOPID");
            strSql.Append(" where TimeSOPID=@TimeSOPID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@TimeSOPName",   SqlDbType.NVarChar, 50),
                new SqlParameter("@TimeSOPEnable", SqlDbType.Bit,       1),
                new SqlParameter("@TimeSOPLoop",   SqlDbType.Bit,       1),
                new SqlParameter("@MonEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@TueEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@WedEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@ThuEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@FriEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@SatEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@SunEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@TimePoint",     SqlDbType.NVarChar,  8),
                new SqlParameter("@SOPID",         SqlDbType.Int,       4),
                new SqlParameter("@TimeSOPID",     SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.TimeSOPName;
            parameters[1].Value  = model.TimeSOPEnable;
            parameters[2].Value  = model.TimeSOPLoop;
            parameters[3].Value  = model.MonEnable;
            parameters[4].Value  = model.TueEnable;
            parameters[5].Value  = model.WedEnable;
            parameters[6].Value  = model.ThuEnable;
            parameters[7].Value  = model.FriEnable;
            parameters[8].Value  = model.SatEnable;
            parameters[9].Value  = model.SunEnable;
            parameters[10].Value = model.TimePoint;
            parameters[11].Value = model.SOPID;
            parameters[12].Value = model.TimeSOPID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(KryptonAccessController.AccessDataBase.Model.TimeStandardOperateProcedure model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TimeStandardOperateProcedure(");
            strSql.Append("TimeSOPID,TimeSOPName,TimeSOPEnable,TimeSOPLoop,MonEnable,TueEnable,WedEnable,ThuEnable,FriEnable,SatEnable,SunEnable,TimePoint,SOPID)");
            strSql.Append(" values (");
            strSql.Append("@TimeSOPID,@TimeSOPName,@TimeSOPEnable,@TimeSOPLoop,@MonEnable,@TueEnable,@WedEnable,@ThuEnable,@FriEnable,@SatEnable,@SunEnable,@TimePoint,@SOPID)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@TimeSOPID",     SqlDbType.Int,       4),
                new SqlParameter("@TimeSOPName",   SqlDbType.NVarChar, 50),
                new SqlParameter("@TimeSOPEnable", SqlDbType.Bit,       1),
                new SqlParameter("@TimeSOPLoop",   SqlDbType.Bit,       1),
                new SqlParameter("@MonEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@TueEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@WedEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@ThuEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@FriEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@SatEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@SunEnable",     SqlDbType.Bit,       1),
                new SqlParameter("@TimePoint",     SqlDbType.NVarChar,  8),
                new SqlParameter("@SOPID",         SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.TimeSOPID;
            parameters[1].Value  = model.TimeSOPName;
            parameters[2].Value  = model.TimeSOPEnable;
            parameters[3].Value  = model.TimeSOPLoop;
            parameters[4].Value  = model.MonEnable;
            parameters[5].Value  = model.TueEnable;
            parameters[6].Value  = model.WedEnable;
            parameters[7].Value  = model.ThuEnable;
            parameters[8].Value  = model.FriEnable;
            parameters[9].Value  = model.SatEnable;
            parameters[10].Value = model.SunEnable;
            parameters[11].Value = model.TimePoint;
            parameters[12].Value = model.SOPID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public KryptonAccessController.AccessDataBase.Model.TimeStandardOperateProcedure DataRowToModel(DataRow row)
 {
     KryptonAccessController.AccessDataBase.Model.TimeStandardOperateProcedure model = new KryptonAccessController.AccessDataBase.Model.TimeStandardOperateProcedure();
     if (row != null)
     {
         if (row["TimeSOPID"] != null && row["TimeSOPID"].ToString() != "")
         {
             model.TimeSOPID = int.Parse(row["TimeSOPID"].ToString());
         }
         if (row["TimeSOPName"] != null)
         {
             model.TimeSOPName = row["TimeSOPName"].ToString();
         }
         if (row["TimeSOPEnable"] != null && row["TimeSOPEnable"].ToString() != "")
         {
             if ((row["TimeSOPEnable"].ToString() == "1") || (row["TimeSOPEnable"].ToString().ToLower() == "true"))
             {
                 model.TimeSOPEnable = true;
             }
             else
             {
                 model.TimeSOPEnable = false;
             }
         }
         if (row["TimeSOPLoop"] != null && row["TimeSOPLoop"].ToString() != "")
         {
             if ((row["TimeSOPLoop"].ToString() == "1") || (row["TimeSOPLoop"].ToString().ToLower() == "true"))
             {
                 model.TimeSOPLoop = true;
             }
             else
             {
                 model.TimeSOPLoop = false;
             }
         }
         if (row["MonEnable"] != null && row["MonEnable"].ToString() != "")
         {
             if ((row["MonEnable"].ToString() == "1") || (row["MonEnable"].ToString().ToLower() == "true"))
             {
                 model.MonEnable = true;
             }
             else
             {
                 model.MonEnable = false;
             }
         }
         if (row["TueEnable"] != null && row["TueEnable"].ToString() != "")
         {
             if ((row["TueEnable"].ToString() == "1") || (row["TueEnable"].ToString().ToLower() == "true"))
             {
                 model.TueEnable = true;
             }
             else
             {
                 model.TueEnable = false;
             }
         }
         if (row["WedEnable"] != null && row["WedEnable"].ToString() != "")
         {
             if ((row["WedEnable"].ToString() == "1") || (row["WedEnable"].ToString().ToLower() == "true"))
             {
                 model.WedEnable = true;
             }
             else
             {
                 model.WedEnable = false;
             }
         }
         if (row["ThuEnable"] != null && row["ThuEnable"].ToString() != "")
         {
             if ((row["ThuEnable"].ToString() == "1") || (row["ThuEnable"].ToString().ToLower() == "true"))
             {
                 model.ThuEnable = true;
             }
             else
             {
                 model.ThuEnable = false;
             }
         }
         if (row["FriEnable"] != null && row["FriEnable"].ToString() != "")
         {
             if ((row["FriEnable"].ToString() == "1") || (row["FriEnable"].ToString().ToLower() == "true"))
             {
                 model.FriEnable = true;
             }
             else
             {
                 model.FriEnable = false;
             }
         }
         if (row["SatEnable"] != null && row["SatEnable"].ToString() != "")
         {
             if ((row["SatEnable"].ToString() == "1") || (row["SatEnable"].ToString().ToLower() == "true"))
             {
                 model.SatEnable = true;
             }
             else
             {
                 model.SatEnable = false;
             }
         }
         if (row["SunEnable"] != null && row["SunEnable"].ToString() != "")
         {
             if ((row["SunEnable"].ToString() == "1") || (row["SunEnable"].ToString().ToLower() == "true"))
             {
                 model.SunEnable = true;
             }
             else
             {
                 model.SunEnable = false;
             }
         }
         if (row["TimePoint"] != null)
         {
             model.TimePoint = row["TimePoint"].ToString();
         }
         if (row["SOPID"] != null && row["SOPID"].ToString() != "")
         {
             model.SOPID = int.Parse(row["SOPID"].ToString());
         }
     }
     return(model);
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public KryptonAccessController.AccessDataBase.Model.TimeStandardOperateProcedure GetModel(int TimeSOPID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 TimeSOPID,TimeSOPName,TimeSOPEnable,TimeSOPLoop,MonEnable,TueEnable,WedEnable,ThuEnable,FriEnable,SatEnable,SunEnable,TimePoint,SOPID from TimeStandardOperateProcedure ");
            strSql.Append(" where TimeSOPID=@TimeSOPID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@TimeSOPID", SqlDbType.Int, 4)
            };
            parameters[0].Value = TimeSOPID;

            KryptonAccessController.AccessDataBase.Model.TimeStandardOperateProcedure model = new KryptonAccessController.AccessDataBase.Model.TimeStandardOperateProcedure();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }