public CRMAuditLog Insert(CRMAuditLog entity) { if (this.dataCtx.Connection != null) { if (this.dataCtx.Connection.State == ConnectionState.Closed) { this.dataCtx.Connection.Open(); } } DbTransaction tran = this.dataCtx.Connection.BeginTransaction(); dataCtx.Transaction = tran; try { this.CRMAuditLogs.InsertOnSubmit(entity); this.dataCtx.SubmitChanges(); tran.Commit(); return(entity); } catch (Exception ex) { tran.Rollback(); throw ex; } finally { dataCtx.Connection.Close(); } }
public CRMAuditLog Insert(CRMAuditLog entity) { if (this.dataCtx.Connection != null) if (this.dataCtx.Connection.State == ConnectionState.Closed) this.dataCtx.Connection.Open(); DbTransaction tran = this.dataCtx.Connection.BeginTransaction(); dataCtx.Transaction = tran; try { this.CRMAuditLogs.InsertOnSubmit(entity); this.dataCtx.SubmitChanges(); tran.Commit(); return entity; } catch (Exception ex) { tran.Rollback(); throw ex; } finally { dataCtx.Connection.Close(); } }
public void AddAuditLog(long CustID, long ActionBy, string LogInfo) { if (this.dataCtx.Connection != null) { if (this.dataCtx.Connection.State == ConnectionState.Closed) { this.dataCtx.Connection.Open(); } } CRMAuditLog Log = new CRMAuditLog(); Log.Action = "SaveCustomer"; //界面显示时再转成多语言 SaveCustomer,SaveDeal,SaveUser Log.ActionAt = DateTime.Now; Log.ActionBy = ActionBy; Log.PKId = CustID; Log.ActionLog = LogInfo; this.CRMAuditLogs.InsertOnSubmit(Log); this.dataCtx.SubmitChanges(); if (this.dataCtx.Connection != null) { if (this.dataCtx.Connection.State != ConnectionState.Closed) { this.dataCtx.Connection.Close(); } } }
//如果该方法在save方法调用,已经有Transaction了,就不要打开关闭db连接 public void AddAuditLog(string ActionLog, long ModifyUserID, long PKID) { if (this.dataCtx.Transaction == null) { if (this.dataCtx.Connection != null) { if (this.dataCtx.Connection.State == ConnectionState.Closed) { this.dataCtx.Connection.Open(); } } } CRMAuditLog Log = new CRMAuditLog(); Log.Action = "SaveTicket"; //界面显示时再转成多语言 SaveCustomer,SaveDeal,SaveUser Log.ActionAt = DateTime.Now; Log.ActionBy = ModifyUserID; Log.PKId = PKID; Log.ActionLog = ActionLog; this.CRMAuditLogs.InsertOnSubmit(Log); if (this.dataCtx.Transaction == null) { this.dataCtx.SubmitChanges(); if (this.dataCtx.Connection != null) { if (this.dataCtx.Connection.State != ConnectionState.Closed) { this.dataCtx.Connection.Close(); } } } }
//如果该方法在save方法调用,已经有Transaction了,就不要打开关闭db连接 public void AddAuditLog(string ActionLog, long ModifyUserID, long PKID) { if (this.dataCtx.Transaction == null) { if (this.dataCtx.Connection != null) if (this.dataCtx.Connection.State == ConnectionState.Closed) this.dataCtx.Connection.Open(); } CRMAuditLog Log = new CRMAuditLog(); Log.Action = "SaveTicket"; //界面显示时再转成多语言 SaveCustomer,SaveDeal,SaveUser Log.ActionAt = DateTime.Now; Log.ActionBy = ModifyUserID; Log.PKId = PKID; Log.ActionLog = ActionLog; this.CRMAuditLogs.InsertOnSubmit(Log); if (this.dataCtx.Transaction == null) { this.dataCtx.SubmitChanges(); if (this.dataCtx.Connection != null) if (this.dataCtx.Connection.State != ConnectionState.Closed) this.dataCtx.Connection.Close(); } }
public void AddAuditLog(long CustID, long ActionBy, string LogInfo) { if (this.dataCtx.Connection != null) if (this.dataCtx.Connection.State == ConnectionState.Closed) this.dataCtx.Connection.Open(); CRMAuditLog Log = new CRMAuditLog(); Log.Action = "SaveCustomer"; //������ʾʱ��ת�ɶ����� SaveCustomer,SaveDeal,SaveUser Log.ActionAt = DateTime.Now; Log.ActionBy = ActionBy; Log.PKId = CustID; Log.ActionLog = LogInfo; this.CRMAuditLogs.InsertOnSubmit(Log); this.dataCtx.SubmitChanges(); if (this.dataCtx.Connection != null) if (this.dataCtx.Connection.State != ConnectionState.Closed) this.dataCtx.Connection.Close(); }
//���бȽϿͻ������� private void AddAuditLog(CRMCustomer oldCust, CRMCustomer newCust) { #region ID to Name using DataTable Select Method DataTable dtCustType = base.GetCustType(); DataTable dtCustRelation = base.GetCustRelation(); //DataTable dtCustIndustry = base.GetCustIndustry(); DataTable dtCustEmpNum = base.GetCustEmpNum(); DataTable dtCountry = base.GetCountry(); DataTable dtUser = base.GetUser(); string oldCustType = "", newCustType; string oldCustRelation, newCustRelation; //string oldCustIndustry, newCustIndustry; string oldCustEmpNum, newCustEmpNum; string oldCountry, newCountry; string oldOwner="", newOwner=""; if (oldCust.CustOwnerID == 0) oldOwner = ""; else { var drs =dtUser.Select("UserID=" + oldCust.CustOwnerID); if (drs.Length > 0) oldOwner = drs[0]["UserFullName"].ToString(); else oldOwner = ""; } if(newCust.CustOwnerID!=0) { var drs = dtUser.Select("UserID=" + newCust.CustOwnerID); newOwner = drs[0]["UserFullName"].ToString(); } //------------------------------------- oldCustType = dtCustType.Select("CustTypeID=" + oldCust.CustTypeID)[0]["CustType"].ToString(); newCustType = dtCustType.Select("CustTypeID=" + newCust.CustTypeID)[0]["CustType"].ToString(); //------------------------------------- if (oldCust.CustRelationID == null) oldCustRelation = ""; else { DataRow[] drs = dtCustRelation.Select("RelationID=" + oldCust.CustRelationID); if (drs.Length > 0) oldCustRelation = drs[0]["Relation"].ToString(); else oldCustRelation = ""; } newCustRelation = dtCustRelation.Select("RelationID=" + newCust.CustRelationID)[0]["Relation"].ToString(); //------------------------------------- if (oldCust.CustCountryID == null) oldCountry = ""; else { DataRow[] drs = dtCountry.Select("CountryID=" + oldCust.CustCountryID); if (drs.Length > 0) oldCountry = drs[0]["Country"].ToString(); else oldCountry = ""; } if (newCust.CustCountryID == null) newCountry = ""; else newCountry = dtCountry.Select("CountryID=" + newCust.CustCountryID)[0]["Country"].ToString(); //------------------------------------- if (oldCust.CustEmpNumID == null) oldCustEmpNum = ""; else { DataRow[] drs = dtCustEmpNum.Select("ID=" + oldCust.CustEmpNumID); if (drs.Length > 0) oldCustEmpNum = drs[0]["EmpNum"].ToString(); else oldCustEmpNum = ""; } if (newCust.CustEmpNumID == null) newCustEmpNum = ""; else newCustEmpNum = dtCustEmpNum.Select("ID=" + newCust.CustEmpNumID)[0]["EmpNum"].ToString(); //------------------------------------- #endregion CRMAuditLog Log = new CRMAuditLog(); Log.Action = "SaveCustomer"; //������ʾʱ��ת�ɶ����� SaveCustomer,SaveDeal,SaveUser Log.ActionAt = DateTime.Now; Log.ActionBy = newCust.CustModifyUserID; Log.PKId = newCust.CustID; string ActionLog = ""; if (oldCust.CustOwnerID != newCust.CustOwnerID) ActionLog += "����������Ա:" + oldOwner + "=>" + newOwner + " ;"; if (oldCust.IsActive != newCust.IsActive) ActionLog += "IsActive:" + oldCust.IsActive + "=>" + newCust.IsActive + " ;"; if (oldCust.CustCode != newCust.CustCode) ActionLog += "�ͻ�����:" + oldCust.CustCode + "=>" + newCust.CustCode + " ;"; if (oldCust.CustName != newCust.CustName) ActionLog += "�ͻ����:" + oldCust.CustName + "=>" + newCust.CustName + " ;"; if (oldCust.CustFullName != newCust.CustFullName) ActionLog += "�ͻ�ȫ��:" + oldCust.CustCode + "=>" + newCust.CustCode + " ;"; if (oldCust.CustTypeID != newCust.CustTypeID) ActionLog += "�ͻ�����:" + oldCustType + "=>" + newCustType + " ;"; if (oldCust.CustRelationID != newCust.CustRelationID) ActionLog += "�ͻ�����:" + oldCustRelation + "=>" + newCustRelation + " ;"; if (oldCust.CustPayMethod != newCust.CustPayMethod) ActionLog += "���ʽ:" + oldCust.CustPayMethod + "=>" + newCust.CustPayMethod + " ;"; if (oldCust.CustEmail != newCust.CustEmail) ActionLog += "����:" + oldCust.CustEmail + "=>" + newCust.CustEmail + " ;"; if (oldCust.CustProvince != newCust.CustProvince) ActionLog += "ʡ��:" + oldCust.CustProvince + "=>" + newCust.CustProvince + " ;"; if (oldCust.CustAddress != newCust.CustAddress) ActionLog += "�ͻ���ַ:" + oldCust.CustAddress + "=>" + newCust.CustAddress + " ;"; if (oldCust.CustTel != newCust.CustTel) ActionLog += "�绰:" + oldCust.CustTel + "=>" + newCust.CustTel + " ;"; if (oldCust.CustFax != newCust.CustFax) ActionLog += "����:" + oldCust.CustFax + "=>" + newCust.CustFax + " ;"; if (oldCust.CustWeb != newCust.CustWeb) ActionLog += "��ַ:" + oldCust.CustWeb + "=>" + newCust.CustWeb + " ;"; //ticket if (ConfigurationManager.AppSettings["Industry"].ToLower() == "ticket") { if (oldCust.Gender != newCust.Gender) ActionLog += "�Ա�:" + oldCust.Gender + "=>" + newCust.Gender + " ;"; if (oldCust.BirthDay != newCust.BirthDay) ActionLog += "����:" + oldCust.BirthDay + "=>" + newCust.BirthDay + " ;"; if (oldCust.CustCountryID != newCust.CustCountryID) ActionLog += "����:" + oldCountry + "=>" + newCountry + " ;"; if (oldCust.Passport != newCust.Passport) ActionLog += "����:" + oldCust.Passport + "=>" + newCust.Passport + " ;"; if (oldCust.PassportExpiryDate != newCust.PassportExpiryDate) ActionLog += "������Ч��:" + oldCust.PassportExpiryDate + "=>" + newCust.PassportExpiryDate + " ;"; if (oldCust.RequireVisa != newCust.RequireVisa) ActionLog += "ÿ�ζ�ǩ֤:" + oldCust.RequireVisa + "=>" + newCust.RequireVisa + " ;"; if (oldCust.ParentCompany != newCust.ParentCompany) ActionLog += "�����˾:" + oldCust.ParentCompany + "=>" + newCust.ParentCompany + " ;"; if (oldCust.Position != newCust.Position) ActionLog += "ְλ:" + oldCust.Position + "=>" + newCust.Position + " ;"; if (oldCust.UseOwnMoney != newCust.UseOwnMoney) ActionLog += "���Լ�Ǯ:" + oldCust.UseOwnMoney + "=>" + newCust.UseOwnMoney + " ;"; if (oldCust.CustEmpNumID != newCust.CustEmpNumID) ActionLog += "��˾��ģ:" + oldCustEmpNum + "=>" + newCustEmpNum + " ;"; if (oldCust.FavoriteProd != newCust.FavoriteProd) ActionLog += "ϲ�ú��չ�˾:" + oldCust.FavoriteProd + "=>" + newCust.FavoriteProd + " ;"; if (oldCust.PreferPrice != newCust.PreferPrice) ActionLog += "��λϲ��:" + oldCust.PreferPrice + "=>" + newCust.PreferPrice + " ;"; if (oldCust.PreferPlace != newCust.PreferPlace) ActionLog += "��ɵص�:" + oldCust.PreferPlace + "=>" + newCust.PreferPlace + " ;"; if (oldCust.FavoriteDest != newCust.FavoriteDest) ActionLog += "��ȥ����:" + oldCust.FavoriteDest + "=>" + newCust.FavoriteDest + " ;"; if (oldCust.Budget != newCust.Budget) ActionLog += "����Ԥ��:" + oldCust.Budget + "=>" + newCust.Budget + " ;"; if (oldCust.TravelDay != newCust.TravelDay) ActionLog += "ÿ�����ʱ��:" + oldCust.TravelDay + "=>" + newCust.TravelDay + " ;"; if (IsNull(oldCust.BuddyList) != newCust.BuddyList) ActionLog += "��������:" + GetBuddyNameList(oldCust.BuddyList) + "=>" + GetBuddyNameList(newCust.BuddyList) + " ;"; } //chemical if (ConfigurationManager.AppSettings["Industry"].ToLower() == "chemical") { if (oldCust.CustPort != newCust.CustPort) ActionLog += "�ӻ��ۿ�:" + oldCust.CustPort + "=>" + newCust.CustPort + " ;"; if (oldCust.CustPurchaseChannels != newCust.CustPurchaseChannels) ActionLog += "��������:" + oldCust.CustPurchaseChannels + "=>" + newCust.CustPurchaseChannels + " ;"; if (oldCust.CustSaleChannels != newCust.CustSaleChannels) ActionLog += "����;��:" + oldCust.CustSaleChannels + "=>" + newCust.CustSaleChannels + " ;"; if (oldCust.CommissionFactor != newCust.CommissionFactor) ActionLog += "�ͻ�ϵ��:" + oldCust.CommissionFactor + "=>" + newCust.CommissionFactor + " ;"; if (oldCust.CustMaterial != newCust.CustMaterial) ActionLog += "ʹ���ҹ�˾��Ʒ�����:" + oldCust.CustMaterial + "=>" + newCust.CustMaterial + " ;"; if (oldCust.CustProduct != newCust.CustProduct) ActionLog += "�ͻ�������Ʒ:" + oldCust.CustProduct + "=>" + newCust.CustProduct + " ;"; if (oldCust.CustInfo != newCust.CustInfo) ActionLog += "�ɹ�ϰ��:" + oldCust.CustInfo + "=>" + newCust.CustInfo + " ;"; } Log.ActionLog = ActionLog; this.CRMAuditLogs.InsertOnSubmit(Log); }
//逐行比较客户的属性 private void AddAuditLog(CRMCustomer oldCust, CRMCustomer newCust) { #region ID to Name using DataTable Select Method DataTable dtCustType = base.GetCustType(); DataTable dtCustRelation = base.GetCustRelation(); //DataTable dtCustIndustry = base.GetCustIndustry(); DataTable dtCustEmpNum = base.GetCustEmpNum(); DataTable dtCountry = base.GetCountry(); DataTable dtUser = base.GetUser(); string oldCustType = "", newCustType; string oldCustRelation, newCustRelation; //string oldCustIndustry, newCustIndustry; string oldCustEmpNum, newCustEmpNum; string oldCountry, newCountry; string oldOwner = "", newOwner = ""; if (oldCust.CustOwnerID == 0) { oldOwner = ""; } else { var drs = dtUser.Select("UserID=" + oldCust.CustOwnerID); if (drs.Length > 0) { oldOwner = drs[0]["UserFullName"].ToString(); } else { oldOwner = ""; } } if (newCust.CustOwnerID != 0) { var drs = dtUser.Select("UserID=" + newCust.CustOwnerID); newOwner = drs[0]["UserFullName"].ToString(); } //------------------------------------- oldCustType = dtCustType.Select("CustTypeID=" + oldCust.CustTypeID)[0]["CustType"].ToString(); newCustType = dtCustType.Select("CustTypeID=" + newCust.CustTypeID)[0]["CustType"].ToString(); //------------------------------------- if (oldCust.CustRelationID == null) { oldCustRelation = ""; } else { DataRow[] drs = dtCustRelation.Select("RelationID=" + oldCust.CustRelationID); if (drs.Length > 0) { oldCustRelation = drs[0]["Relation"].ToString(); } else { oldCustRelation = ""; } } newCustRelation = dtCustRelation.Select("RelationID=" + newCust.CustRelationID)[0]["Relation"].ToString(); //------------------------------------- if (oldCust.CustCountryID == null) { oldCountry = ""; } else { DataRow[] drs = dtCountry.Select("CountryID=" + oldCust.CustCountryID); if (drs.Length > 0) { oldCountry = drs[0]["Country"].ToString(); } else { oldCountry = ""; } } if (newCust.CustCountryID == null) { newCountry = ""; } else { newCountry = dtCountry.Select("CountryID=" + newCust.CustCountryID)[0]["Country"].ToString(); } //------------------------------------- if (oldCust.CustEmpNumID == null) { oldCustEmpNum = ""; } else { DataRow[] drs = dtCustEmpNum.Select("ID=" + oldCust.CustEmpNumID); if (drs.Length > 0) { oldCustEmpNum = drs[0]["EmpNum"].ToString(); } else { oldCustEmpNum = ""; } } if (newCust.CustEmpNumID == null) { newCustEmpNum = ""; } else { newCustEmpNum = dtCustEmpNum.Select("ID=" + newCust.CustEmpNumID)[0]["EmpNum"].ToString(); } //------------------------------------- #endregion CRMAuditLog Log = new CRMAuditLog(); Log.Action = "SaveCustomer"; //界面显示时再转成多语言 SaveCustomer,SaveDeal,SaveUser Log.ActionAt = DateTime.Now; Log.ActionBy = newCust.CustModifyUserID; Log.PKId = newCust.CustID; string ActionLog = ""; if (oldCust.CustOwnerID != newCust.CustOwnerID) { ActionLog += "所属销售人员:" + oldOwner + "=>" + newOwner + " ;"; } if (oldCust.IsActive != newCust.IsActive) { ActionLog += "IsActive:" + oldCust.IsActive + "=>" + newCust.IsActive + " ;"; } if (oldCust.CustCode != newCust.CustCode) { ActionLog += "客户编码:" + oldCust.CustCode + "=>" + newCust.CustCode + " ;"; } if (oldCust.CustName != newCust.CustName) { ActionLog += "客户简称:" + oldCust.CustName + "=>" + newCust.CustName + " ;"; } if (oldCust.CustFullName != newCust.CustFullName) { ActionLog += "客户全名:" + oldCust.CustCode + "=>" + newCust.CustCode + " ;"; } if (oldCust.CustTypeID != newCust.CustTypeID) { ActionLog += "客户类型:" + oldCustType + "=>" + newCustType + " ;"; } if (oldCust.CustRelationID != newCust.CustRelationID) { ActionLog += "客户级别:" + oldCustRelation + "=>" + newCustRelation + " ;"; } if (oldCust.CustPayMethod != newCust.CustPayMethod) { ActionLog += "付款方式:" + oldCust.CustPayMethod + "=>" + newCust.CustPayMethod + " ;"; } if (oldCust.CustEmail != newCust.CustEmail) { ActionLog += "电邮:" + oldCust.CustEmail + "=>" + newCust.CustEmail + " ;"; } if (oldCust.CustProvince != newCust.CustProvince) { ActionLog += "省份:" + oldCust.CustProvince + "=>" + newCust.CustProvince + " ;"; } if (oldCust.CustAddress != newCust.CustAddress) { ActionLog += "客户地址:" + oldCust.CustAddress + "=>" + newCust.CustAddress + " ;"; } if (oldCust.CustTel != newCust.CustTel) { ActionLog += "电话:" + oldCust.CustTel + "=>" + newCust.CustTel + " ;"; } if (oldCust.CustFax != newCust.CustFax) { ActionLog += "传真:" + oldCust.CustFax + "=>" + newCust.CustFax + " ;"; } if (oldCust.CustWeb != newCust.CustWeb) { ActionLog += "网址:" + oldCust.CustWeb + "=>" + newCust.CustWeb + " ;"; } //ticket if (ConfigurationManager.AppSettings["Industry"].ToLower() == "ticket") { if (oldCust.Gender != newCust.Gender) { ActionLog += "性别:" + oldCust.Gender + "=>" + newCust.Gender + " ;"; } if (oldCust.BirthDay != newCust.BirthDay) { ActionLog += "生日:" + oldCust.BirthDay + "=>" + newCust.BirthDay + " ;"; } if (oldCust.CustCountryID != newCust.CustCountryID) { ActionLog += "国籍:" + oldCountry + "=>" + newCountry + " ;"; } if (oldCust.Passport != newCust.Passport) { ActionLog += "护照:" + oldCust.Passport + "=>" + newCust.Passport + " ;"; } if (oldCust.PassportExpiryDate != newCust.PassportExpiryDate) { ActionLog += "护照有效期:" + oldCust.PassportExpiryDate + "=>" + newCust.PassportExpiryDate + " ;"; } if (oldCust.RequireVisa != newCust.RequireVisa) { ActionLog += "每次都签证:" + oldCust.RequireVisa + "=>" + newCust.RequireVisa + " ;"; } if (oldCust.ParentCompany != newCust.ParentCompany) { ActionLog += "所属公司:" + oldCust.ParentCompany + "=>" + newCust.ParentCompany + " ;"; } if (oldCust.Position != newCust.Position) { ActionLog += "职位:" + oldCust.Position + "=>" + newCust.Position + " ;"; } if (oldCust.UseOwnMoney != newCust.UseOwnMoney) { ActionLog += "花自己钱:" + oldCust.UseOwnMoney + "=>" + newCust.UseOwnMoney + " ;"; } if (oldCust.CustEmpNumID != newCust.CustEmpNumID) { ActionLog += "公司规模:" + oldCustEmpNum + "=>" + newCustEmpNum + " ;"; } if (oldCust.FavoriteProd != newCust.FavoriteProd) { ActionLog += "喜好航空公司:" + oldCust.FavoriteProd + "=>" + newCust.FavoriteProd + " ;"; } if (oldCust.PreferPrice != newCust.PreferPrice) { ActionLog += "舱位喜好:" + oldCust.PreferPrice + "=>" + newCust.PreferPrice + " ;"; } if (oldCust.PreferPlace != newCust.PreferPlace) { ActionLog += "起飞地点:" + oldCust.PreferPlace + "=>" + newCust.PreferPlace + " ;"; } if (oldCust.FavoriteDest != newCust.FavoriteDest) { ActionLog += "常去城市:" + oldCust.FavoriteDest + "=>" + newCust.FavoriteDest + " ;"; } if (oldCust.Budget != newCust.Budget) { ActionLog += "消费预算:" + oldCust.Budget + "=>" + newCust.Budget + " ;"; } if (oldCust.TravelDay != newCust.TravelDay) { ActionLog += "每年飞行时段:" + oldCust.TravelDay + "=>" + newCust.TravelDay + " ;"; } if (IsNull(oldCust.BuddyList) != newCust.BuddyList) { ActionLog += "亲友名单:" + GetBuddyNameList(oldCust.BuddyList) + "=>" + GetBuddyNameList(newCust.BuddyList) + " ;"; } } //chemical if (ConfigurationManager.AppSettings["Industry"].ToLower() == "chemical") { if (oldCust.CustPort != newCust.CustPort) { ActionLog += "接货港口:" + oldCust.CustPort + "=>" + newCust.CustPort + " ;"; } if (oldCust.CustPurchaseChannels != newCust.CustPurchaseChannels) { ActionLog += "进货渠道:" + oldCust.CustPurchaseChannels + "=>" + newCust.CustPurchaseChannels + " ;"; } if (oldCust.CustSaleChannels != newCust.CustSaleChannels) { ActionLog += "销售途径:" + oldCust.CustSaleChannels + "=>" + newCust.CustSaleChannels + " ;"; } if (oldCust.CommissionFactor != newCust.CommissionFactor) { ActionLog += "客户系数:" + oldCust.CommissionFactor + "=>" + newCust.CommissionFactor + " ;"; } if (oldCust.CustMaterial != newCust.CustMaterial) { ActionLog += "使用我公司产品的情况:" + oldCust.CustMaterial + "=>" + newCust.CustMaterial + " ;"; } if (oldCust.CustProduct != newCust.CustProduct) { ActionLog += "客户生产产品:" + oldCust.CustProduct + "=>" + newCust.CustProduct + " ;"; } if (oldCust.CustInfo != newCust.CustInfo) { ActionLog += "采购习惯:" + oldCust.CustInfo + "=>" + newCust.CustInfo + " ;"; } } Log.ActionLog = ActionLog; this.CRMAuditLogs.InsertOnSubmit(Log); }
private void AddAuditLog(BillTicket oldEntity, BillTicket newEntity) { string oldOwner = "", newOwner = ""; DataTable dtUser = base.GetUser(); DataRow[] drs = dtUser.Select("UserID=" + oldEntity.CustOwnerID); if (drs.Length > 0) { oldOwner = drs[0]["UserFullName"].ToString(); } drs = dtUser.Select("UserID=" + newEntity.CustOwnerID); if (drs.Length > 0) { newOwner = drs[0]["UserFullName"].ToString(); } CRMAuditLog Log = new CRMAuditLog(); Log.Action = "SaveTicket"; //界面显示时再转成多语言 SaveCustomer,SaveDeal,SaveUser Log.ActionAt = DateTime.Now; Log.ActionBy = newEntity.ModifyUserID; Log.PKId = newEntity.ID; string ActionLog = ""; if (oldEntity.DepName != newEntity.DepName) { ActionLog += "部门:" + oldEntity.DepName + "=>" + newEntity.DepName + " ;"; } if (oldEntity.DepAddress != newEntity.DepAddress) { ActionLog += "公司地址:" + oldEntity.DepAddress + "=>" + newEntity.DepAddress + " ;"; } if (oldEntity.InnerReferenceID != newEntity.InnerReferenceID) { ActionLog += "内部预订号:" + oldEntity.InnerReferenceID + "=>" + newEntity.InnerReferenceID + " ;"; } if (oldEntity.BookingDate != newEntity.BookingDate) { ActionLog += "预订日期:" + oldEntity.BookingDate + "=>" + newEntity.BookingDate + " ;"; } if (oldEntity.CustID != newEntity.CustID) { ActionLog += "CustID:" + oldEntity.CustID + "=>" + newEntity.CustID + " ;"; } if (oldEntity.CustName != newEntity.CustName) { ActionLog += "客户姓名:" + oldEntity.CustName + "=>" + newEntity.CustName + " ;"; } if (oldEntity.CustEmail != newEntity.CustEmail) { ActionLog += "电邮:" + oldEntity.CustEmail + "=>" + newEntity.CustEmail + " ;"; } if (oldEntity.CustAddress != newEntity.CustAddress) { ActionLog += "客户地址:" + oldEntity.CustAddress + "=>" + newEntity.CustAddress + " ;"; } if (oldEntity.CustTel != newEntity.CustTel) { ActionLog += "电话:" + oldEntity.CustTel + "=>" + newEntity.CustTel + " ;"; } if (oldEntity.CustOwnerID != newEntity.CustOwnerID) { ActionLog += "所属销售:" + oldOwner + "=>" + newOwner + " ;"; } //if (oldEntity.BankAccount != newEntity.BankAccount) // ActionLog += "BankAccount:" + oldEntity.BankAccount + "=>" + newEntity.BankAccount + " ;"; //if (oldEntity.Currency != newEntity.Currency) // ActionLog += "Currency:" + oldEntity.Currency + "=>" + newEntity.Currency + " ;"; if (oldEntity.TotalAmount != newEntity.TotalAmount) { ActionLog += "总价:" + oldEntity.TotalAmount + "=>" + newEntity.TotalAmount + " ;"; } if (oldEntity.ProdProvider != newEntity.ProdProvider) { ActionLog += "航空公司:" + oldEntity.ProdProvider + "=>" + newEntity.ProdProvider + " ;"; } if (oldEntity.Accessory != newEntity.Accessory) { ActionLog += "Leistung:" + oldEntity.Accessory + "=>" + newEntity.Accessory + " ;"; } if (oldEntity.MaxLuggage != newEntity.MaxLuggage) { ActionLog += "行李重量:" + oldEntity.MaxLuggage + "=>" + newEntity.MaxLuggage + " ;"; } if (oldEntity.CancellationFee != newEntity.CancellationFee) { ActionLog += "取消费用:" + oldEntity.CancellationFee + "=>" + newEntity.CancellationFee + " ;"; } if (oldEntity.ChangeFee != newEntity.ChangeFee) { ActionLog += "改签费用:" + oldEntity.ChangeFee + "=>" + newEntity.ChangeFee + " ;"; } if (oldEntity.PaymentDate != newEntity.PaymentDate) { ActionLog += "付款日期:" + oldEntity.PaymentDate + "=>" + newEntity.PaymentDate + " ;"; } if (oldEntity.DestinationRegion != newEntity.DestinationRegion) { ActionLog += "目的国:" + oldEntity.DestinationRegion + "=>" + newEntity.DestinationRegion + " ;"; } if (oldEntity.Status != newEntity.Status) { ActionLog += "Status:" + oldEntity.Status + "=>" + newEntity.Status + " ;"; } Log.ActionLog = ActionLog; this.CRMAuditLogs.InsertOnSubmit(Log); }
private void AddAuditLog(BillVisa oldEntity, BillVisa newEntity) { string oldOwner, newOwner; DataTable dtUser = base.GetUser(); oldOwner = dtUser.Select("UserID=" + oldEntity.CustOwnerID)[0]["UserFullName"].ToString(); newOwner = dtUser.Select("UserID=" + newEntity.CustOwnerID)[0]["UserFullName"].ToString(); CRMAuditLog Log = new CRMAuditLog(); Log.Action = "SaveVisa"; //界面显示时再转成多语言 SaveCustomer,SaveDeal,SaveUser Log.ActionAt = DateTime.Now; Log.ActionBy = newEntity.ModifyUserID; Log.PKId = newEntity.ID; string ActionLog = ""; if (oldEntity.DepName != newEntity.DepName) { ActionLog += "部门:" + oldEntity.DepName + "=>" + newEntity.DepName + " ;"; } if (oldEntity.DepAddress != newEntity.DepAddress) { ActionLog += "公司地址:" + oldEntity.DepAddress + "=>" + newEntity.DepAddress + " ;"; } if (oldEntity.InnerReferenceID != newEntity.InnerReferenceID) { ActionLog += "内部预订号:" + oldEntity.InnerReferenceID + "=>" + newEntity.InnerReferenceID + " ;"; } if (oldEntity.BookingDate != newEntity.BookingDate) { ActionLog += "预订日期:" + oldEntity.BookingDate + "=>" + newEntity.BookingDate + " ;"; } if (oldEntity.CustID != newEntity.CustID) { ActionLog += "CustID:" + oldEntity.CustID + "=>" + newEntity.CustID + " ;"; } if (oldEntity.CustName != newEntity.CustName) { ActionLog += "客户姓名:" + oldEntity.CustName + "=>" + newEntity.CustName + " ;"; } if (oldEntity.CustEmail != newEntity.CustEmail) { ActionLog += "电邮:" + oldEntity.CustEmail + "=>" + newEntity.CustEmail + " ;"; } if (oldEntity.CustAddress != newEntity.CustAddress) { ActionLog += "客户地址:" + oldEntity.CustAddress + "=>" + newEntity.CustAddress + " ;"; } if (oldEntity.CustTel != newEntity.CustTel) { ActionLog += "电话:" + oldEntity.CustTel + "=>" + newEntity.CustTel + " ;"; } if (oldEntity.CustOwnerID != newEntity.CustOwnerID) { ActionLog += "所属销售:" + oldOwner + "=>" + newOwner + " ;"; } //if (oldEntity.BankAccount != newEntity.BankAccount) // ActionLog += "BankAccount:" + oldEntity.BankAccount + "=>" + newEntity.BankAccount + " ;"; //if (oldEntity.Currency != newEntity.Currency) // ActionLog += "Currency:" + oldEntity.Currency + "=>" + newEntity.Currency + " ;"; if (oldEntity.TotalAmount != newEntity.TotalAmount) { ActionLog += "总价:" + oldEntity.TotalAmount + "=>" + newEntity.TotalAmount + " ;"; } if (oldEntity.Status != newEntity.Status) { ActionLog += "Status:" + oldEntity.Status + "=>" + newEntity.Status + " ;"; } Log.ActionLog = ActionLog; this.CRMAuditLogs.InsertOnSubmit(Log); }
private void AddAuditLog(BillTicket oldEntity, BillTicket newEntity) { string oldOwner="", newOwner=""; DataTable dtUser = base.GetUser(); DataRow[] drs = dtUser.Select("UserID=" + oldEntity.CustOwnerID); if (drs.Length > 0) { oldOwner = drs[0]["UserFullName"].ToString(); } drs = dtUser.Select("UserID=" + newEntity.CustOwnerID); if (drs.Length > 0) { newOwner = drs[0]["UserFullName"].ToString(); } CRMAuditLog Log = new CRMAuditLog(); Log.Action = "SaveTicket"; //界面显示时再转成多语言 SaveCustomer,SaveDeal,SaveUser Log.ActionAt = DateTime.Now; Log.ActionBy = newEntity.ModifyUserID; Log.PKId = newEntity.ID; string ActionLog = ""; if (oldEntity.DepName != newEntity.DepName) ActionLog += "部门:" + oldEntity.DepName + "=>" + newEntity.DepName + " ;"; if (oldEntity.DepAddress != newEntity.DepAddress) ActionLog += "公司地址:" + oldEntity.DepAddress + "=>" + newEntity.DepAddress + " ;"; if (oldEntity.InnerReferenceID != newEntity.InnerReferenceID) ActionLog += "内部预订号:" + oldEntity.InnerReferenceID + "=>" + newEntity.InnerReferenceID + " ;"; if (oldEntity.BookingDate != newEntity.BookingDate) ActionLog += "预订日期:" + oldEntity.BookingDate + "=>" + newEntity.BookingDate + " ;"; if (oldEntity.CustID != newEntity.CustID) ActionLog += "CustID:" + oldEntity.CustID + "=>" + newEntity.CustID + " ;"; if (oldEntity.CustName != newEntity.CustName) ActionLog += "客户姓名:" + oldEntity.CustName + "=>" + newEntity.CustName + " ;"; if (oldEntity.CustEmail != newEntity.CustEmail) ActionLog += "电邮:" + oldEntity.CustEmail + "=>" + newEntity.CustEmail + " ;"; if (oldEntity.CustAddress != newEntity.CustAddress) ActionLog += "客户地址:" + oldEntity.CustAddress + "=>" + newEntity.CustAddress + " ;"; if (oldEntity.CustTel != newEntity.CustTel) ActionLog += "电话:" + oldEntity.CustTel + "=>" + newEntity.CustTel + " ;"; if (oldEntity.CustOwnerID != newEntity.CustOwnerID) ActionLog += "所属销售:" + oldOwner + "=>" + newOwner + " ;"; //if (oldEntity.BankAccount != newEntity.BankAccount) // ActionLog += "BankAccount:" + oldEntity.BankAccount + "=>" + newEntity.BankAccount + " ;"; //if (oldEntity.Currency != newEntity.Currency) // ActionLog += "Currency:" + oldEntity.Currency + "=>" + newEntity.Currency + " ;"; if (oldEntity.TotalAmount != newEntity.TotalAmount) ActionLog += "总价:" + oldEntity.TotalAmount + "=>" + newEntity.TotalAmount + " ;"; if (oldEntity.ProdProvider != newEntity.ProdProvider) ActionLog += "航空公司:" + oldEntity.ProdProvider + "=>" + newEntity.ProdProvider + " ;"; if (oldEntity.Accessory != newEntity.Accessory) ActionLog += "Leistung:" + oldEntity.Accessory + "=>" + newEntity.Accessory + " ;"; if (oldEntity.MaxLuggage != newEntity.MaxLuggage) ActionLog += "行李重量:" + oldEntity.MaxLuggage + "=>" + newEntity.MaxLuggage + " ;"; if (oldEntity.CancellationFee != newEntity.CancellationFee) ActionLog += "取消费用:" + oldEntity.CancellationFee + "=>" + newEntity.CancellationFee + " ;"; if (oldEntity.ChangeFee != newEntity.ChangeFee) ActionLog += "改签费用:" + oldEntity.ChangeFee + "=>" + newEntity.ChangeFee + " ;"; if (oldEntity.PaymentDate != newEntity.PaymentDate) ActionLog += "付款日期:" + oldEntity.PaymentDate + "=>" + newEntity.PaymentDate + " ;"; if (oldEntity.DestinationRegion != newEntity.DestinationRegion) ActionLog += "目的国:" + oldEntity.DestinationRegion + "=>" + newEntity.DestinationRegion + " ;"; if (oldEntity.Status != newEntity.Status) ActionLog += "Status:" + oldEntity.Status + "=>" + newEntity.Status + " ;"; Log.ActionLog = ActionLog; this.CRMAuditLogs.InsertOnSubmit(Log); }
private void AddAuditLog(BillVisa oldEntity, BillVisa newEntity) { string oldOwner, newOwner; DataTable dtUser = base.GetUser(); oldOwner = dtUser.Select("UserID=" + oldEntity.CustOwnerID)[0]["UserFullName"].ToString(); newOwner = dtUser.Select("UserID=" + newEntity.CustOwnerID)[0]["UserFullName"].ToString(); CRMAuditLog Log = new CRMAuditLog(); Log.Action = "SaveVisa"; //界面显示时再转成多语言 SaveCustomer,SaveDeal,SaveUser Log.ActionAt = DateTime.Now; Log.ActionBy = newEntity.ModifyUserID; Log.PKId = newEntity.ID; string ActionLog = ""; if (oldEntity.DepName != newEntity.DepName) ActionLog += "部门:" + oldEntity.DepName + "=>" + newEntity.DepName + " ;"; if (oldEntity.DepAddress != newEntity.DepAddress) ActionLog += "公司地址:" + oldEntity.DepAddress + "=>" + newEntity.DepAddress + " ;"; if (oldEntity.InnerReferenceID != newEntity.InnerReferenceID) ActionLog += "内部预订号:" + oldEntity.InnerReferenceID + "=>" + newEntity.InnerReferenceID + " ;"; if (oldEntity.BookingDate != newEntity.BookingDate) ActionLog += "预订日期:" + oldEntity.BookingDate + "=>" + newEntity.BookingDate + " ;"; if (oldEntity.CustID != newEntity.CustID) ActionLog += "CustID:" + oldEntity.CustID + "=>" + newEntity.CustID + " ;"; if (oldEntity.CustName != newEntity.CustName) ActionLog += "客户姓名:" + oldEntity.CustName + "=>" + newEntity.CustName + " ;"; if (oldEntity.CustEmail != newEntity.CustEmail) ActionLog += "电邮:" + oldEntity.CustEmail + "=>" + newEntity.CustEmail + " ;"; if (oldEntity.CustAddress != newEntity.CustAddress) ActionLog += "客户地址:" + oldEntity.CustAddress + "=>" + newEntity.CustAddress + " ;"; if (oldEntity.CustTel != newEntity.CustTel) ActionLog += "电话:" + oldEntity.CustTel + "=>" + newEntity.CustTel + " ;"; if (oldEntity.CustOwnerID != newEntity.CustOwnerID) ActionLog += "所属销售:" + oldOwner + "=>" + newOwner + " ;"; //if (oldEntity.BankAccount != newEntity.BankAccount) // ActionLog += "BankAccount:" + oldEntity.BankAccount + "=>" + newEntity.BankAccount + " ;"; //if (oldEntity.Currency != newEntity.Currency) // ActionLog += "Currency:" + oldEntity.Currency + "=>" + newEntity.Currency + " ;"; if (oldEntity.TotalAmount != newEntity.TotalAmount) ActionLog += "总价:" + oldEntity.TotalAmount + "=>" + newEntity.TotalAmount + " ;"; if (oldEntity.Status != newEntity.Status) ActionLog += "Status:" + oldEntity.Status + "=>" + newEntity.Status + " ;"; Log.ActionLog = ActionLog; this.CRMAuditLogs.InsertOnSubmit(Log); }