You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
2.5 KiB
107 lines
2.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Data;
|
|
|
|
namespace SiaSun.LMS.Implement
|
|
{
|
|
public class PlanImport:S_BaseService
|
|
{
|
|
public PlanImport()
|
|
{
|
|
}
|
|
|
|
|
|
public bool PlanCreate(SiaSun.LMS.Model.PLAN_MAIN mPLAN_MAIN,
|
|
IList<SiaSun.LMS.Model.PLAN_LIST> lsPLAN_LIST,
|
|
out string sResult)
|
|
{
|
|
bool bResult = true;
|
|
|
|
sResult = string.Empty;
|
|
|
|
int iReturn = 0;
|
|
|
|
try
|
|
{
|
|
this._P_Base_House.BeginTransaction();
|
|
|
|
if (null != this._P_PLAN_MAIN.GetModelPlanCode(mPLAN_MAIN.PLAN_CODE))
|
|
{
|
|
bResult = false;
|
|
|
|
sResult = string.Format("{0}单号已经存在!", mPLAN_MAIN.PLAN_CODE);
|
|
|
|
return bResult;
|
|
}
|
|
|
|
this._P_PLAN_MAIN.Add(mPLAN_MAIN);
|
|
|
|
|
|
|
|
foreach (SiaSun.LMS.Model.PLAN_LIST mPLAN_LIST in lsPLAN_LIST)
|
|
{
|
|
|
|
|
|
if (mPLAN_LIST.PLAN_ID.Equals(0))
|
|
{
|
|
mPLAN_LIST.PLAN_ID = mPLAN_MAIN.PLAN_ID;
|
|
this._P_PLAN_LIST.Add(mPLAN_LIST);
|
|
}
|
|
else
|
|
{
|
|
this._P_PLAN_LIST.Update(mPLAN_LIST);
|
|
}
|
|
}
|
|
|
|
iReturn = this.ExecuteNonQuery_ReturnInt(string.Format(" update u5wmcsinterface set wmi_status = '3' where wmi_taskno = '{0}'", mPLAN_MAIN.PLAN_CODE),"ERPMap");
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
bResult = false;
|
|
|
|
sResult = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
if (iReturn>0)
|
|
{
|
|
this._P_Base_House.CommitTransaction();
|
|
}
|
|
else
|
|
{
|
|
this._P_Base_House.RollBackTransaction();
|
|
}
|
|
}
|
|
|
|
|
|
return bResult;
|
|
}
|
|
|
|
public bool GoodsCreate(SiaSun.LMS.Model.GOODS_MAIN mGOODS_MAIN, out string sResult)
|
|
{
|
|
|
|
bool bResult = true;
|
|
|
|
sResult = string.Empty;
|
|
|
|
int iReturn= this._P_GOODS_MAIN.Add(mGOODS_MAIN);
|
|
|
|
|
|
if (iReturn == 0)
|
|
{
|
|
sResult = "导入ERP物料失败!";
|
|
|
|
bResult = false;
|
|
}
|
|
|
|
return bResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|