Exemplo n.º 1
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        public int Update(clsATP model, out string errMsg)
        {
            errMsg = string.Empty;
            int rtn = 0;

            try
            {
                sb.Length = 0;
                sb.Append("UPDATE tAtp SET ");
                sb.AppendFormat("USER='******',", model.Atp_CheckName);
                sb.AppendFormat("RLU='{0}',", model.Atp_RLU);
                sb.AppendFormat("RESULT='{0}',", model.Atp_Result);
                sb.AppendFormat("DATA='{0}',", model.Atp_CheckData);
                sb.AppendFormat("TIME='{0}',", model.Atp_CheckTime);
                sb.AppendFormat("UPPER='{0}',", model.Atp_Upper);
                sb.AppendFormat("LOWER='{0}',", model.Atp_Lower);
                sb.AppendFormat(" WHERE DATA='{0}' AND TIME='{1}' AND USER='******'",
                                model.Atp_CheckData, model.Atp_CheckTime, model.Atp_CheckName);
                DataBase.ExecuteCommand(sb.ToString(), out errMsg);
                sb.Length = 0;
                rtn       = 1;
            }
            catch (Exception e)
            {
                errMsg = e.Message;
            }
            return(rtn);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 插入一条明细记录
        /// </summary>
        /// <param name="model">ID>0为修改 ID=0为新增</param>
        /// <returns></returns>
        public int Insert(clsATP model, out string errMsg)
        {
            errMsg = string.Empty;
            int rtn = 0;

            try
            {
                sb.Length = 0;
                sb.Append("INSERT INTO tAtp ");
                sb.Append("(ATP_CHECKNAME,ATP_RLU,ATP_RESULT,ATP_CHECKDATA,ATP_CHECKTIME,ATP_UPPER,ATP_LOWER) ");
                sb.Append("VALUES(");
                sb.AppendFormat("'{0}',", model.Atp_CheckName);
                sb.AppendFormat("'{0}',", model.Atp_RLU);
                sb.AppendFormat("'{0}',", model.Atp_Result);
                sb.AppendFormat("'{0}',", model.Atp_CheckData);
                sb.AppendFormat("'{0}',", model.Atp_CheckTime);
                sb.AppendFormat("'{0}',", model.Atp_Upper);
                sb.AppendFormat("'{0}'", model.Atp_Lower);
                sb.Append(")");
                DataBase.ExecuteCommand(sb.ToString(), out errMsg);
                sb.Length = 0;
                rtn       = 1;
            }
            catch (Exception e)
            {
                errMsg = e.Message;
            }
            return(rtn);
        }