Exemplo n.º 1
0
 protected override void AfterSave(System.Data.IDbTransaction trans)
 {
     if (this.DataState == DataRowState.Modified)
     {
         if (this.ReportValSource == "人工")
         {
             QC_Log log = new QC_Log();
             log.BillId         = this.Sample_Value_ID;
             log.OperateType    = "报检值修改";
             log.OperateContent = string.Format("项目编码:{0},项目名称:{1},原值:{2},新值:{3}", this.CheckItemCode, this.CheckItemName, this._Ori_ReportVal, this.ReportVal);
             log.OperateUser    = LocalInfo.Current.user.ID;
             log.OperateTime    = DateTime.Now;
             log.Save();
         }
         if (this._Ori_CheckVal != this._CheckVal)
         {
             QC_Log log = new QC_Log();
             log.BillId         = this.Sample_Value_ID;
             log.OperateType    = "检验值修改";
             log.OperateContent = string.Format("项目编码:{0},项目名称:{1},原值:{2},新值:{3}", this.CheckItemCode, this.CheckItemName, this._Ori_CheckVal, this._CheckVal);
             log.OperateUser    = LocalInfo.Current.user.ID;
             log.OperateTime    = DateTime.Now;
             log.Save();
         }
     }
     base.AfterSave(trans);
 }
Exemplo n.º 2
0
        protected override void AfterSave(IDbTransaction trans)
        {
            if (SaveIcInfo && IcInfo != null)
            {
                if (this.DataState == DataRowState.Deleted)
                {
                    QC_IC_Info.UnBinding(this.CardID);
                    this.IcInfo = null;
                }
                IcInfo.SampleId = this.Sample_Veh_ID;
                IcInfo.Save(trans);
            }

            if (this.SaveCheckItems)
            {
                if (this.DataState == DataRowState.Deleted)
                {
                    CheckItems.DeleteBySampleVehId(this.Sample_Mix_ID);
                    CheckItems.Empty();
                }
                else
                {
                    foreach (var item in CheckItems)
                    {
                        item.Sample_Veh_ID = this.Sample_Veh_ID;
                    }
                }
                CheckItems.Save();
            }

            if (this.DataState == DataRowState.Deleted)
            {
                DbContext.ExeSql("Update QC_IC_Info Set SampleId=0 where SampleId=@Sample_Veh_ID and CardType=@CardType", this.Sample_Veh_ID, QC_IC_Info.CardUseType_Veh);
            }

            if (this.DataState == DataRowState.Modified)
            {
                if (this._Ori_KouShui != this._KouShui || this._Ori_KouZa != this._KouZa)
                {
                    QC_Log log = new QC_Log();
                    log.BillId         = this.Sample_Veh_ID.ToString();
                    log.OperateType    = "扣水扣杂修改";
                    log.OperateContent = string.Format("扣水原值:{0},扣水新值:{1},扣杂原值:{2},扣杂新值:{3}", this._Ori_KouShui, this._KouShui, _Ori_KouZa, _KouZa);
                    log.OperateUser    = LocalInfo.Current.user.ID;
                    log.OperateTime    = DateTime.Now;
                    log.Save();
                }
            }
            base.AfterSave(trans);
        }