public int UpdateCommissionSetup(CommissionSetup _CommissionSetup) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_CommissionSetup.CommissionId)) { IsRecordExist = _IUoW.Repository <CommissionSetup>().IsRecordExist(x => x.CommissionId == _CommissionSetup.CommissionId); if (IsRecordExist) { var _oldCommissionSetup = _IUoW.Repository <CommissionSetup>().GetBy(x => x.CommissionId == _CommissionSetup.CommissionId); var _oldCommissionSetupForLog = ObjectCopier.DeepCopy(_oldCommissionSetup); _oldCommissionSetup.AuthStatusId = _CommissionSetup.AuthStatusId = "U"; _oldCommissionSetup.LastAction = _CommissionSetup.LastAction = "EDT"; _oldCommissionSetup.LastUpdateDT = _CommissionSetup.LastUpdateDT = System.DateTime.Now; _CommissionSetup.MakeBy = "mtaka"; result = _IUoW.Repository <CommissionSetup>().Update(_oldCommissionSetup); #region Testing Purpose #endregion #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, _oldCommissionSetupForLog, _CommissionSetup, "EDT", "0001", "090101008", 1, "CommissionSetup", "MTK_COMMISSION_SETUP", "CommisionId", _CommissionSetup.CommissionId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateCommissionSetup(obj)", string.Empty); return(0); } }
public int UpdateUpazilaInfo(UpazilaInfo _UpazilaInfo) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_UpazilaInfo.UpazilaId)) { IsRecordExist = _IUoW.Repository <UpazilaInfo>().IsRecordExist(x => x.UpazilaId == _UpazilaInfo.UpazilaId); if (IsRecordExist) { var _oldUpazilaInfo = _IUoW.Repository <UpazilaInfo>().GetBy(x => x.UpazilaId == _UpazilaInfo.UpazilaId); var _oldUpazilaInfoForLog = ObjectCopier.DeepCopy(_oldUpazilaInfo); _oldUpazilaInfo.AuthStatusId = _UpazilaInfo.AuthStatusId = "U"; _oldUpazilaInfo.LastAction = _UpazilaInfo.LastAction = "EDT"; _oldUpazilaInfo.LastUpdateDT = _UpazilaInfo.LastUpdateDT = System.DateTime.Now; _UpazilaInfo.MakeBy = "mtaka"; result = _IUoW.Repository <UpazilaInfo>().Update(_oldUpazilaInfo); #region Testing Purpose #endregion #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, _oldUpazilaInfoForLog, _UpazilaInfo, "EDT", "0001", "090101006", 1, "UpazilaInfo", "MTK_CP_UPAZILA_INFO", "UpazilaId", _UpazilaInfo.UpazilaId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateUpazilaInfo(obj)", string.Empty); return(0); } }
public int UpdateGLChart(GLChart _GLChart) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_GLChart.GLAccSl)) { IsRecordExist = _IUoW.Repository <GLChart>().IsRecordExist(x => x.GLAccSl == _GLChart.GLAccSl); if (IsRecordExist) { var _oldAccStatusSetup = _IUoW.Repository <GLChart>().GetBy(x => x.GLAccSl == _GLChart.GLAccSl); var _oldAccStatusSetupForLog = ObjectCopier.DeepCopy(_oldAccStatusSetup); _oldAccStatusSetup.AuthStatusId = _GLChart.AuthStatusId = "U"; _oldAccStatusSetup.LastAction = _GLChart.LastAction = "EDT"; _oldAccStatusSetup.LastUpdateDT = _GLChart.LastUpdateDT = System.DateTime.Now; _GLChart.MakeBy = "mtaka"; result = _IUoW.Repository <GLChart>().Update(_oldAccStatusSetup); #region Testing Purpose #endregion #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, _oldAccStatusSetupForLog, _GLChart, "EDT", "0001", "090102007", 1, "GLChart", "MTK_GL_CHART", "GLAccSl", _GLChart.GLAccSl, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateAccStatusSetup(obj)", string.Empty); return(0); } }
public int UpdateDefineService(DefineService _DefineService) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_DefineService.DefineServiceId)) { IsRecordExist = _IUoW.Repository <DefineService>().IsRecordExist(x => x.DefineServiceId == _DefineService.DefineServiceId); if (IsRecordExist) { var _oldDefineService = _IUoW.Repository <DefineService>().GetBy(x => x.DefineServiceId == _DefineService.DefineServiceId); var _oldDefineServiceForLog = ObjectCopier.DeepCopy(_oldDefineService); _oldDefineService.AuthStatusId = _DefineService.AuthStatusId = "U"; _oldDefineService.LastAction = _DefineService.LastAction = "EDT"; _oldDefineService.LastUpdateDT = _DefineService.LastUpdateDT = System.DateTime.Now; _DefineService.MakeBy = "prova"; result = _IUoW.Repository <DefineService>().Update(_oldDefineService); #region Testing Purpose #endregion #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, _oldDefineServiceForLog, _DefineService, "EDT", "0001", _DefineService.FunctionId, 1, "DefineService", "MTK_SP_DEFINE_SERVICE", "DefineServiceId", _DefineService.DefineServiceId, _DefineService.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateDefineService(obj)", string.Empty); return(0); } }
public int DeleteTransactionRules(TransactionRules _TransactionRules) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_TransactionRules.TransactionRuleId)) { IsRecordExist = _IUoW.Repository <TransactionRules>().IsRecordExist(x => x.TransactionRuleId == _TransactionRules.TransactionRuleId); if (IsRecordExist) { var _OldTransactionRule = _IUoW.Repository <TransactionRules>().GetBy(x => x.TransactionRuleId == _TransactionRules.TransactionRuleId); var _OldTransactionRuleForLog = ObjectCopier.DeepCopy(_OldTransactionRule); _OldTransactionRule.AuthStatusId = "D"; _OldTransactionRule.LastUpdateDT = System.DateTime.Now; _OldTransactionRule.LastAction = "DEL"; result = _IUoW.Repository <TransactionRules>().Update(_OldTransactionRule); #region Auth log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, _OldTransactionRuleForLog, _TransactionRules, "DEL", "0001", _TransactionRules.FunctionId, 1, "TransactionRules", "MTK_SP_TRANSACTION_RULES", "TransactionRuleId", _TransactionRules.TransactionRuleId, _TransactionRules.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeleteTransactionRules(obj)", string.Empty); return(0); } }
public int UpdateUsbParam(UsbParam _UsbParam) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_UsbParam.PvId)) { IsRecordExist = _IUoW.Repository <UsbParam>().IsRecordExist(x => x.PvId == _UsbParam.PvId); if (IsRecordExist) { var _oldUsbParam = _IUoW.Repository <UsbParam>().GetBy(x => x.PvId == _UsbParam.PvId); var _oldUsbParamForLog = ObjectCopier.DeepCopy(_oldUsbParam); _oldUsbParam.AuthStatusId = _UsbParam.AuthStatusId = "U"; _oldUsbParam.LastAction = _UsbParam.LastAction = "EDT"; _oldUsbParam.LastUpdateDT = _UsbParam.LastUpdateDT = System.DateTime.Now; _UsbParam.MakeBy = "mtaka"; result = _IUoW.Repository <UsbParam>().Update(_oldUsbParam); //#region Auth Log //if (result == 1) //{ // _IAuthLogService = new AuthLogService(); // return 1; // //long _outMaxSlAuthLogDtl = 0; // //_IAuthLogService.AddAuthLog(_IUoW, _oldUsbParamForLog, _UsbParam, "EDT", "0001", "090102006", 1, "MTK_SP_MANAGER_TYPE", "PvId", _UsbParam.PvId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); // //_IAuthLogService.AddAuthLog(_IUoW, ListTest1, ListTest, "EDT", "0001", "010101002", 0, "TEST", "Id", null, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); //} //#endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateUsbParam(obj)", string.Empty); return(0); } }
public int DeleteCusTypeWiseServiceList(CusTypeWiseServiceList _CusTypeWiseServiceList) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_CusTypeWiseServiceList.CusTypeWiseServiceId)) { IsRecordExist = _IUoW.Repository <CusTypeWiseServiceList>().IsRecordExist(x => x.CusTypeWiseServiceId == _CusTypeWiseServiceList.CusTypeWiseServiceId); if (IsRecordExist) { var _oldCusTypeWiseServiceList = _IUoW.Repository <CusTypeWiseServiceList>().GetBy(x => x.CusTypeWiseServiceId == _CusTypeWiseServiceList.CusTypeWiseServiceId); var _oldCusTypeWiseServiceListForLog = ObjectCopier.DeepCopy(_oldCusTypeWiseServiceList); _oldCusTypeWiseServiceList.AuthStatusId = _CusTypeWiseServiceList.AuthStatusId = "U"; _oldCusTypeWiseServiceList.LastAction = _CusTypeWiseServiceList.LastAction = "DEL"; _oldCusTypeWiseServiceList.LastUpdateDT = _CusTypeWiseServiceList.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository <CusTypeWiseServiceList>().Update(_oldCusTypeWiseServiceList); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, _oldCusTypeWiseServiceListForLog, _CusTypeWiseServiceList, "DEL", "0001", _CusTypeWiseServiceList.FunctionId, 1, "CusTypeWiseServiceList", "MTK_SP_CUS_TYPE_WISE_SERVICE", "CusTypeWiseServiceId", _CusTypeWiseServiceList.CusTypeWiseServiceId, _CusTypeWiseServiceList.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } //result = _IUoW.Repository<CusTypeWiseServiceList>().Delete(_CusTypeWiseServiceList); return(result); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeleteCusTypeWiseServiceList(obj)", string.Empty); return(0); } }
public int DeletePOInfo(PostOfficeInfo _POInfo) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_POInfo.PostOfficeId)) { IsRecordExist = _IUoW.Repository<PostOfficeInfo>().IsRecordExist(x => x.PostOfficeId == _POInfo.PostOfficeId); if (IsRecordExist) { var _old_POInfo = _IUoW.Repository<PostOfficeInfo>().GetBy(x => x.PostOfficeId == _POInfo.PostOfficeId); var _old_POInfoForLog = ObjectCopier.DeepCopy(_old_POInfo); _old_POInfo.AuthStatusId = _POInfo.AuthStatusId = "U"; _old_POInfo.LastAction = _POInfo.LastAction = "DEL"; _old_POInfo.LastUpdateDT = _POInfo.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository<PostOfficeInfo>().Update(_old_POInfo); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, null, _POInfo, "ADD", "0001", "090101009", 1, "PostOfficeInfo", "MTK_CP_PO_INFO", "_POInfoId", _POInfo.PostOfficeId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); //_IAuthLogService.AddAuthLog(_IUoW, null, ListTest, "ADD", "0001", "010101002", 0, "TEST", "ID", null, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return result; } return result; } return result; } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeletePOInfo(obj)", string.Empty); return 0; } }
public int DeleteCustomer(CustomerAccProfile _Customer) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_Customer.AccountProfileId)) { IsRecordExist = _IUoW.Repository <CustomerAccProfile>().IsRecordExist(x => x.AccountProfileId == _Customer.AccountProfileId); if (IsRecordExist) { var _oldCustomerProfile = _IUoW.Repository <CustomerAccProfile>().GetBy(x => x.AccountProfileId == _Customer.AccountProfileId); var _oldCustomerProfileForLog = ObjectCopier.DeepCopy(_oldCustomerProfile); _oldCustomerProfile.AuthStatusId = _Customer.AuthStatusId = "U"; _oldCustomerProfile.LastAction = _Customer.LastAction = "DEL"; _oldCustomerProfile.LastUpdateDT = _Customer.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository <CustomerAccProfile>().Update(_oldCustomerProfile); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, _oldCustomerProfileForLog, _Customer, "DEL", "0001", _Customer.FunctionId, 1, "CustomerAccProfile", "MTK_ACC_CUSTOMER_PROFILE", "AccountProfileId", _Customer.AccountProfileId, _Customer.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } //result = _IUoW.Repository<CustomerProfile>().Delete(_Customer); return(result); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeleteCustomerProfile(obj)", string.Empty); return(0); } }
public int DeleteManagerType(ManagerType _ManagerType) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_ManagerType.ManTypeId)) { IsRecordExist = _IUoW.Repository <ManagerType>().IsRecordExist(x => x.ManTypeId == _ManagerType.ManTypeId); if (IsRecordExist) { var _oldManagerType = _IUoW.Repository <ManagerType>().GetBy(x => x.ManTypeId == _ManagerType.ManTypeId); var _oldManagerTypeForLog = ObjectCopier.DeepCopy(_oldManagerType); _oldManagerType.AuthStatusId = _ManagerType.AuthStatusId = "U"; _oldManagerType.LastAction = _ManagerType.LastAction = "DEL"; _oldManagerType.LastUpdateDT = _ManagerType.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository <ManagerType>().Update(_oldManagerType); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, _oldManagerTypeForLog, _ManagerType, "DEL", "0001", _ManagerType.FunctionId, 1, "ManagerType", "MTK_SP_MANAGER_TYPE", "ManTypeId", _ManagerType.ManTypeId, _ManagerType.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } //result = _IUoW.Repository<ManagerType>().Delete(_ManagerType); return(result); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeleteManagerType(obj)", string.Empty); return(0); } }
public int DeleteBankInfo(BankInfo _BankInfo) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_BankInfo.BankId)) { IsRecordExist = _IUoW.Repository <BankInfo>().IsRecordExist(x => x.BankId == _BankInfo.BankId); if (IsRecordExist) { var _oldBankInfo = _IUoW.Repository <BankInfo>().GetBy(x => x.BankId == _BankInfo.BankId); var _oldBankInfoForLog = ObjectCopier.DeepCopy(_oldBankInfo); _oldBankInfo.AuthStatusId = _BankInfo.AuthStatusId = "U"; _oldBankInfo.LastAction = _BankInfo.LastAction = "DEL"; _oldBankInfo.LastUpdateDT = _BankInfo.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository <BankInfo>().Update(_oldBankInfo); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, _oldBankInfoForLog, _BankInfo, "DEL", "0001", "090101011", 1, "BankInfo", "MTK_CP_BANK_INFO", "BankId", _BankInfo.BankId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } //result = _IUoW.Repository<BankInfo>().Delete(_BankInfo); return(result); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeleteBankInfo(obj)", string.Empty); return(0); } }
public int DeleteChargeRule(ChargeRule _ChargeRule) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_ChargeRule.ChargeRuleId)) { IsRecordExist = _IUoW.Repository <ChargeRule>().IsRecordExist(x => x.ChargeRuleId == _ChargeRule.ChargeRuleId); if (IsRecordExist) { var _oldChargeRule = _IUoW.Repository <ChargeRule>().GetBy(x => x.ChargeRuleId == _ChargeRule.ChargeRuleId); var _oldChargeRuleForLog = ObjectCopier.DeepCopy(_oldChargeRule); _oldChargeRule.AuthStatusId = _ChargeRule.AuthStatusId = "U"; _oldChargeRule.LastAction = _ChargeRule.LastAction = "DEL"; _oldChargeRule.LastUpdateDT = _ChargeRule.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository <ChargeRule>().Update(_oldChargeRule); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, _oldChargeRuleForLog, _ChargeRule, "DEL", "0001", "090102003", 1, "ChargeRule", "MTK_CHG_RULE", "ChargeRuleId", _ChargeRule.ChargeRuleId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } //result = _IUoW.Repository<ChargeRule>().Delete(_ChargeRule); return(result); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeleteChargeRule(obj)", string.Empty); return(0); } }
public int DeletePromoCodeConfig(PromoCodeConfig _PromoCodeConfig) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_PromoCodeConfig.ConfigurationId)) { IsRecordExist = _IUoW.Repository <PromoCodeConfig>().IsRecordExist(x => x.ConfigurationId == _PromoCodeConfig.ConfigurationId); if (IsRecordExist) { var _oldPromoCodeConfig = _IUoW.Repository <PromoCodeConfig>().GetBy(x => x.ConfigurationId == _PromoCodeConfig.ConfigurationId); var _oldPromoCodeConfigForLog = ObjectCopier.DeepCopy(_oldPromoCodeConfig); _oldPromoCodeConfig.AuthStatusId = _PromoCodeConfig.AuthStatusId = "U"; _oldPromoCodeConfig.LastAction = _PromoCodeConfig.LastAction = "DEL"; _oldPromoCodeConfig.LastUpdateDT = _PromoCodeConfig.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository <PromoCodeConfig>().Update(_oldPromoCodeConfig); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, _oldPromoCodeConfigForLog, _PromoCodeConfig, "DEL", "0001", _PromoCodeConfig.FunctionId, 1, "PromoCodeConfig", "MTK_SP_PROMO_CODE_CONFIG", "ConfigurationId", _PromoCodeConfig.ConfigurationId, _PromoCodeConfig.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } //result = _IUoW.Repository<PromoCodeConfig>().Delete(_PromoCodeConfig); return(result); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeletePromoCodeConfig(obj)", string.Empty); return(0); } }
public int DeleteAccCategory(AccCategory _AccCategory) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_AccCategory.AccCategoryId)) { IsRecordExist = _IUoW.Repository <AccCategory>().IsRecordExist(x => x.AccCategoryId == _AccCategory.AccCategoryId); if (IsRecordExist) { var _oldAccCategory = _IUoW.Repository <AccCategory>().GetBy(x => x.AccCategoryId == _AccCategory.AccCategoryId); var _oldAccCategoryForLog = ObjectCopier.DeepCopy(_oldAccCategory); _oldAccCategory.AuthStatusId = _AccCategory.AuthStatusId = "U"; _oldAccCategory.LastAction = _AccCategory.LastAction = "DEL"; _oldAccCategory.LastUpdateDT = _AccCategory.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository <AccCategory>().Update(_oldAccCategory); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, _oldAccCategoryForLog, _AccCategory, "DEL", "0001", _AccCategory.FunctionId, 1, "AccCategory", "MTK_SP_ACC_CATEGORY", "AccCategoryId", _AccCategory.AccCategoryId, _AccCategory.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } //result = _IUoW.Repository<AccCategory>().Delete(_AccCategory); return(result); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeleteAccCategory(obj)", string.Empty); return(0); } }
public int UpdateManagerCategory(ManCategory _ManCategory) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_ManCategory.ManagerCategoryId)) { IsRecordExist = _IUoW.Repository <ManCategory>().IsRecordExist(x => x.ManagerCategoryId == _ManCategory.ManagerCategoryId); if (IsRecordExist) { var _oldManCategory = _IUoW.Repository <ManCategory>().GetBy(x => x.ManagerCategoryId == _ManCategory.ManagerCategoryId); var _oldManCategoryForLog = ObjectCopier.DeepCopy(_oldManCategory); _oldManCategory.AuthStatusId = _ManCategory.AuthStatusId = "U"; _oldManCategory.LastAction = _ManCategory.LastAction = "EDT"; _oldManCategory.LastUpdateDT = _ManCategory.LastUpdateDT = System.DateTime.Now; _ManCategory.MakeBy = "mtaka"; result = _IUoW.Repository <ManCategory>().Update(_oldManCategory); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, _oldManCategoryForLog, _ManCategory, "EDT", "0001", _ManCategory.FunctionId, 1, "ManCategory", "MTK_SP_MAN_CATEGORY", "ManagerCategoryId", _ManCategory.ManagerCategoryId, _ManCategory.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); //_IAuthLogService.AddAuthLog(_IUoW, ListTest1, ListTest, "EDT", "0001", "010101002", 0, "TEST", "Id", null, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateManagerCategory(obj)", string.Empty); return(0); } }
public int UpdateUSBReportingField(USBReportingField _USBReportingField) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_USBReportingField.ReportingId)) { IsRecordExist = _IUoW.Repository <USBReportingField>().IsRecordExist(x => x.ReportingId == _USBReportingField.ReportingId); if (IsRecordExist) { var _oldUSBReportingField = _IUoW.Repository <USBReportingField>().GetBy(x => x.ReportingId == _USBReportingField.ReportingId); var _oldUSBReportingFieldForLog = ObjectCopier.DeepCopy(_oldUSBReportingField); _oldUSBReportingField.AuthStatusId = _USBReportingField.AuthStatusId = "U"; _oldUSBReportingField.LastAction = _USBReportingField.LastAction = "EDT"; _oldUSBReportingField.LastUpdateDT = _USBReportingField.LastUpdateDT = System.DateTime.Now; _USBReportingField.MakeBy = "mtaka"; result = _IUoW.Repository <USBReportingField>().Update(_oldUSBReportingField); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, _oldUSBReportingFieldForLog, _USBReportingField, "EDT", "0001", "090102015", 1, "USBReportingField", "MTK_USB_REPORTING_FIELD", "ReportingId", _USBReportingField.ReportingId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateUSBReportingField(obj)", string.Empty); return(0); } }
public int DeleteTransactionTemplate(TransactionTemplate _TransactionTemplate) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_TransactionTemplate.TransactionTemplateId)) { IsRecordExist = _IUoW.Repository <TransactionTemplate>().IsRecordExist(x => x.TransactionTemplateId == _TransactionTemplate.TransactionTemplateId); if (IsRecordExist) { var _oldTransactionTemplate = _IUoW.Repository <TransactionTemplate>().GetBy(x => x.TransactionTemplateId == _TransactionTemplate.TransactionTemplateId); var _oldTransactionTemplateForLog = ObjectCopier.DeepCopy(_oldTransactionTemplate); _oldTransactionTemplate.AuthStatusId = _TransactionTemplate.AuthStatusId = "U"; _oldTransactionTemplate.LastAction = _TransactionTemplate.LastAction = "DEL"; _oldTransactionTemplate.LastUpdateDT = _TransactionTemplate.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository <TransactionTemplate>().Update(_oldTransactionTemplate); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, _oldTransactionTemplateForLog, _TransactionTemplate, "DEL", "0001", "090102010", 1, "TransactionTemplate", "MTK_SP_TRANSACTION_TEMPLATE", "TransactionTemplateId", _TransactionTemplate.TransactionTemplateId, "prova", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } return(result); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeleteTransactionTemplate(obj)", string.Empty); return(0); } }
public int UpdateManager(ManagerAccProfile _Manager) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_Manager.ManId)) { IsRecordExist = _IUoW.Repository <ManagerAccProfile>().IsRecordExist(x => x.ManId == _Manager.ManId); if (IsRecordExist) { var _oldManagerAccProfile = _IUoW.Repository <ManagerAccProfile>().GetBy(x => x.ManId == _Manager.ManId); var _oldManagerAccProfileForLog = ObjectCopier.DeepCopy(_oldManagerAccProfile); _oldManagerAccProfile.AuthStatusId = _Manager.AuthStatusId = "U"; _oldManagerAccProfile.LastAction = _Manager.LastAction = "EDT"; _oldManagerAccProfile.LastUpdateDT = _Manager.LastUpdateDT = System.DateTime.Now; _Manager.MakeBy = "mtaka"; result = _IUoW.Repository <ManagerAccProfile>().Update(_oldManagerAccProfile); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, _oldManagerAccProfileForLog, _Manager, "EDT", "0001", _Manager.FunctionId, 1, "ManagerAccProfile", "MTK_AM_MANAGER_PROFILE", "ManId", _Manager.ManId, _Manager.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateManager(obj)", string.Empty); return(0); } }
public int DeleteSpecialOffers(SpecialOffers _SpecialOffers) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_SpecialOffers.OfferId)) { IsRecordExist = _IUoW.Repository <SpecialOffers>().IsRecordExist(x => x.OfferId == _SpecialOffers.OfferId); if (IsRecordExist) { var _oldSpecialOffers = _IUoW.Repository <SpecialOffers>().GetBy(x => x.OfferId == _SpecialOffers.OfferId); var _oldSpecialOffersForLog = ObjectCopier.DeepCopy(_oldSpecialOffers); _oldSpecialOffers.AuthStatusId = _SpecialOffers.AuthStatusId = "U"; _oldSpecialOffers.LastAction = _SpecialOffers.LastAction = "DEL"; _oldSpecialOffers.LastUpdateDT = _SpecialOffers.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository <SpecialOffers>().Update(_oldSpecialOffers); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, _oldSpecialOffersForLog, _SpecialOffers, "DEL", "0001", _SpecialOffers.FunctionId, 1, "SpecialOffers", "MTK_SP_SPECIAL_OFFERS", "OfferId", _SpecialOffers.OfferId, _SpecialOffers.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } return(result); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeleteSpecialOffers(obj)", string.Empty); return(0); } }
public int UpdateIdentificationType(IdentificationType _IdentificationType) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_IdentificationType.IdentificationId)) { IsRecordExist = _IUoW.Repository <IdentificationType>().IsRecordExist(x => x.IdentificationId == _IdentificationType.IdentificationId); if (IsRecordExist) { var _oldIdentificationType = _IUoW.Repository <IdentificationType>().GetBy(x => x.IdentificationId == _IdentificationType.IdentificationId); var _oldIdentificationTypeForLog = ObjectCopier.DeepCopy(_oldIdentificationType); _oldIdentificationType.AuthStatusId = _IdentificationType.AuthStatusId = "U"; _oldIdentificationType.LastAction = _IdentificationType.LastAction = "EDT"; _oldIdentificationType.LastUpdateDT = _IdentificationType.LastUpdateDT = System.DateTime.Now; _oldIdentificationType.MakeBy = "mtaka"; result = _IUoW.Repository <IdentificationType>().Update(_oldIdentificationType); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, _oldIdentificationTypeForLog, _IdentificationType, "EDT", "0001", "010101001", 1, "IdentificationType", "MTK_CP_IDENTIFICATION_TYPE", "IdentificationId", _IdentificationType.IdentificationId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateIdentificationType(obj)", string.Empty); return(0); } }
public int UpdateAccLimit(AccLimitSetup _AccLimit) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_AccLimit.AccLimitId)) { IsRecordExist = _IUoW.Repository <AccLimitSetup>().IsRecordExist(x => x.AccLimitId == _AccLimit.AccLimitId); if (IsRecordExist) { var _oldAccLimit = _IUoW.Repository <AccLimitSetup>().GetBy(x => x.AccLimitId == _AccLimit.AccLimitId); var _oldAccLimitForLog = ObjectCopier.DeepCopy(_oldAccLimit); _oldAccLimit.AuthStatusId = _AccLimit.AuthStatusId = "U"; _oldAccLimit.LastAction = _AccLimit.LastAction = "EDT"; _oldAccLimit.LastUpdateDT = _AccLimit.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository <AccLimitSetup>().Update(_oldAccLimit); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, _oldAccLimitForLog, _AccLimit, "EDT", "0001", _AccLimit.FunctionId, 1, "AccLimitSetup", "MTK_ACC_LIMIT_SETUP", "AccLimitId", _AccLimit.AccLimitId, _AccLimit.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateAccLimit(obj)", string.Empty); return(0); } }
public int DeleteAccLimit(AccLimitSetup _AccLimit) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_AccLimit.AccLimitId)) { IsRecordExist = _IUoW.Repository <AccLimitSetup>().IsRecordExist(x => x.AccLimitId == _AccLimit.AccLimitId); if (IsRecordExist) { var _oldAccLimit = _IUoW.Repository <AccLimitSetup>().GetBy(x => x.AccLimitId == _AccLimit.AccLimitId); var _oldAccLimitForLog = ObjectCopier.DeepCopy(_oldAccLimit); _oldAccLimit.AuthStatusId = _AccLimit.AuthStatusId = "U"; _oldAccLimit.LastAction = _AccLimit.LastAction = "DEL"; _oldAccLimit.LastUpdateDT = _AccLimit.LastUpdateDT = System.DateTime.Now; result = _IUoW.Repository <AccLimitSetup>().Update(_oldAccLimit); #region Auth Log _IAuthLogService = new AuthLogService(); //result = _IAuthLogService.AddAuthLog(_IUoW, _oldAccLimitForLog, _AccLimit, "DEL", "0001", "090102008", 1, "AccLimitSetup", "MFS_ACC_LIMIT", "MFS_ACC_LIMIT", _AccLimit.AccLimitId, "prova"); #endregion if (result == 1) { _IUoW.Commit(); } return(result); } return(result); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "DeleteAccLimit(obj)", string.Empty); return(0); } }
public int UpdateCusType(CusType _CusType) { try { int result = 0; bool IsRecordExist; if (!string.IsNullOrWhiteSpace(_CusType.CusTypeId)) { IsRecordExist = _IUoW.Repository <CusType>().IsRecordExist(x => x.CusTypeId == _CusType.CusTypeId); if (IsRecordExist) { var _oldCusType = _IUoW.Repository <CusType>().GetBy(x => x.CusTypeId == _CusType.CusTypeId); var _oldCusTypeForLog = ObjectCopier.DeepCopy(_oldCusType); _oldCusType.AuthStatusId = _CusType.AuthStatusId = "U"; _oldCusType.LastAction = _CusType.LastAction = "EDT"; _oldCusType.LastUpdateDT = _CusType.LastUpdateDT = System.DateTime.Now; _CusType.MakeBy = "mtaka"; result = _IUoW.Repository <CusType>().Update(_oldCusType); #region Testing Purpose //List<Test> ListTest = new List<Test>(); //for (int i = 0; i < 5; i++) //{ // Test Obj_Test = new Test(); // Obj_Test.Id = i.ToString(); // Obj_Test.Name = "T" + i.ToString(); // ListTest.Add(Obj_Test); //} //_CusType.ListTest = ListTest; //List<Test> ListTest1 = new List<Test>(); //for (int i = 0; i < 5; i++) //{ // Test Obj_Test = new Test(); // Obj_Test.Id = i.ToString(); // Obj_Test.Name = "T" + (i + 10).ToString(); // ListTest1.Add(Obj_Test); //} #endregion #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, _oldCusTypeForLog, _CusType, "EDT", "0001", _CusType.FunctionId, 1, "CusType", "MTK_SP_CUS_TYPE", "CusTypeId", _CusType.CusTypeId, _CusType.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); //_IAuthLogService.AddAuthLog(_IUoW, ListTest1, ListTest, "EDT", "0001", "010101002", 0, "TEST", "Id", null, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdateCusType(obj)", string.Empty); return(0); } }
public int AddGLChart(GLChart _GLChart) { try { int result = 0; _GLChart.GLAccSl = _IUoW.mTakaDbQuery().MaxGLAccSL(_GLChart.GLPrefix).ToString(); _GLChart.GLAccNo = _GLChart.GLPrefix + _GLChart.GLAccNo; _GLChart.OpeningDate = Convert.ToDateTime(_GLChart.OpeningDate.ToShortDateString()).Date.AddDays(1); _GLChart.GLType = _GLChart.GLType.Substring(0, 1); _GLChart.AuthStatusId = "U"; _GLChart.LastAction = "ADD"; _GLChart.MakeDT = System.DateTime.Now; _GLChart.MakeBy = "mtaka"; result = _IUoW.Repository <GLChart>().Add(_GLChart); if (result != 1) { return(result); } var _GLMaster = AutoMapperCFG.SetObjectMapping <GLChart, GLMaster>(_GLChart); List <GLMaster> _ListGLMaster = new List <GLMaster>(); List <BranchInfo> _ListBranch = _IUoW.Repository <BranchInfo>().Get(x => x.AuthStatusId == "A" && x.LastAction != "DEL").OrderBy(x => x.BranchId).ToList(); var _maxSl = _IUoW.Repository <GLMaster>().GetMaxValue(x => x.Sl) + 1; for (int i = 0; i < _ListBranch.Count(); i++) { _GLMaster.Sl = (_maxSl++).ToString(); _GLMaster.BranchId = _ListBranch[i].BranchId; GLMaster _GLMasterTemp = ObjectCopier.DeepCopy(_GLMaster); _ListGLMaster.Add(_GLMasterTemp); } result = _IUoW.Repository <GLMaster>().AddRange(_ListGLMaster); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; result = _IAuthLogService.AddAuthLog(_IUoW, null, _GLChart, "ADD", "0001", "090102017", 1, "GLChart", "MTK_GL_CHART", "GLAccSl", _GLChart.GLAccSl, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); if (result == 1) { result = _IAuthLogService.AddAuthLog(_IUoW, null, _ListGLMaster, "ADD", "0001", "090102017", 0, "GLMaster", "MTK_GL_MASTER", "Sl", null, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "AddGLChart(obj)", string.Empty); return(0); } }
public int AddOrUpdatePromoCodeConfig(PromoCodeConfig _PromoCodeConfig) { try { int result = 0; bool IsRecordExist; var _IfExistPromoCodeConfig = _IUoW.Repository <PromoCodeConfig>().GetAll(); if (_IfExistPromoCodeConfig.Count == 0) { var _max = _IUoW.Repository <PromoCodeConfig>().GetMaxValue(x => x.ConfigurationId) + 1; _PromoCodeConfig.ConfigurationId = _max.ToString().PadLeft(3, '0'); _PromoCodeConfig.AuthStatusId = "A"; _PromoCodeConfig.LastAction = "ADD"; _PromoCodeConfig.MakeBy = "mTaka"; _PromoCodeConfig.MakeDT = System.DateTime.Now; #region Checked True/False if (_PromoCodeConfig.IntroducerControlFlag == "True") { _PromoCodeConfig.IntroducerControlFlag = "1"; } else { _PromoCodeConfig.IntroducerControlFlag = "0"; } if (_PromoCodeConfig.EmailFlag == "True") { _PromoCodeConfig.EmailFlag = "1"; } else { _PromoCodeConfig.EmailFlag = "0"; } if (_PromoCodeConfig.SMSFlag == "True") { _PromoCodeConfig.SMSFlag = "1"; } else { _PromoCodeConfig.SMSFlag = "0"; } #endregion result = _IUoW.Repository <PromoCodeConfig>().Add(_PromoCodeConfig); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, null, _PromoCodeConfig, "ADD", "0001", _PromoCodeConfig.FunctionId, 1, "PromoCodeConfig", "MTK_SP_PROMO_CODE_CONFIG", "ConfigurationId", _PromoCodeConfig.ConfigurationId, _PromoCodeConfig.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } if (_IfExistPromoCodeConfig.Count != 0) { if (!string.IsNullOrWhiteSpace(_PromoCodeConfig.ConfigurationId)) { var _oldPromoCodeConfig = _IUoW.Repository <PromoCodeConfig>().GetBy(x => x.ConfigurationId == _PromoCodeConfig.ConfigurationId); if (_oldPromoCodeConfig != null) { var _oldPromoCodeConfigForLog = ObjectCopier.DeepCopy(_oldPromoCodeConfig); _oldPromoCodeConfig.AuthStatusId = _PromoCodeConfig.AuthStatusId = "U"; _oldPromoCodeConfig.LastAction = _PromoCodeConfig.LastAction = "EDT"; _oldPromoCodeConfig.LastUpdateDT = _PromoCodeConfig.LastUpdateDT = System.DateTime.Now; _PromoCodeConfig.MakeBy = "mtaka"; result = _IUoW.Repository <PromoCodeConfig>().Update(_oldPromoCodeConfig); #region Auth Log if (result == 1) { _IAuthLogService = new AuthLogService(); long _outMaxSlAuthLogDtl = 0; _IAuthLogService.AddAuthLog(_IUoW, _oldPromoCodeConfigForLog, _PromoCodeConfig, "EDT", "0001", _PromoCodeConfig.FunctionId, 1, "PromoCodeConfig", "MTK_SP_PROMO_CODE_CONFIG", "ConfigurationId", _PromoCodeConfig.ConfigurationId, _PromoCodeConfig.UserName, _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); } #endregion if (result == 1) { _IUoW.Commit(); } return(result); } } } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "UpdatePromoCodeConfig(obj)", string.Empty); return(0); } }
public int AddAccLimit(AccLimitSetup _AccLimit) { try { int result = 0; var _max = _IUoW.Repository <AccLimitSetup>().GetMaxValue(x => x.AccLimitId) + 1; if (_AccLimit.AllAccCategory == "True") { var List_Acc_Group = _IUoW.Repository <AccCategory>().GetBy(x => x.AuthStatusId == "A" && x.LastAction != "DEL", n => new { n.AccCategoryId, n.AccCategoryNm }); List <AccLimitSetup> List_AccLimitSetup = new List <AccLimitSetup>(); foreach (var element in List_Acc_Group) { AccLimitSetup _AccLimitTemp = new AccLimitSetup(); _AccLimitTemp = ObjectCopier.DeepCopy(_AccLimit); _AccLimitTemp.AccLimitId = (_max++).ToString().PadLeft(3, '0'); _AccLimitTemp.AccCategoryId = element.AccCategoryId; _AccLimitTemp.AuthStatusId = "A"; _AccLimitTemp.LastAction = "ADD"; _AccLimit.MakeBy = "prova"; _AccLimitTemp.MakeDT = System.DateTime.Now; _AccLimitTemp.TransDT = Convert.ToDateTime(System.DateTime.Now.ToString("dd/MM/yyyy")); List_AccLimitSetup.Add(_AccLimitTemp); //result = _IUoW.Repository<AccLimitSetup>().AddRange(List_AccLimitSetup); } result = _IUoW.Repository <AccLimitSetup>().AddRange(List_AccLimitSetup); //if(result == 1) //{ // _IUoW.Commit(); //} } if (_AccLimit.AllAccType == "True") { var List_Acc_Type = _IUoW.Repository <AccType>().GetBy(x => x.AuthStatusId == "A" && x.LastAction != "DEL", n => new { n.AccTypeId, n.AccTypeNm }); List <AccLimitSetup> List_AccLimitSetup = new List <AccLimitSetup>(); foreach (var element in List_Acc_Type) { AccLimitSetup _AccLimitTemp = new AccLimitSetup(); _AccLimitTemp = ObjectCopier.DeepCopy(_AccLimit); _AccLimitTemp.AccLimitId = (_max++).ToString().PadLeft(3, '0'); _AccLimitTemp.AccTypeId = element.AccTypeId; _AccLimitTemp.AuthStatusId = "A"; _AccLimitTemp.LastAction = "ADD"; _AccLimit.MakeBy = "prova"; _AccLimitTemp.MakeDT = System.DateTime.Now; _AccLimitTemp.TransDT = Convert.ToDateTime(System.DateTime.Now.ToString("dd/MM/yyyy")); List_AccLimitSetup.Add(_AccLimitTemp); //result = _IUoW.Repository<AccLimitSetup>().AddRange(List_AccLimitSetup); } result = _IUoW.Repository <AccLimitSetup>().AddRange(List_AccLimitSetup); //if (result == 1) //{ // _IUoW.Commit(); //} } if (_AccLimit.AllDefineService == "True") { var List_DefineService = _IUoW.Repository <DefineService>().GetBy(x => x.AuthStatusId == "A" && x.LastAction != "DEL", n => new { n.DefineServiceId, n.DefineServiceNm }); List <AccLimitSetup> List_AccLimitSetup = new List <AccLimitSetup>(); foreach (var element in List_DefineService) { AccLimitSetup _AccLimitTemp = new AccLimitSetup(); _AccLimitTemp = ObjectCopier.DeepCopy(_AccLimit); _AccLimitTemp.AccLimitId = (_max++).ToString().PadLeft(3, '0'); _AccLimitTemp.DefineServiceId = element.DefineServiceId; _AccLimitTemp.AuthStatusId = "A"; _AccLimitTemp.LastAction = "ADD"; _AccLimit.MakeBy = "prova"; _AccLimitTemp.MakeDT = System.DateTime.Now; _AccLimitTemp.TransDT = Convert.ToDateTime(System.DateTime.Now.ToString("dd/MM/yyyy")); List_AccLimitSetup.Add(_AccLimitTemp); //result = _IUoW.Repository<AccLimitSetup>().AddRange(List_AccLimitSetup); } result = _IUoW.Repository <AccLimitSetup>().AddRange(List_AccLimitSetup); //if (result == 1) //{ // _IUoW.Commit(); //} //return result; } if (_AccLimit != null && string.IsNullOrWhiteSpace(_AccLimit.AllAccCategory) && string.IsNullOrWhiteSpace(_AccLimit.AllAccType) && string.IsNullOrWhiteSpace(_AccLimit.AllDefineService)) { _AccLimit.AccLimitId = _max.ToString().PadLeft(3, '0'); _AccLimit.AuthStatusId = "A"; _AccLimit.LastAction = "ADD"; _AccLimit.MakeBy = "prova"; _AccLimit.MakeDT = System.DateTime.Now; _AccLimit.TransDT = Convert.ToDateTime(System.DateTime.Now.ToString("dd/MM/yyyy")); result = _IUoW.Repository <AccLimitSetup>().Add(_AccLimit); //if (result == 1) //{ // _IUoW.Commit(); //} //return result; } //#region Auth Log //if (result == 1) //{ // _IAuthLogService = new AuthLogService(); // long _outMaxSlAuthLogDtl = 0; // result = _IAuthLogService.AddAuthLog(_IUoW, null, _AccLimit, "ADD", "0001", "090102008", 1, "MTK_SP_CUS_TYPE", "AccLimitId", _AccLimit.AccLimitId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl); //} //#endregion if (result == 1) { _IUoW.Commit(); } return(result); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "AddAccLimit(obj)", string.Empty); return(0); } }