Ejemplo n.º 1
0
        public void updateList(T_PaymentIndecreaseList item)
        {
            Database db  = Dao.GetDatabase();
            string   sql = @"UPDATE [dbo].[payment_Indecrease_list]
						   SET [amount] = @amount
							  ,[name] = @NAME
							  ,[type] = @TYPE
							  ,[apply_date] = @apply_date
							  ,[note] = @note
						 WHERE [bill_no] = @bill_no
								AND [g_no] = @g_no "                                ;

            using (DbConnection cn = db.CreateConnection())
            {
                try
                {
                    DbCommand cmd = db.GetSqlStringCommand(sql);
                    db.AddInParameter(cmd, "@amount", DbType.Decimal, item.Amount);
                    db.AddInParameter(cmd, "@NAME", DbType.String, item.Name);
                    db.AddInParameter(cmd, "@TYPE", DbType.String, item.Type);
                    db.AddInParameter(cmd, "@apply_date", DbType.DateTime, item.ApplyDate);
                    db.AddInParameter(cmd, "@note", DbType.String, item.Note);
                    db.AddInParameter(cmd, "@bill_no", DbType.String, item.BillNo);
                    db.AddInParameter(cmd, "@g_no", DbType.Int32, item.GNo);
                    db.ExecuteNonQuery(cmd);
                }
                catch
                {
                    throw new Exception("更新增减单表体数据失败,请检查人品");
                }
            }
        }
 public void updateList(T_PaymentIndecreaseList item)
 {
     Manager.updateList(item);
 }