package com.steering.pss.plnsaleord.steelMarkingPlan;

import com.steering.comm.db.DBCommon;

import CoreFS.SA06.CoreReturnObject;

/**
 * 连铸规格切头尾参数
 * 
 * @author Administrator
 * 
 */
public class FrmBaseLzSpecCut extends DBCommon {

	/**
	 * 初始化规格
	 * 
	 * @param mscStyle
	 * @return
	 */
	public CoreReturnObject InitSpec(String mscStyle) {
		Object[] params = new Object[] { mscStyle };
		return this.getDataBySqlID("FrmBaseLzSpecCut.InitSpec", params);
	}

	/**
	 * 查询
	 * 
	 * @return
	 */
	public CoreReturnObject query() {
		return this.getDataBySqlID("FrmBaseLzSpecCut.Query");
	}

	/**
	 * 验证规格
	 * 
	 * @param dimater
	 * @return
	 */
	public CoreReturnObject checkSpec(String dimater) {
		Object[] params = new Object[] { dimater };
		return this.getDataBySqlID("FrmBaseLzSpecCut.checkSpec", params);
	}

	/**
	 * 新增
	 * 
	 * @param dimater
	 *            直径
	 * @param cutLenBegin
	 *            　切头
	 * @param cutLenEndUnch
	 *            　不换中包切尾长（m）
	 * @param cutLenEndCh
	 *            　　换中包切尾长（m）
	 * @return
	 */
	public CoreReturnObject add(String dimater, String cutLenBegin,
			String cutLenEndUnch, String cutLenEndCh, String username) {
		Object[] params = new Object[] {
				"D" + String.valueOf((int) (Double.parseDouble(dimater))),
				dimater, cutLenBegin, cutLenEndUnch, cutLenEndCh, username };
		return this.setDataBySqlID("FrmBaseLzSpecCut.add", params);
	}

	/**
	 * 修改
	 * 
	 * @param dimater
	 *            直径
	 * @param cutLenBegin
	 *            　切头
	 * @param cutLenEndUnch
	 *            　不换中包切尾长（m）
	 * @param cutLenEndCh
	 *            　　换中包切尾长（m）
	 * @return
	 */
	public CoreReturnObject update(String dimater, String cutLenBegin,
			String cutLenEndUnch, String cutLenEndCh, String username) {
		Object[] params = new Object[] { cutLenBegin, cutLenEndUnch,
				cutLenEndCh, username,
				"D" + String.valueOf((int) (Double.parseDouble(dimater))) };
		return this.setDataBySqlID("FrmBaseLzSpecCut.update", params);
	}

	/**
	 * 删除
	 * 
	 * @param dimater
	 *            直径
	 * @return
	 */
	public CoreReturnObject delete(String dimater) {
		Object[] params = new Object[] { dimater };
		return this.setDataBySqlID("FrmBaseLzSpecCut.delete", params);
	}
}
