private void map(FeedBackShowListInfo oParam, DataRow tempdr) { oParam.SysNo = Util.TrimIntNull(tempdr["SysNo"]); oParam.FeedBackSysNo = Util.TrimIntNull(tempdr["FeedBackSysNo"]); oParam.Type = Util.TrimIntNull(tempdr["Type"]); oParam.CreateTime = Util.TrimDateNull(tempdr["CreateTime"]); }
public int Insert(FeedBackShowListInfo oParam) { string sql = " select * from FeedBackShowList where FeedBackSysNo = " + oParam.FeedBackSysNo; DataSet ds = SqlHelper.ExecuteDataSet(sql); if (Util.HasMoreRow(ds)) throw new BizException("the same FeedBack exists already"); int result=new FeedBackShowListDac().Insert(oParam); return result; }
public FeedBackShowListInfo Load(int FeedBacksysno, int Type) { string sql = "select * from FeedBackShowList where FeedBackSysNo = " + FeedBacksysno + "and Type=" + Type; DataSet ds = SqlHelper.ExecuteDataSet(sql); if (!Util.HasMoreRow(ds)) { return(null); } FeedBackShowListInfo oInfo = new FeedBackShowListInfo(); map(oInfo, ds.Tables[0].Rows[0]); return(oInfo); }
public int Insert(FeedBackShowListInfo oParam) { string sql = " select * from FeedBackShowList where FeedBackSysNo = " + oParam.FeedBackSysNo; DataSet ds = SqlHelper.ExecuteDataSet(sql); if (Util.HasMoreRow(ds)) { throw new BizException("the same FeedBack exists already"); } int result = new FeedBackShowListDac().Insert(oParam); return(result); }
public int Insert(FeedBackShowListInfo oParam) { string sql = @"INSERT INTO FeedbackShowList ( FeedBackSysNo, Type, CreateTime ) VALUES ( @FeedBackSysNo, @Type, @CreateTime );set @SysNo = SCOPE_IDENTITY();"; SqlCommand cmd = new SqlCommand(sql); SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4); SqlParameter paramFeedBackSysNo = new SqlParameter("@FeedBackSysNo", SqlDbType.Int, 4); SqlParameter paramType = new SqlParameter("@Type", SqlDbType.Int, 4); SqlParameter paramCreateTime = new SqlParameter("@CreateTime", SqlDbType.DateTime); paramSysNo.Direction = ParameterDirection.Output; if (oParam.FeedBackSysNo != AppConst.IntNull) { paramFeedBackSysNo.Value = oParam.FeedBackSysNo; } else { paramFeedBackSysNo.Value = System.DBNull.Value; } if (oParam.Type != AppConst.IntNull) { paramType.Value = oParam.Type; } else { paramType.Value = System.DBNull.Value; } if (oParam.CreateTime != AppConst.DateTimeNull) { paramCreateTime.Value = oParam.CreateTime; } else { paramCreateTime.Value = System.DBNull.Value; } cmd.Parameters.Add(paramSysNo); cmd.Parameters.Add(paramFeedBackSysNo); cmd.Parameters.Add(paramType); cmd.Parameters.Add(paramCreateTime); return(SqlHelper.ExecuteNonQuery(cmd, out oParam.SysNo)); }
public int Insert(FeedBackShowListInfo oParam) { string sql = @"INSERT INTO FeedbackShowList ( FeedBackSysNo, Type, CreateTime ) VALUES ( @FeedBackSysNo, @Type, @CreateTime );set @SysNo = SCOPE_IDENTITY();"; SqlCommand cmd = new SqlCommand(sql); SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4); SqlParameter paramFeedBackSysNo = new SqlParameter("@FeedBackSysNo", SqlDbType.Int, 4); SqlParameter paramType = new SqlParameter("@Type", SqlDbType.Int, 4); SqlParameter paramCreateTime = new SqlParameter("@CreateTime", SqlDbType.DateTime); paramSysNo.Direction = ParameterDirection.Output; if (oParam.FeedBackSysNo != AppConst.IntNull) paramFeedBackSysNo.Value = oParam.FeedBackSysNo; else paramFeedBackSysNo.Value = System.DBNull.Value; if (oParam.Type != AppConst.IntNull) paramType.Value = oParam.Type; else paramType.Value = System.DBNull.Value; if (oParam.CreateTime != AppConst.DateTimeNull) paramCreateTime.Value = oParam.CreateTime; else paramCreateTime.Value = System.DBNull.Value; cmd.Parameters.Add(paramSysNo); cmd.Parameters.Add(paramFeedBackSysNo); cmd.Parameters.Add(paramType); cmd.Parameters.Add(paramCreateTime); return SqlHelper.ExecuteNonQuery(cmd, out oParam.SysNo); }
public FeedBackShowListInfo Load(int FeedBacksysno,int Type) { string sql = "select * from FeedBackShowList where FeedBackSysNo = " + FeedBacksysno + "and Type=" + Type; DataSet ds = SqlHelper.ExecuteDataSet(sql); if (!Util.HasMoreRow(ds)) return null; FeedBackShowListInfo oInfo = new FeedBackShowListInfo(); map(oInfo, ds.Tables[0].Rows[0]); return oInfo; }