/// <summary> /// 获取耗材修改字段dt /// </summary> /// <param name="newInfo">修改后的耗材信息</param> /// <returns>耗材修改字段dt</returns> public DataTable GetChangedFields(ConsumableInfo newInfo) { DataTable dt = new DataTable(); dt.Columns.Add("FieldName"); dt.Columns.Add("OldValue"); dt.Columns.Add("NewValue"); if (this.FujiClass2.ID != newInfo.FujiClass2.ID) { dt.Rows.Add("ConsumableFujiClass2", SQLUtil.TrimNull(this.FujiClass2.Name), SQLUtil.TrimNull(newInfo.FujiClass2.Name)); } if (this.Name != SQLUtil.TrimNull(newInfo.Name)) { dt.Rows.Add("ConsumableName", this.Name, newInfo.Name); } if (this.Description != SQLUtil.TrimNull(newInfo.Description)) { dt.Rows.Add("ConsumableDescription", this.Description, SQLUtil.TrimNull(newInfo.Description)); } if (this.Type.ID != newInfo.Type.ID) { dt.Rows.Add("ConsumableType", this.Type.Name, LookupManager.GetConsumabletypeDesc(newInfo.Type.ID)); } if (this.StdPrice != newInfo.StdPrice) { dt.Rows.Add("ConsumableStdPrice", SQLUtil.ConvertDouble(this.StdPrice), SQLUtil.ConvertDouble(newInfo.StdPrice)); } if (this.ReplaceTimes != newInfo.ReplaceTimes) { dt.Rows.Add("ConsumableReplaceTimes", SQLUtil.ConvertDouble(this.ReplaceTimes), SQLUtil.ConvertDouble(newInfo.ReplaceTimes)); } if (this.CostPer != newInfo.CostPer) { dt.Rows.Add("ConsumableCostPer", SQLUtil.ConvertDouble(this.CostPer), SQLUtil.ConvertDouble(newInfo.CostPer)); } if (this.IsIncluded != newInfo.IsIncluded) { dt.Rows.Add("ConsumableIsIncluded", SQLUtil.ConvertBoolean(this.IsIncluded) ? "是" : "否", SQLUtil.ConvertBoolean(newInfo.IsIncluded) ? "是" : "否"); } if (this.IncludeContract != newInfo.IncludeContract) { dt.Rows.Add("ConsumableIncludeContract", SQLUtil.ConvertBoolean(this.IncludeContract) ? "是" : "否", SQLUtil.ConvertBoolean(newInfo.IncludeContract) ? "是" : "否"); } if (this.IsActive != newInfo.IsActive) { dt.Rows.Add("ConsumableIsActive", SQLUtil.ConvertBoolean(this.IsActive) ? "启用" : "停用", SQLUtil.ConvertBoolean(newInfo.IsActive) ? "启用" : "停用"); } return(dt); }
/// <summary> /// 耗材info /// </summary> /// <param name="dr">dr</param> public ConsumableInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.FujiClass2.ID = SQLUtil.ConvertInt(dr["FujiClass2ID"]); this.FujiClass2.Name = SQLUtil.TrimNull(dr["FujiClass2Name"]); this.Name = SQLUtil.TrimNull(dr["Name"]); this.Description = SQLUtil.TrimNull(dr["Description"]); this.Type.ID = SQLUtil.ConvertInt(dr["TypeID"]); this.Type.Name = LookupManager.GetConsumabletypeDesc(this.Type.ID); this.ReplaceTimes = SQLUtil.ConvertDouble(dr["ReplaceTimes"]); this.CostPer = SQLUtil.ConvertDouble(dr["CostPer"]); this.StdPrice = SQLUtil.ConvertDouble(dr["StdPrice"]); this.IsIncluded = SQLUtil.ConvertBoolean(dr["IsIncluded"]); this.IncludeContract = SQLUtil.ConvertBoolean(dr["IncludeContract"]); this.IsActive = SQLUtil.ConvertBoolean(dr["IsActive"]); this.AddDate = SQLUtil.ConvertDateTime(dr["AddDate"]); this.UpdateDate = SQLUtil.ConvertDateTime(dr["UpdateDate"]); }