/// <summary> /// 更新数据 /// </summary> /// <param name="model">实体类HolesSetting对象</param> /// <returns></returns> public bool Update(HolesSetting model) { StringBuilder sb = new StringBuilder(); sb.Append("UPDATE FROM tHolesSetting SET "); sb.AppendFormat("checkItemId='{0}'", model.CheckItemId); sb.AppendFormat(",HolesIndex='{0}'", model.HolesIndex); sb.AppendFormat(",IsShowOnData={0}", model.IsShowOnData); sb.AppendFormat(",IsDouble={0}", model.IsDouble); sb.AppendFormat(",MachineCode='{0}'", model.MachineCode); return(DataBase.ExecuteCommand(sb.ToString())); }
/// <summary> /// 数据插入 /// </summary> /// <param name="model">实体类HolesSetting对象</param> /// <returns></returns> public bool Insert(HolesSetting model) { StringBuilder sb = new StringBuilder();//insert into values sb.Append("INSERT INTO tHolesSetting(checkItemId,HolesIndex,IsShowOnData,IsDouble,MachineCode)VALUES("); sb.AppendFormat("'{0}',", model.CheckItemId); sb.AppendFormat("'{0}',", model.HolesIndex); sb.AppendFormat("{0},", model.IsShowOnData); sb.AppendFormat("{0},", model.IsDouble); sb.AppendFormat("'{0}'", model.MachineCode); sb.Append(")"); return(DataBase.ExecuteCommand(sb.ToString())); }