public void LogCommonDataEditAction(CommonDataEditAction action) { LogDS logDS = new LogDS(); LogDS.CommonDataEditActionLogRow log = logDS.CommonDataEditActionLog.NewCommonDataEditActionLogRow(); log.ActionTime = action.ActionTime; log.ActionType = action.ActionType; log.DataTableName = action.DataTableName; if (action.NewValue != null) { log.NewValue = action.NewValue; } if (action.OldValue != null) { log.OldValue = action.OldValue; } if (action.StuffId != null) { log.StuffId = action.StuffId; } log.StuffName = action.StuffName; logDS.CommonDataEditActionLog.AddCommonDataEditActionLogRow(log); this.CommonDataEditActionLogTA.Update(logDS.CommonDataEditActionLog); }
public void UpdateShop(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, string ShopName, int CustomerID, int ShopLevelID, string Address, string Contacter, string Tel, string Email, int ShopID, bool IsActive, string ShopNo) { // 检证"客户名称"唯一性 int iCount = (int)this.ShopAdapter.SearchNameByUpd(ShopName, ShopID, CustomerID, ShopLevelID); if (iCount > 0) { throw new ApplicationException("同一客户,同一门店等级下门店名称不能重复!"); } CommonDataEditAction action = new CommonDataEditAction(); action.ActionTime = DateTime.Now; action.ActionType = "更新"; action.DataTableName = "门店"; action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; // 根据 ShopId 查找要修改的数据 ERS.ShopDataTable ShopTab = this.ShopAdapter.GetDataById(ShopID); ERS.ShopRow ShopRow = ShopTab[0]; action.OldValue = "门店名称:" + ShopRow.ShopName; ShopRow.ShopName = ShopName; ShopRow.CustomerID = CustomerID; ShopRow.ShopLevelID = ShopLevelID; ShopRow.Address = Address; ShopRow.Contacter = Contacter; ShopRow.Tel = Tel; ShopRow.Email = Email; ShopRow.IsActive = IsActive; ShopRow.ShopNo = ShopNo; // 更新数据 this.ShopAdapter.Update(ShopRow); action.NewValue = "门店名称:" + ShopRow.ShopName; SysLog.LogCommonDataEditAction(action); }
public void UpdateProvince(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, int ProvinceID, string ProvinceName, bool IsActive) { int iCount = (int)this.ProvinceAdapter.SearchProvinceNameByUpd(ProvinceName, ProvinceID); if (iCount > 0) { throw new ApplicationException("省份名称重复"); } CommonDataEditAction action = new CommonDataEditAction(); action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; action.DataTableName = "省份"; action.ActionType = "更新"; action.ActionTime = DateTime.Now; this.CityAdapter.DisabledCityByProvId(ProvinceID); // 根据 CurrId 查找要修改的数据 ERS.ProvinceDataTable provTab = this.ProvinceAdapter.GetDataById(ProvinceID); ERS.ProvinceRow provRow = provTab[0]; action.OldValue = "省份名称:" + provRow.ProvinceName; provRow.ProvinceName = ProvinceName; provRow.IsActive = IsActive; this.ProvinceAdapter.Update(provRow); action.NewValue = "省份名称:" + provRow.ProvinceName; SysLog.LogCommonDataEditAction(action); }
public void UpdateExpenseItem(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, string ExpenseItemName, int ExpenseSubCategoryID, string AccountingName, string AccountingCode, Boolean IsInContract, Boolean IsActive, int ExpenseItemID) { // 检证"费用项"唯一性 int iCount = (int)this.ExpenseItemAdapter.SearchItemNameByUpd(ExpenseItemID, ExpenseItemName); if (iCount > 0) { throw new ApplicationException("在同一费用小类下,费用项名称不能重复!"); } CommonDataEditAction action = new CommonDataEditAction(); action.ActionTime = DateTime.Now; action.ActionType = "更新"; action.DataTableName = "费用项"; action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; // 根据 ItemId 查找要修改的数据 ERS.ExpenseItemDataTable expenseItemTab = this.ExpenseItemAdapter.GetDataById(ExpenseItemID); ERS.ExpenseItemRow expenseItemRow = expenseItemTab[0]; action.OldValue = "费用项名称:" + expenseItemRow.ExpenseItemName; expenseItemRow.ExpenseItemName = ExpenseItemName; expenseItemRow.AccountingCode = AccountingCode; expenseItemRow.ExpenseSubCategoryID = ExpenseSubCategoryID; expenseItemRow.AccountingName = AccountingName; expenseItemRow.IsInContract = IsInContract; expenseItemRow.IsActive = IsActive; // 更新数据 this.ExpenseItemAdapter.Update(expenseItemRow); action.NewValue = "费用项名称:" + expenseItemRow.ExpenseItemName; SysLog.LogCommonDataEditAction(action); }
public void UpdateCustomer(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, string CustomerName, string CustomerNo, int CityID, int CustomerTypeID, int ChannelTypeID, int ApplyOrganizationUnitID, int OrganizationUnitID, Boolean IsActive, int CustomerID) { if (ApplyOrganizationUnitID <= 0) { throw new ApplicationException("必须选择所属机构!"); } if (OrganizationUnitID <= 0) { throw new ApplicationException("必须选择所属预算机构!"); } // 检证"客户名称"唯一性 int iCount = (int)this.CustomerAdapter.SearchNameByUpd(CustomerName, CustomerID); if (iCount > 0) { throw new ApplicationException("客户名称不能重复!"); } CommonDataEditAction action = new CommonDataEditAction(); action.ActionTime = DateTime.Now; action.ActionType = "更新"; action.DataTableName = "客户"; action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; // 根据 CustId 查找要修改的数据 ERS.CustomerDataTable custTab = this.CustomerAdapter.GetDataById(CustomerID); ERS.CustomerRow custRow = custTab[0]; action.OldValue = "客户名称:" + custRow.CustomerName; custRow.CustomerName = CustomerName; custRow.CustomerNo = CustomerNo; custRow.CustomerTypeID = CustomerTypeID; custRow.ChannelTypeID = ChannelTypeID; custRow.CityID = CityID; if (ApplyOrganizationUnitID > 0) { custRow.ApplyOrganizationUnitID = ApplyOrganizationUnitID; } if (OrganizationUnitID > 0) { custRow.OrganizationUnitID = OrganizationUnitID; } custRow.IsActive = IsActive; // 更新数据 this.CustomerAdapter.Update(custRow); action.NewValue = "客户名称:" + custRow.CustomerName; SysLog.LogCommonDataEditAction(action); }
public void UpdateCategory(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, int ExpenseCategoryID, string ExpenseCategoryName, bool IsActive) { // 验证是否存在 ExpenseCategoryName 同名数据。 int iCount = (int)this.ExpenseCategoryAdapter.SearchCateByUpd(ExpenseCategoryName, ExpenseCategoryID); if (iCount > 0) { throw new ApplicationException("费用大类名称重名"); } CommonDataEditAction action = new CommonDataEditAction(); action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; action.DataTableName = "费用大类"; action.ActionType = "更新"; action.ActionTime = DateTime.Now; this.ExpenseSubCategoryAdapter.DisabledExpenseSubCateByCateId(ExpenseCategoryID); // 根据 CurrId 查找要修改的数据 ERS.ExpenseCategoryDataTable provTab = this.ExpenseCategoryAdapter.GetDataById(ExpenseCategoryID); ERS.ExpenseCategoryRow provRow = provTab[0]; action.OldValue = "费用大类名称:" + provRow.ExpenseCategoryName; provRow.ExpenseCategoryName = ExpenseCategoryName; provRow.IsActive = IsActive; this.ExpenseCategoryAdapter.Update(provRow); action.NewValue = "费用大类名称:" + provRow.ExpenseCategoryName; SysLog.LogCommonDataEditAction(action); }
public static void LogCommonDataEditAction(CommonDataEditAction action) { SysTrace.TraceData(TraceEventType.Information, (int)LogType.CommonDateEdit, action); }
public void InsertShop(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, string ShopName, int CustomerID, int ShopLevelID, string Address, string Contacter, string Tel, string Email, bool IsActive, string ShopNo) { // 检证"门店名称"唯一性 int iCount = (int)this.ShopAdapter.SearchNameByIns(ShopName, CustomerID, ShopLevelID); if (iCount > 0) { throw new ApplicationException("同一客户,同一门店等级下门店名称不能重复!"); } // 进行数据新增处理 ERS.ShopDataTable shopTab = new ERS.ShopDataTable(); ERS.ShopRow shopRow = shopTab.NewShopRow(); // 进行传值 shopRow.ShopName = ShopName; shopRow.CustomerID = CustomerID; shopRow.ShopLevelID = ShopLevelID; shopRow.Address = Address; shopRow.Contacter = Contacter; shopRow.Tel = Tel; shopRow.Email = Email; shopRow.IsActive = IsActive; shopRow.ShopNo = ShopNo; // 填加行并进行更新处理 shopTab.AddShopRow(shopRow); this.ShopAdapter.Update(shopTab); CommonDataEditAction action = new CommonDataEditAction(); action.ActionTime = DateTime.Now; action.ActionType = "添加"; action.DataTableName = "门店"; action.NewValue = "门店名称:" + shopRow.ShopName; action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; SysLog.LogCommonDataEditAction(action); }
public void InsertExpenseItem(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, string ExpenseItemName, int ExpenseSubCategoryID, string AccountingName, string AccountingCode, Boolean IsInContract, Boolean IsActive) { // 检证"费用项"唯一性 int iCount = (int)this.ExpenseItemAdapter.SearchItemNameByIns(ExpenseItemName); if (iCount > 0) { throw new ApplicationException("在同一费用小类下,费用项不能重复!"); } // 进行数据新增处理 ERS.ExpenseItemDataTable subCateItemTab = new ERS.ExpenseItemDataTable(); ERS.ExpenseItemRow subCateItemRow = subCateItemTab.NewExpenseItemRow(); // 进行传值 subCateItemRow.ExpenseSubCategoryID = ExpenseSubCategoryID; subCateItemRow.ExpenseItemName = ExpenseItemName; subCateItemRow.AccountingName = AccountingName; subCateItemRow.AccountingCode = AccountingCode; subCateItemRow.IsInContract = IsInContract; subCateItemRow.IsActive = IsActive; // 填加行并进行更新处理 subCateItemTab.AddExpenseItemRow(subCateItemRow); this.ExpenseItemAdapter.Update(subCateItemTab); CommonDataEditAction action = new CommonDataEditAction(); action.ActionTime = DateTime.Now; action.ActionType = "添加"; action.DataTableName = "费用项"; action.NewValue = "费用项名称:" + subCateItemRow.ExpenseItemName; action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; SysLog.LogCommonDataEditAction(action); }
public void InsertProvince(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, string ProvinceName, bool IsActive) { int iCount = (int)this.ProvinceAdapter.SearchProvinceNameByIns(ProvinceName); if (iCount > 0) { throw new ApplicationException("省份名称重复"); } ERS.ProvinceDataTable currTab = new ERS.ProvinceDataTable(); ERS.ProvinceRow provRow = currTab.NewProvinceRow(); provRow.ProvinceName = ProvinceName; provRow.IsActive = IsActive; currTab.AddProvinceRow(provRow); this.ProvinceAdapter.Update(currTab); CommonDataEditAction action = new CommonDataEditAction(); action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; action.DataTableName = "省份"; action.ActionType = "添加"; action.ActionTime = DateTime.Now; action.NewValue = "省份名称:" + provRow.ProvinceName; SysLog.LogCommonDataEditAction(action); }
public void InsertExpenseCategory(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, string ExpenseCategoryName, bool IsActive) { // 验证是否存在 ExpenseCategoryName 同名数据。 int iCount = (int)this.ExpenseCategoryAdapter.SearchCateByIns(ExpenseCategoryName); if (iCount > 0) { throw new ApplicationException("费用大类名称重名"); } // 进行数据新增处理 ERS.ExpenseCategoryDataTable cateTab = new ERS.ExpenseCategoryDataTable(); ERS.ExpenseCategoryRow cateRow = cateTab.NewExpenseCategoryRow(); cateRow.ExpenseCategoryName = ExpenseCategoryName; cateRow.IsActive = IsActive; // 填加行并进行更新处理 cateTab.AddExpenseCategoryRow(cateRow); this.ExpenseCategoryAdapter.Update(cateTab); CommonDataEditAction action = new CommonDataEditAction(); action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; action.DataTableName = "费用大类"; action.ActionType = "添加"; action.ActionTime = DateTime.Now; action.NewValue = "费用大类:" + cateRow.ExpenseCategoryName; SysLog.LogCommonDataEditAction(action); }
public void InsertCustomer(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, string CustomerName, string CustomerNo, int CityID, int CustomerTypeID, int ChannelTypeID, int ApplyOrganizationUnitID, int OrganizationUnitID, Boolean IsActive) { if (ApplyOrganizationUnitID <= 0) { throw new ApplicationException("必须选择所属机构!"); } if (OrganizationUnitID <= 0) { throw new ApplicationException("必须选择所属预算机构!"); } // 检证"客户名称"唯一性 int iCount = (int)this.CustomerAdapter.SearchNameByIns(CustomerName); if (iCount > 0) { throw new ApplicationException("客户名称不能重复!"); } // 进行数据新增处理 ERS.CustomerDataTable custItemTab = new ERS.CustomerDataTable(); ERS.CustomerRow custRow = custItemTab.NewCustomerRow(); // 进行传值 custRow.CustomerName = CustomerName; custRow.CustomerNo = CustomerNo; custRow.CustomerTypeID = CustomerTypeID; custRow.CityID = CityID; custRow.ChannelTypeID = ChannelTypeID; custRow.OrganizationUnitID = OrganizationUnitID; custRow.ApplyOrganizationUnitID = ApplyOrganizationUnitID; custRow.IsActive = IsActive; // 填加行并进行更新处理 custItemTab.AddCustomerRow(custRow); this.CustomerAdapter.Update(custItemTab); CommonDataEditAction action = new CommonDataEditAction(); action.ActionTime = DateTime.Now; action.ActionType = "添加"; action.DataTableName = "客户"; action.NewValue = "客户名称:" + custRow.CustomerName; action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; SysLog.LogCommonDataEditAction(action); }
public void InsertCity(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, int ProvId, string CityName, bool IsActive) { // 检证"城市"唯一性 int iCount = (int)this.CityAdapter.SearchCityNameByIns(CityName, ProvId); if (iCount > 0) { throw new ApplicationException("在同一省份下,城市名称不能重复!"); } // 进行数据新增处理 ERS.CityDataTable cityTab = new ERS.CityDataTable(); ERS.CityRow cityRow = cityTab.NewCityRow(); // 进行传值 cityRow.ProvinceID = ProvId; cityRow.CityName = CityName; cityRow.IsActive = IsActive; // 填加行并进行更新处理 cityTab.AddCityRow(cityRow); this.CityAdapter.Update(cityTab); CommonDataEditAction action = new CommonDataEditAction(); action.ActionTime = DateTime.Now; action.ActionType = "添加"; action.DataTableName = "城市"; action.NewValue = "城市名称:" + cityRow.CityName; action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; SysLog.LogCommonDataEditAction(action); }
public void UpdateSKU(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, int SKUCategoryID, string SKUNo, string SKUName, string Spec, int PackageQuantity, decimal PackagePercent, string SKUCostCenter, Boolean IsActive, int SKUID, decimal CostPrice, string Taste) { CommonDataEditAction action = new CommonDataEditAction(); action.ActionTime = DateTime.Now; action.ActionType = "更新"; action.DataTableName = "产品"; action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; // 根据 SKUID 查找要修改的数据 ERS.SKUDataTable SKUTab = this.SKUAdapter.GetDataById(SKUID); ERS.SKURow SKURow = SKUTab[0]; action.OldValue = "产品名称:" + SKURow.SKUName; SKURow.SKUName = SKUName; SKURow.SKUNo = SKUNo; SKURow.Spec = Spec; SKURow.PackageQuantity = PackageQuantity; SKURow.PackagePercent = PackagePercent; SKURow.IsActive = IsActive; SKURow.SKUCategoryID = SKUCategoryID; SKURow.SKUCostCenter = SKUCostCenter == null ? "" : SKUCostCenter; SKURow.CostPrice = CostPrice; SKURow.Taste = Taste; // 更新数据 this.SKUAdapter.Update(SKURow); action.NewValue = "产品名称:" + SKURow.SKUName; SysLog.LogCommonDataEditAction(action); }
public void InsertSKU(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, int SKUCategoryID, string SKUNo, string SKUName, string Spec, int PackageQuantity, decimal PackagePercent, string SKUCostCenter, Boolean IsActive, decimal CostPrice, string Taste) { // 进行数据新增处理 ERS.SKUDataTable SKUTab = new ERS.SKUDataTable(); ERS.SKURow SKURow = SKUTab.NewSKURow(); // 进行传值 SKURow.SKUName = SKUName; SKURow.SKUNo = SKUNo; SKURow.Spec = Spec; SKURow.PackageQuantity = PackageQuantity; SKURow.PackagePercent = PackagePercent; SKURow.IsActive = IsActive; SKURow.SKUCategoryID = SKUCategoryID; SKURow.SKUCostCenter = SKUCostCenter == null ? "" : SKUCostCenter; SKURow.CostPrice = CostPrice; SKURow.Taste = Taste; // 填加行并进行更新处理 SKUTab.AddSKURow(SKURow); this.SKUAdapter.Update(SKUTab); CommonDataEditAction action = new CommonDataEditAction(); action.ActionTime = DateTime.Now; action.ActionType = "添加"; action.DataTableName = "产品"; action.NewValue = "产品名称:" + SKURow.SKUName; action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; SysLog.LogCommonDataEditAction(action); }
public void UpdateSubCategory(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, int ExpenseSubCategoryId, string ExpenseSubCategoryName, int CateId, int PageType, Boolean IsActive) { // 检证"费用小类"唯一性 int iCount = (int)this.ExpenseSubCategoryAdapter.SearchSubCateNameByUpd(ExpenseSubCategoryId, ExpenseSubCategoryName, CateId); if (iCount > 0) { throw new ApplicationException("在同一费用大类下,费用小类名称不能重复!"); } CommonDataEditAction action = new CommonDataEditAction(); action.ActionTime = DateTime.Now; action.ActionType = "更新"; action.DataTableName = "费用小类"; action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; // 根据 CurrId 查找要修改的数据 ERS.ExpenseSubCategoryDataTable subCateTab = this.ExpenseSubCategoryAdapter.GetDataById(ExpenseSubCategoryId); ERS.ExpenseSubCategoryRow subCateRow = subCateTab[0]; action.OldValue = "费用小类名称:" + subCateRow.ExpenseSubCategoryName; subCateRow.ExpenseSubCategoryName = ExpenseSubCategoryName; subCateRow.PageType = PageType; subCateRow.IsActive = IsActive; // 更新数据 this.ExpenseSubCategoryAdapter.Update(subCateRow); action.NewValue = "费用小类名称:" + subCateRow.ExpenseSubCategoryName; SysLog.LogCommonDataEditAction(action); }
public void InsertSubCategory(AuthorizationDS.StuffUserRow stuffUser, AuthorizationDS.PositionRow position, string ExpenseSubCategoryName, int CateId, int PageType, Boolean IsActive) { // 检证"费用小类"唯一性 int iCount = (int)this.ExpenseSubCategoryAdapter.SearchSubCateNameByIns(ExpenseSubCategoryName, CateId); if (iCount > 0) { throw new ApplicationException("在同一费用大类下,费用小类不能重复!"); } // 进行数据新增处理 ERS.ExpenseSubCategoryDataTable subCateTab = new ERS.ExpenseSubCategoryDataTable(); ERS.ExpenseSubCategoryRow subCateRow = subCateTab.NewExpenseSubCategoryRow(); // 进行传值 subCateRow.ExpenseCategoryID = CateId; subCateRow.ExpenseSubCategoryName = ExpenseSubCategoryName; subCateRow.PageType = PageType; subCateRow.IsActive = IsActive; // 填加行并进行更新处理 subCateTab.AddExpenseSubCategoryRow(subCateRow); this.ExpenseSubCategoryAdapter.Update(subCateTab); CommonDataEditAction action = new CommonDataEditAction(); action.ActionTime = DateTime.Now; action.ActionType = "添加"; action.DataTableName = "费用小类"; action.NewValue = "费用小类名称:" + subCateRow.ExpenseSubCategoryName; action.StuffId = stuffUser.StuffId; action.StuffName = stuffUser.StuffName; SysLog.LogCommonDataEditAction(action); }
public static void LogCommonDataEditAction(CommonDataEditAction action) { SysTrace.TraceData(TraceEventType.Information, (int)LogType.CommonDateEdit, action); }
public void LogCommonDataEditAction(CommonDataEditAction action) { LogDS logDS = new LogDS(); LogDS.CommonDataEditActionLogRow log = logDS.CommonDataEditActionLog.NewCommonDataEditActionLogRow(); log.ActionTime = action.ActionTime; log.ActionType = action.ActionType; log.DataTableName = action.DataTableName; if (action.NewValue != null) { log.NewValue = action.NewValue; } if (action.OldValue != null) { log.OldValue = action.OldValue; } if (action.StuffId != null) { log.StuffId = action.StuffId; } log.StuffName = action.StuffName; logDS.CommonDataEditActionLog.AddCommonDataEditActionLogRow(log); this.CommonDataEditActionLogTA.Update(logDS.CommonDataEditActionLog); }