public override bool Equals(object obj) { ScmsBom another = obj as ScmsBom; if (another == null) { return(false); } else { return(this.Bom == another.Bom && this.ItemCode == another.ItemCode); } }
private void ProcessMesBomDetailOut(ScmsTableIndex scmsTableIndex) { IList<MesBom> bomList = GetTransferBom(); if (bomList != null && bomList.Count > 0) { foreach (MesBom mesBom in bomList) { try { IList<MesBomDetail> scmsBomDetailList = mesBomDetailMgr.GetBomDetailList(mesBom); if (scmsBomDetailList != null && scmsBomDetailList.Count > 0) { foreach (MesBomDetail mesBomDetail in scmsBomDetailList) { ScmsBom scmsBom = scmsBomMgr.LoadScmsBom(mesBomDetail.Bom.Code, mesBomDetail.Item.Code); if (scmsBom == null) { scmsBom = new ScmsBom(); scmsBom.Bom = mesBomDetail.Bom.Code; scmsBom.Flag = mesBomDetail.IsActive ? MesDssConstants.SCMS_MES_FLAG_SCMS_UPDATED : MesDssConstants.SCMS_MES_FLAG_SCMS_DELETE; scmsBom.ItemCode = mesBomDetail.Item.Code; scmsBom.LastModifyDate = DateTime.Now; scmsBom.LastModifyUser = userMgr.GetMonitorUser().Code; scmsBom.Qty = mesBomDetail.RateQty; scmsBomMgr.CreateScmsBom(scmsBom); } else { //DJIN 20120817 scmsBom.Flag = mesBomDetail.IsActive || !mesBomDetail.EndDate.HasValue ? MesDssConstants.SCMS_MES_FLAG_SCMS_UPDATED : MesDssConstants.SCMS_MES_FLAG_SCMS_DELETE; scmsBom.LastModifyDate = DateTime.Now; scmsBom.LastModifyUser = userMgr.GetMonitorUser().Code; scmsBom.Qty = mesBomDetail.RateQty; scmsBomMgr.UpdateScmsBom(scmsBom); } } } mesBom.TransferFlag = false; mesBomMgr.UpdateBom(mesBom); } catch (Exception e) { log.Error(mesBom.Code + " create exception", e); continue; } } } scmsTableIndexMgr.Complete(scmsTableIndex); }
public virtual void DeleteScmsBom(ScmsBom entity) { entityDao.Delete(entity); }
public virtual void UpdateScmsBom(ScmsBom entity) { entityDao.Update(entity); }
public virtual void CreateScmsBom(ScmsBom entity) { entityDao.Create(entity); }