using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using System.Data;
|
|
namespace DAL
|
{
|
public class ClsK3_Supplier_Ctl:DBUtility.ClsGy_Base_Ctl
|
{
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
SQLHelper.ClsCNK3 oK3Cn = new SQLHelper.ClsCNK3();
|
|
public Model.ClsK3_Supplier_Model oModel ;
|
//新增
|
public override bool AddNew()
|
{
|
|
try
|
{
|
oCn.BeginTran();
|
base.DeleteByID(oModel.HItemID);
|
oCn.RunProc("Insert into " + MvarItemKey + " " +
|
" (HItemID,HNumber,HBarCode)" +
|
" Values(" + oModel.HItemID.ToString() + ",'" + oModel.HNumber + "','" + oModel.HBarCode + "')", ref DBUtility.ClsPub.sExeReturnInfo);
|
oCn.Commit();
|
return true;
|
}
|
catch (Exception e)
|
{
|
oCn.RollBack();
|
throw (e);
|
}
|
}
|
|
//K3单据新增
|
public bool AddNew_K3()
|
{
|
try
|
{
|
oK3Cn.BeginTran();
|
oK3Cn.RunProc("exec h_p_K3_Gy_AddSupplier " + oModel.HLevel.ToString() + "," + oModel.HParentID.ToString() + "," + DBUtility.ClsPub.BoolToString(oModel.HEndFlag) + ",'" + oModel.HShortNumber + "'" +
|
",'" + oModel.HName + "','" + oModel.HNumber + "','" + oModel.HHelpCode + "','" + oModel.HShortName + "','" + oModel.HAddress + "'" +
|
",'" + oModel.HContact + "','" + oModel.HPhone + "','" + oModel.HMobilePhone + "','" + oModel.HFax + "','" + oModel.HPostalCode + "'" +
|
",'" + oModel.HEmail + "','" + oModel.HBank + "','" + oModel.HAccount + "'"
|
, ref DBUtility.ClsPub.sExeReturnInfo);
|
oK3Cn.Commit();
|
return true;
|
}
|
catch (Exception e)
|
{
|
oK3Cn.RollBack();
|
throw (e);
|
}
|
}
|
|
|
//根据代码判断信息
|
public bool HavParentCode(string sCode, ref Int64 sItemID)
|
{
|
DataSet DS;
|
try
|
{
|
DS = oK3Cn.RunProcReturn("Select FItemID from t_Item Where FDeleted=0 and fitemclassid=8 and FNumber='" + sCode + "' ", "t_Item", ref Pub_Class.ClsPub.sExeReturnInfo);
|
if (DS.Tables[0].Rows.Count == 0)
|
return false;
|
else
|
{
|
sItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["FItemID"]);
|
return true;
|
}
|
}
|
catch (Exception e)
|
{
|
throw (e);
|
}
|
}
|
|
//构造函数
|
public ClsK3_Supplier_Ctl()
|
{
|
MvarItemKey = "K3_Supplier_Extend";
|
MvarReportTitle = "供应商设置";
|
oModel = new Model.ClsK3_Supplier_Model();
|
}
|
}
|
}
|