public bool Save(tbOtherConfig OtherConfig) { bool IsOk = false; IDbDataParameter[] parm = GetUpdateParam(); parm[0].Value = OtherConfig.UserId; parm[1].Value = OtherConfig.Invoice; parm[2].Value = OtherConfig.AutoHeight; try { IsOk = DBHelper.ExecuteNonQuery(CommandType.StoredProcedure, SQL_UPDATE, parm) > 0; } catch { } return(IsOk); }
private const string PARM_AUTO = "@AutoHeight"; //是否自动计算发货单高度 public tbOtherConfig Select(int UserId) { tbOtherConfig config = null; IDbDataParameter[] parm = GetSelectParam(); parm[0].Value = UserId; using (IDataReader MyReader = DBHelper.ExecuteReader(CommandType.StoredProcedure, SQL_SELECT, parm)) { if (MyReader.Read()) { config = new tbOtherConfig() { UserId = MyReader.GetInt32(0), Invoice = MyReader.GetBoolean(1), AutoHeight = MyReader.GetBoolean(2) }; } } return(config == null ? new tbOtherConfig() : config); }
/// <summary> /// 保存系统其他设置信息 /// </summary> /// <param name="OtherConfig">系统其他设置信息</param> /// <returns></returns> public static bool Save(tbOtherConfig OtherConfig) { return(OtherConfigDal.Save(OtherConfig)); }