⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 additemaction.java

📁 基于ssh2的三者整合
💻 JAVA
字号:
package com.lixineng.action;

import java.util.*;

import com.lixineng.action.base.BaseAction;
import com.opensymphony.xwork2.ActionContext;
import com.lixineng.service.AuctionService;
import com.lixineng.exception.AuctionException;



/**
 * @author  yeeku.H.lee kongyeeku@163.com
 * @version  1.0
 * <br>Copyright (C), 2005-2008, yeeku.H.Lee
 * <br>This program is protected by copyright laws.
 * <br>Program Name:
 * <br>Date: 
 */
public class AddItemAction extends BaseAction
{
	private String name;
	private String desc;
	private String remark;
	private double initPrice;
	private int avail;
	private int kind;
	private String vercode;
	

	public String execute() throws Exception
	{
		Map session = ActionContext.getContext().getSession();
        String ver2 = (String)session.get("rand");
        session.put("rand" , null);
        Integer userId = (Integer)session.get("userId");
        
        if (vercode.equalsIgnoreCase(ver2))
        {                
            switch(avail)
            {
                case 6 :
                    avail = 7;
                    break;
                case 7 :
                    avail = 30;
                    break;
                case 8 :
                    avail = 365;
                    break;
            }
            aucService.addItem(name , desc , remark , initPrice ,avail , kind, userId);
            return SUCCESS;
           
        }
        else
        {
            addActionError("验证码不匹配,请重新输入");
            return INPUT;
        }
	}

	public void setName(String name)
	{
		this.name = name;
	}
	public String getName()
	{
		 return this.name;
	}

	public void setDesc(String desc)
	{
		this.desc = desc;
	}
	public String getDesc()
	{
		 return this.desc;
	}

	public void setRemark(String remark)
	{
		this.remark = remark;
	}
	public String getRemark()
	{
		 return this.remark;
	}

	public void setInitPrice(double initPrice)
	{
		this.initPrice = initPrice;
	}
	public double getInitPrice()
	{
		 return this.initPrice;
	}

	public void setAvail(int avail)
	{
		this.avail = avail;
	}
	public int getAvail()
	{
		 return this.avail;
	}

	public void setKind(int kind)
	{
		this.kind = kind;
	}
	public int getKind()
	{
		 return this.kind;
	}

	public void setVercode(String vercode)
	{
		this.vercode = vercode;
	}
	public String getVercode()
	{
		 return this.vercode;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -