/// <summary> /// ** 功能描述: 获得相同机种、经销商、发货日期的出货单信息 /// ** 作 者: Jane Shu /// ** 日 期: 2005-07-29 /// ** 修 改: /// ** 日 期: /// Laws Lu,2005/09/20,修改 排除删除状态的出货单 /// Karron Qiu,2005/09/20 ,修改,只查询初始状态的出货单 /// </summary> /// <param name="materialStockOut">包含出货单号、机种、经销商、发货日期</param> /// <returns></returns> public object GetMaterialStockOut(MaterialStockOut materialStockOut) { object[] objs = this.DataProvider.CustomQuery(typeof(MaterialStockOut), new SQLParamCondition(string.Format("select {0} from TBLMSTOCKOUT where TKTNO=$TKTNO and MODELCODE=$MODELCODE and upper(DEALER)=$DEALER and OUTDATE=$OUTDATE AND STATUS = '" + StockStatus.Initial + "' order by seq desc", DomainObjectUtility.GetDomainObjectFieldsString(typeof(MaterialStockOut))), new SQLParameter[] { new SQLParameter("TKTNO", typeof(string), materialStockOut.TicketNO), new SQLParameter("MODELCODE", typeof(string), materialStockOut.ModelCode), new SQLParameter("DEALER", typeof(string), materialStockOut.Dealer.ToUpper()), new SQLParameter("OUTDATE", typeof(int), materialStockOut.OutDate) })); if (objs != null) { return(objs[0]); } return(null); }
/// <summary> /// ** 功能描述: 判断是否有相同机种、经销商、发货日期的出货单存在 /// 如果存在返回流水号 /// 如果不存在,则产生新的流水号,将出货单信息新增入表中,并返回生成的流水号 /// /// 返回结果 /// ** 作 者: Jane Shu /// ** 日 期: 2005-07-29 /// ** 修 改: Karron Qiu /// ** 日 期: 2005-9-19 /// </summary> /// <param name="materialStockOut"></param> /// <returns></returns> public MaterialStockOut AddMaterialStockOut(MaterialStockOut materialStockOut) { MaterialStockOut stockOut = (MaterialStockOut)this.GetMaterialStockOut(materialStockOut); //Laws Lu,2005/09/10 修改 // if ( stockOut != null ) // { // throw new Exception(string.Format("$Error_CS_Stock_Info_Exist $StockOutTicket={0},$ModelCode={1},$Dealer={2},$OutDate={3}", // materialStockOut.TicketNO, // materialStockOut.ModelCode, // materialStockOut.Dealer, // FormatHelper.ToDateString(materialStockOut.OutDate)) ); // } // // materialStockOut.Sequence = this.GetUniqueSequenceByTicketNo( materialStockOut.TicketNO ); // materialStockOut.Status = StockStatus.Initial; // materialStockOut.MaintainDate = FormatHelper.TODateInt(DateTime.Now); // materialStockOut.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now); if (stockOut == null) { //karron qiu ,2005/9/16 ,增加OID主键 materialStockOut.OID = Guid.NewGuid().ToString(); materialStockOut.Sequence = this.GetUniqueSequenceByTicketNo(materialStockOut.TicketNO); materialStockOut.Status = StockStatus.Initial; //2006/11/17,Laws Lu add get DateTime from db Server DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); DateTime dtNow = FormatHelper.ToDateTime(dbDateTime.DBDate, dbDateTime.DBTime); materialStockOut.MaintainDate = FormatHelper.TODateInt(dtNow); materialStockOut.MaintainTime = FormatHelper.TOTimeInt(dtNow); this.DataProvider.Insert(materialStockOut); stockOut = materialStockOut; } return(stockOut); }
/// <summary> /// 获得明细数量 added by karron qiu ,2005-9-19 /// </summary> /// <param name="materialStockOut"></param> /// <returns></returns> public int GetMaterialStockOutDetailCount(MaterialStockOut materialStockOut) { return(this.DataProvider.GetCount(new SQLCondition("select count(*) from TBLMSTOCKOUTDETAIL where TKTNO='" + materialStockOut.TicketNO + "' and SEQ=" + materialStockOut.Sequence))); }
//Laws Lu,2005/09/05, 更新出库单 public void UpdateMaterialStockOut(MaterialStockOut materialStockOut) { this._helper.UpdateDomainObject(materialStockOut); }