示例#1
0
 private void dgvReaderType_SelectionChanged(object sender, EventArgs e)
 {
     if (dgvReaderType.CurrentCell == null)
         return;
     readertype= ReaderTypeAdmin.GetReaderType(Convert.ToString( dgvReaderType["rdType", dgvReaderType.CurrentCell.RowIndex].Value));
     SetReaderTypeToText();
 }
示例#2
0
 //添加复制函数
 public ReaderType(ReaderType rt)
 {
     this.rdType           = rt.rdType;
     this.rdTypeName       = rt.rdTypeName;
     this.CanLendQty       = rt.CanLendQty;
     this.CanLendDay       = rt.CanLendDay;
     this.CanContinueTimes = rt.CanContinueTimes;
     this.PunishRate       = rt.PunishRate;
     this.DateValid        = rt.DateValid;
 }
示例#3
0
 //添加复制函数
 public ReaderType(ReaderType rt)
 {
     this.rdType = rt.rdType;
     this.rdTypeName = rt.rdTypeName;
     this.CanLendQty = rt.CanLendQty;
     this.CanLendDay = rt.CanLendDay;
     this.CanContinueTimes = rt.CanContinueTimes;
     this.PunishRate = rt.PunishRate;
     this.DateValid = rt.DateValid;
 }
示例#4
0
 //删除
 public static int Delete(ReaderType readertype)
 {
     int rows = 0;
     string sql = "delete from ReaderType where rdType=@rdType";
     SqlParameter[] parameters = { new SqlParameter("@rdType", readertype.rdType) };
     try
     {
         rows = SqlHelper.ExecuteNonQuery(sql, parameters);
     }
     catch (SqlException ex)
     {
         throw new Exception(ex.Message);
     }
     return rows;
 }
示例#5
0
 //插入
 public static int Insert(ReaderType readertype)
 {
     int rows = 0;
     string sql = "insert into ReaderType(rdType,rdTypeName,CanLendQty,CanLendDay,CanContinueTimes,PunishRate,DateValid)"
                      + "values (@rdType,@rdTypeName,@CanLendQty,@CanLendDay,@CanContinueTimes,@PunishRate,@DateValid)";
     SqlParameter[] parameters ={
                                    new SqlParameter("@rdType",readertype.rdType),
                                    new SqlParameter("@rdTypeName",readertype.rdTypeName),
                                    new SqlParameter("@CanLendQty",readertype.CanLendQty),
                                    new SqlParameter("@CanLendDay",readertype.CanLendDay),
                                    new SqlParameter("@CanContinueTimes",readertype.CanContinueTimes),
                                    new SqlParameter("@PunishRate",readertype.PunishRate),
                                    new SqlParameter("@DateValid",readertype.DateValid)
                               };
     try
     {
         rows = SqlHelper.ExecuteNonQuery(sql, parameters);
     }
     catch(SqlException ex)
     {
         throw new Exception(ex.Message);
     }
     return rows;
 }
示例#6
0
 //更新
 public static int Update(ReaderType readertype)
 {
     int rows = 0;
     string sql = "update ReaderType set "
         + "rdType=@rdType,"
         + "rdTypeName=@rdTypeName,"
         + "CanLendQty=@CanLendQty,"
         + "CanLendDay=@CanLendDay,"
         + "CanContinueTimes=@CanContinueTimes,"
         + "PunishRate=@PunishRate,"
         + "DateValid=@DateValid "
         + "where rdType=@rdType";
     SqlParameter[] parameters ={
                                    new SqlParameter("@rdType",readertype.rdType),
                                    new SqlParameter("@rdTypeName",readertype.rdTypeName),
                                    new SqlParameter("@CanLendQty",readertype.CanLendQty),
                                    new SqlParameter("@CanLendDay",readertype.CanLendDay),
                                    new SqlParameter("@CanContinueTimes",readertype.CanContinueTimes),
                                    new SqlParameter("@PunishRate",readertype.PunishRate),
                                    new SqlParameter("@DateValid",readertype.DateValid)
                               };
     try
     {
         rows = SqlHelper.ExecuteNonQuery(sql, parameters);
     }
     catch (SqlException ex)
     {
         throw new Exception(ex.Message);
     }
     return rows;
 }