usersellshop.java

来自「一个仿造淘宝的jsp网站。功能比较完善」· Java 代码 · 共 46 行

JAVA
46
字号
package com.jc.taobao.gjj.logic;

import java.util.ArrayList;

import com.jc.taobao.gjj.entity.ShopInfo;
import com.jc.taobao.gjj.entity.ShopNuminfo;
import com.jc.taobao.gjj.entity.TypeInfo;
import com.jc.taobao.gjj.entity.UserInfo;

public class UserSellShop {
	 public synchronized int UserSellShopissucessorfail(ShopInfo shop, UserInfo user,
			int number, String shoppic, String servicepath) {
		try {
			ShopInfoBean shopbean = new ShopInfoBean();
			AscendingPhoto ap = new AscendingPhoto();
			ap.IOImage(shoppic, servicepath);

			/* 查询出对应的用户编号 */
			UserInfoBean ubean = new UserInfoBean();
			ArrayList al2 = (ArrayList) ubean.getquerybyuserusename(user);
			UserInfo user2 = (UserInfo) al2.get(0);
			int userid = user2.getUserid();
            int shopid=shopbean.save2(shop);
			if (shopid > 0) {

				/* 为库存表添加数据 */
				ShopNuminfoBean sb = new ShopNuminfoBean();
				ShopNuminfo shn=new ShopNuminfo();
				shn.setSid(shopid);
				shn.setShopnumber(number);

				if (sb.save(shn) > 0) {
					return shopid;
				} else {
					return 0;
				}
			} else {
				return 0;
			}
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			return 0;
		}
	}
}

⌨️ 快捷键说明

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