public object SaveActionPendingCbsAccounts(BatchUpdateModel model) { try { var mtcbsinfos = ConvertBatchUpdateModelToMtCbsinfoModelForCheck(model); foreach (MtCbsinfo mtcbsinfo in mtcbsinfos) { if (String.IsNullOrEmpty(mtcbsinfo.CheckBy)) { return(HttpStatusCode.Unauthorized); } if (mtcbsinfo.CheckStatus != null && mtcbsinfo.CheckStatus != "P") { var cbsInfoPrev = _repository.GetMappedAccountByAccNo(mtcbsinfo.Accno); _repository.ChekCbsAccuntByAccNo(mtcbsinfo); var cbsInfoCurrent = _repository.GetMappedAccountByAccNo(mtcbsinfo.Accno); auditTrailService.InsertUpdatedModelToAuditTrail(cbsInfoCurrent, cbsInfoPrev, mtcbsinfo.CheckBy, 8, 4, "Acc Mapping Check", mtcbsinfo.Mphone, "Successfully Checked"); } } return(HttpStatusCode.OK); } catch (Exception ex) { throw; } }
public object AproveOrRejectDisburseAmountPosting(string evnt, [FromBody] FundTransfer fundTransferModel) { string checkedUser = fundTransferModel.CheckUser; //fundTransferModel = _fundTransferService.SingleOrDefaultByCustomField(fundTransferModel.TransNo, "TransNo", new FundTransfer()); //fundTransferModel.CheckUser = checkedUser; TblDisburseAmtDtlMake objTblDisburseAmtDtlMake = new TblDisburseAmtDtlMake(); objTblDisburseAmtDtlMake = _disburseAmtDtlMakeService.SingleOrDefaultByCustomField(fundTransferModel.TransNo, "Tranno", new TblDisburseAmtDtlMake()); try { if (evnt == "register") { //fundTransferModel.Status = "A"; objTblDisburseAmtDtlMake.Status = "C"; objTblDisburseAmtDtlMake.CheckerId = checkedUser; objTblDisburseAmtDtlMake.CheckTime = System.DateTime.Now; var successOrErrorMsg = _disbursementService.DataInsertToTransMSTandDTL(objTblDisburseAmtDtlMake); if (successOrErrorMsg.ToString() == "1") { //Insert into audit trial audit and detail TblDisburseAmtDtlMake prevModel = _disburseAmtDtlMakeService.SingleOrDefaultByCustomField(fundTransferModel.TransNo, "Tranno", new TblDisburseAmtDtlMake()); prevModel.Status = "M";//insert for only audit trail _auditTrailService.InsertUpdatedModelToAuditTrail(objTblDisburseAmtDtlMake, prevModel, objTblDisburseAmtDtlMake.CheckerId, 10, 4, "Disburse Amount Posting", objTblDisburseAmtDtlMake.CompanyId.ToString(), "Approved Successfully!"); } return(successOrErrorMsg); } else if (evnt == "reject") { objTblDisburseAmtDtlMake.Status = "R"; objTblDisburseAmtDtlMake.CheckerId = checkedUser; objTblDisburseAmtDtlMake.CheckTime = System.DateTime.Now; _disburseAmtDtlMakeService.UpdateByStringField(objTblDisburseAmtDtlMake, "Tranno"); //Insert into audit trial audit and detail TblDisburseAmtDtlMake prevModel = _disburseAmtDtlMakeService.SingleOrDefaultByCustomField(fundTransferModel.TransNo, "Tranno", new TblDisburseAmtDtlMake()); prevModel.Status = "M";//insert for only audit trail _auditTrailService.InsertUpdatedModelToAuditTrail(objTblDisburseAmtDtlMake, prevModel, objTblDisburseAmtDtlMake.CheckerId, 10, 4, "Disburse Amount Posting", objTblDisburseAmtDtlMake.CompanyId.ToString(), "Rejected Successfully!"); return(true); } else { return(true); } } catch (Exception ex) { return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString())); } }
public object ExecuteAgentReplace(string exMobileNo, string newMobileNo, string exCluster, string newCluster, string entryBy, [FromBody] List <AgentPhoneCode> objAgentPhoneCodeList) { try { string result = null, response = null; //result = _service.ExecuteAgentReplace(roleName, userName, evnt, objTblBdStatusList).ToString(); foreach (var item in objAgentPhoneCodeList) { result = _service.ExecuteAgentReplace(newMobileNo, exCluster, newCluster, item); response = (result == "1") ? "Agent Replaced Successfully!" : result; AgentPhoneAuditTrail prevAgentPhoneAuditTrail = new AgentPhoneAuditTrail(); prevAgentPhoneAuditTrail.Mphone = item.AgentPhone; prevAgentPhoneAuditTrail.Pmphone = exMobileNo; AgentPhoneAuditTrail currentAgentPhoneAuditTrail = new AgentPhoneAuditTrail(); currentAgentPhoneAuditTrail.Mphone = item.AgentPhone; currentAgentPhoneAuditTrail.Pmphone = newMobileNo; _auditTrailService.InsertUpdatedModelToAuditTrail(currentAgentPhoneAuditTrail, prevAgentPhoneAuditTrail, entryBy, 8, 4, "Agent Replacement", item.AgentPhone, response); } return(result); } catch (Exception ex) { return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString())); } }
public object Save([FromBody] ApplicationUser model) { try { if (model.Id != 0) { ApplicationUser prevModel = usersService.SingleOrDefault(model.Id, new ApplicationUser()); model.UpdatedDate = DateTime.Now; usersService.Update(model); //Insert into audit trial audit and detail //ApplicationUser prevModel = usersService.SingleOrDefault(model.Id, new ApplicationUser()); //prevModel.Status = "default";//insert for only audit trail _auditTrailService.InsertUpdatedModelToAuditTrail(model, prevModel, model.UpdatedBy, 7, 4, "Application User", model.Username, "Updated Successfully!"); return(model); } else { model = generateSecuredCredentials(model); model = usersService.Add(model); string messagePrefix = ", Your Account Has been Created on OK Wallet Admin Application. Your username is " + model.Username + " and password is " + model.PlainPassword; MessageModel messageModel = new MessageModel() { Mphone = model.MobileNo, MessageId = "999", MessageBody = "Dear " + model.Name + messagePrefix + ". Thank you." }; MessageService messageService = new MessageService(); messageService.SendMessage(messageModel); //Insert into audit trial audit and detail _auditTrailService.InsertModelToAuditTrail(model, model.CreatedBy, 7, 3, "Application User", model.Username, "Saved Successfully!"); return(model); } } catch (Exception ex) { return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString())); } }
public object Save(bool isEditMode, string evnt, [FromBody] TblCashEntry cashEntry) { try { if (isEditMode != true) { try { cashEntry.Status = ""; cashEntry.TransNo = _distributorDepositService.GetTransactionNo(); cashEntry.TransDate = System.DateTime.Now; _distributorDepositService.Add(cashEntry); //Insert into audit trial audit and detail cashEntry.Status = "default";//insert for only audit trail _auditTrailService.InsertModelToAuditTrail(cashEntry, cashEntry.CreateUser, 9, 3, "Distributor Deposit", cashEntry.AcNo, "Saved Successfully!"); } catch (Exception) { throw; } return(true); } else { if (evnt == "edit") { try { cashEntry.Status = ""; cashEntry.UpdateDate = System.DateTime.Now; _distributorDepositService.UpdateByStringField(cashEntry, "TransNo"); //Insert into audit trial audit and detail cashEntry.Status = "default"; //insert for only audit trail TblCashEntry prevModel = _distributorDepositService.GetDestributorDepositByTransNo(cashEntry.TransNo); prevModel.Status = "default"; //insert for only audit trail _auditTrailService.InsertUpdatedModelToAuditTrail(cashEntry, prevModel, cashEntry.UpdateUser, 9, 4, "Distributor Deposit", cashEntry.AcNo, "Updated Successfully!"); } catch (Exception ex) { throw; } return(true); } else if (evnt == "register") { cashEntry.Status = "P"; cashEntry.CheckedDate = System.DateTime.Now; //insert into gl_trans_dtl and gl_trans_mst and RegInfo var successOrErrorMsg = _distributorDepositService.DataInsertToTransMSTandDTL(cashEntry); //Insert into audit trial audit and detail TblCashEntry prevModel = _distributorDepositService.GetDestributorDepositByTransNo(cashEntry.TransNo); prevModel.Status = "default";//insert for only audit trail prevModel.CheckedUser = ""; _auditTrailService.InsertUpdatedModelToAuditTrail(cashEntry, prevModel, cashEntry.CheckedUser, 9, 4, "Distributor Deposit", cashEntry.AcNo, "Approved Successfully!"); return(successOrErrorMsg); } else { cashEntry.Status = "M";// M means pass to maker cashEntry.CheckedDate = System.DateTime.Now; _distributorDepositService.UpdateByStringField(cashEntry, "TransNo"); //Insert into audit trial audit and detail TblCashEntry prevModel = _distributorDepositService.GetDestributorDepositByTransNo(cashEntry.TransNo); prevModel.Status = "default";//insert for only audit trail prevModel.CheckedUser = ""; _auditTrailService.InsertUpdatedModelToAuditTrail(cashEntry, prevModel, cashEntry.CheckedUser, 9, 4, "Distributor Deposit", cashEntry.AcNo, "Pass to Maker Successfully!"); return(true); } } } catch (Exception ex) { return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString())); } }
public object SaveCommissionConversion(bool isEditMode, string evnt, [FromBody] TblCommissionConversion tblCommissionConversion) { try { if (isEditMode != true) { try { tblCommissionConversion.Status = ""; tblCommissionConversion.TransNo = _CommissionConversionService.GetTransactionNo(); tblCommissionConversion.CreateDate = System.DateTime.Now; //_CommissionConversionService.Add(tblCommissionConversion); _CommissionConversionService.AddBySP(tblCommissionConversion); //Insert into audit trial audit and detail tblCommissionConversion.Status = "default";//insert for only audit trail _auditTrailService.InsertModelToAuditTrail(tblCommissionConversion, tblCommissionConversion.CreateUser, 9, 3, "Distributor Deposit", tblCommissionConversion.Mphone, "Saved Successfully!"); } catch (Exception) { throw; } return(true); } else { //if (evnt == "edit") //{ // try // { // tblCommissionConversion.Status = ""; // _CommissionConversionService.UpdateByStringField(tblCommissionConversion, "TransNo"); // //Insert into audit trial audit and detail // tblCommissionConversion.Status = "default";//insert for only audit trail // TblCashEntry prevModel = _CommissionConversionService.GetDestributorDepositByTransNo(tblCommissionConversion.TransNo); // prevModel.Status = "default";//insert for only audit trail // _auditTrailService.InsertUpdatedModelToAuditTrail(tblCommissionConversion, prevModel, tblCommissionConversion.UpdateUser, 9, 4, "Distributor Deposit", cashEntry.AcNo, "Updated Successfully!"); // } // catch (Exception ex) // { // throw; // } // return true; //} //else if (evnt == "register") if (evnt == "register") { tblCommissionConversion.Status = "P"; tblCommissionConversion.CheckedDate = System.DateTime.Now; //insert into gl_trans_dtl and gl_trans_mst and RegInfo var successOrErrorMsg = _CommissionConversionService.DataInsertToTransMSTandDTL(tblCommissionConversion); //Insert into audit trial audit and detail TblCommissionConversion prevModel = _CommissionConversionService.GetCommissionConversionByTransNo(tblCommissionConversion.TransNo); prevModel.Status = "default";//insert for only audit trail prevModel.CheckedUser = ""; _auditTrailService.InsertUpdatedModelToAuditTrail(tblCommissionConversion, prevModel, tblCommissionConversion.CheckedUser, 9, 4, "Commission Conversion", tblCommissionConversion.Mphone, "Approved Successfully!"); return(successOrErrorMsg); } else { tblCommissionConversion.Status = "R";// R means Reject tblCommissionConversion.CheckedDate = System.DateTime.Now; _CommissionConversionService.UpdateByStringField(tblCommissionConversion, "TransNo"); //Insert into audit trial audit and detail TblCommissionConversion prevModel = _CommissionConversionService.GetCommissionConversionByTransNo(tblCommissionConversion.TransNo); prevModel.Status = "default";//insert for only audit trail prevModel.CheckedUser = ""; _auditTrailService.InsertUpdatedModelToAuditTrail(tblCommissionConversion, prevModel, tblCommissionConversion.CheckedUser, 9, 4, "Commission Conversion", tblCommissionConversion.Mphone, "Rejected Successfully!"); return(true); } } } catch (Exception ex) { return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString())); } }
public object approveOrRejectBankDepositStatus(string roleName, string userName, string evnt, [FromBody] List <TblBdStatus> objTblBdStatusList) { try { string result = null; result = transMastService.approveOrRejectBankDepositStatus(roleName, userName, evnt, objTblBdStatusList).ToString(); foreach (var item in objTblBdStatusList) { if (item.MakeStatus) { string response = null; //if (roleName == "SOM") if (roleName == "Distribution Leader") { item.SomId = userName; if (evnt == "reject") { item.Status = "R"; response = result != "1" ? result : "Rejected Successfully!"; } else { item.Status = "M"; response = result != "1" ? result : "Pass to Maker Successfully!"; } TblBdStatus prevModel = transMastService.GetBankDepositStatusByTransNo(item.Tranno); prevModel.Status = "N"; _auditTrailService.InsertUpdatedModelToAuditTrail(item, prevModel, item.SomId, 9, 4, "Bank Deposit Status", item.Tranno, response); } //else if (roleName == "Financial Maker" || roleName == "Sales Executive") else if (roleName == "Financial Maker" || roleName == "SOM and FM") { item.MakerId = userName; if (evnt == "reject") { item.Status = "R"; response = result != "1" ? result : "Rejected Successfully!"; } else { item.Status = "C"; response = result != "1" ? result : "Pass to Checker Successfully!"; } TblBdStatus prevModel = transMastService.GetBankDepositStatusByTransNo(item.Tranno); prevModel.Status = "M"; _auditTrailService.InsertUpdatedModelToAuditTrail(item, prevModel, item.MakerId, 9, 4, "Bank Deposit Status", item.Tranno, response); } else { item.CheckId = userName; if (evnt == "reject") { item.Status = "R"; response = result != "1" ? result : "Rejected Successfully!"; } else { item.Status = "Y"; response = result != "1" ? result : "Approved Successfully!"; } TblBdStatus prevModel = transMastService.GetBankDepositStatusByTransNo(item.Tranno); prevModel.Status = "C"; _auditTrailService.InsertUpdatedModelToAuditTrail(item, prevModel, item.CheckId, 9, 4, "Bank Deposit Status", item.Tranno, response); } } } return(result); } catch (Exception ex) { return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString())); } }