/// <summary> /// 保存交接样记录的交样 /// </summary> /// <returns></returns> public bool SaveHandSamplingReceive(string sampleId, string makeReceivePle, DateTime makeReceiveDate) { CmcsRCSampling sampling = Dbers.GetInstance().SelfDber.Get <CmcsRCSampling>(sampleId); CmcsRCHandSampling handSampling = Dbers.GetInstance().SelfDber.Entity <CmcsRCHandSampling>("where SamplingId=:SamplingId order by CreateDate desc", new { SamplingId = sampleId }); if (handSampling == null) { handSampling = new CmcsRCHandSampling(); handSampling.SamplingSendPle = sampling != null ? sampling.SamplingPle : ""; handSampling.SamplingSendDate = sampleId != null ? sampling.SamplingDate : DateTime.MinValue; handSampling.SamplingId = sampleId; handSampling.MakeReceivePle = makeReceivePle; handSampling.MakeReceiveDate = makeReceiveDate; return(Dbers.GetInstance().SelfDber.Insert(handSampling) > 0); } CmcsRCMake make = Dbers.GetInstance().SelfDber.Entity <CmcsRCMake>("where SamplingId=:SamplingId order by Createdate desc", new { SamplingId = sampleId }); if (make != null) { make.GetPle = makeReceivePle; make.GetDate = makeReceiveDate; make.IsHandOver = 1; Dbers.GetInstance().SelfDber.Update(make); } handSampling.MakeReceivePle = makeReceivePle; handSampling.MakeReceiveDate = makeReceiveDate; return(Dbers.GetInstance().SelfDber.Update(handSampling) > 0); }
/// <summary> /// 保存交接样记录的交样 /// </summary> /// <returns></returns> public bool SaveHandSamplingSend(string sampleId, string samplingSendPle, DateTime samplingSendDate) { CmcsRCHandSampling handSampling = Dbers.GetInstance().SelfDber.Entity <CmcsRCHandSampling>("where SamplingId=:SamplingId order by CreateDate desc", new { SamplingId = sampleId }); if (handSampling == null) { handSampling = new CmcsRCHandSampling(); handSampling.SamplingId = sampleId; handSampling.SamplingSendPle = samplingSendPle; handSampling.SamplingSendDate = samplingSendDate; handSampling.Remark = "人工制样间自动生成"; return(Dbers.GetInstance().SelfDber.Insert(handSampling) > 0); } handSampling.SamplingSendPle = samplingSendPle; handSampling.SamplingSendDate = samplingSendDate; return(Dbers.GetInstance().SelfDber.Update(handSampling) > 0); }