public static CustomerAccountReceipt DataRowToObject(DataRow dr) { CustomerAccountReceipt TheCustomerAccountReceipt = new CustomerAccountReceipt { ReceiptID = int.Parse(dr["ReceiptID"].ToString()), ReceiptSeries = dr["ReceiptSeries"].ToString(), ReceiptNumber = dr["ReceiptNumber"].ToString(), ReceiptDate = DateTime.Parse(dr["ReceiptDate"].ToString()).ToString(MicroConstants.DateFormat), CustomerAccountID = int.Parse(dr["CustomerAccountID"].ToString()), CustomerAccountCode = dr["CustomerAccountCode"].ToString(), CustomerName = dr["CustomerName"].ToString(), PolicyTypeID = int.Parse(dr["PolicyTypeID"].ToString()), InstallmentNumberFrom = int.Parse(dr["InstallmentNumberFrom"].ToString()), InstallmentNumberTo = int.Parse(dr["InstallmentNumberTo"].ToString()), InstallmentAmountPayable = decimal.Parse(dr["InstallmentAmountPayable"].ToString()), InstallmentAmountPaid = decimal.Parse(dr["InstallmentAmountPaid"].ToString()), AdmissionOrFineAmount = decimal.Parse(dr["AdmissionOrFineAmount"].ToString()), RebateAmount = decimal.Parse(dr["RebateAmount"].ToString()), PaymentMode = dr["PaymentMode"].ToString(), PaymentReference = dr["PaymentReference"].ToString(), DueDateOfNextInstallment = DateTime.Parse(dr["DueDateOfNextInstallment"].ToString()).ToString(MicroConstants.DateFormat), ScrollID = int.Parse(dr["ScrollID"].ToString()), ScrollNumber = int.Parse(dr["ScrollNumber"].ToString()), ScrollDate = DateTime.Parse(dr["ScrollDate"].ToString()).ToString(MicroConstants.DateFormat), DepositorName = dr["DepositorName"].ToString(), TellerID = int.Parse(dr["TellerID"].ToString()), TellerName = dr["TellerName"].ToString(), OfficeID = int.Parse(dr["OfficeID"].ToString()), OfficeName = dr["OfficeName"].ToString(), PrintCounter = int.Parse(dr["PrintCounter"].ToString()), IsCancelled = bool.Parse(dr["IsCancelled"].ToString()) }; return(TheCustomerAccountReceipt); }
public int CancelCustomerAccountReceipt(CustomerAccountReceipt theCustomerAccountReceipt) { int ReturnValue = 0; using (SqlCommand InsertCommand = new SqlCommand()) { InsertCommand.CommandType = CommandType.StoredProcedure; InsertCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output; InsertCommand.Parameters.Add(GetParameter("@CancelledReceiptID", SqlDbType.Int, theCustomerAccountReceipt.ReceiptID)); InsertCommand.Parameters.Add(GetParameter("@ReceiptSeries", SqlDbType.VarChar, theCustomerAccountReceipt.ReceiptSeries)); InsertCommand.Parameters.Add(GetParameter("@ReceiptDate", SqlDbType.VarChar, theCustomerAccountReceipt.ReceiptDate)); InsertCommand.Parameters.Add(GetParameter("@CustomerAccountID", SqlDbType.Int, theCustomerAccountReceipt.CustomerAccountID)); InsertCommand.Parameters.Add(GetParameter("@PolicyTypeID", SqlDbType.Int, theCustomerAccountReceipt.PolicyTypeID)); InsertCommand.Parameters.Add(GetParameter("@InstallmentNumberFrom", SqlDbType.Int, theCustomerAccountReceipt.InstallmentNumberFrom)); InsertCommand.Parameters.Add(GetParameter("@InstallmentNumberTo", SqlDbType.Int, theCustomerAccountReceipt.InstallmentNumberTo)); InsertCommand.Parameters.Add(GetParameter("@InstallmentAmountPayable", SqlDbType.Decimal, theCustomerAccountReceipt.InstallmentAmountPayable)); InsertCommand.Parameters.Add(GetParameter("@InstallmentAmountPaid", SqlDbType.Decimal, theCustomerAccountReceipt.InstallmentAmountPaid)); InsertCommand.Parameters.Add(GetParameter("@AdmissionOrFineAmount", SqlDbType.Decimal, theCustomerAccountReceipt.AdmissionOrFineAmount)); InsertCommand.Parameters.Add(GetParameter("@RebateAmount", SqlDbType.Decimal, theCustomerAccountReceipt.RebateAmount)); InsertCommand.Parameters.Add(GetParameter("@PaymentMode", SqlDbType.VarChar, theCustomerAccountReceipt.PaymentMode)); InsertCommand.Parameters.Add(GetParameter("@PaymentReference", SqlDbType.VarChar, theCustomerAccountReceipt.PaymentReference)); InsertCommand.Parameters.Add(GetParameter("@DueDateOfNextInstallment", SqlDbType.VarChar, theCustomerAccountReceipt.DueDateOfNextInstallment)); InsertCommand.Parameters.Add(GetParameter("@ScrollID", SqlDbType.Int, theCustomerAccountReceipt.ScrollID)); InsertCommand.Parameters.Add(GetParameter("@OfficeId", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.OfficeID)); InsertCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID)); InsertCommand.CommandText = "pCRM_Receipts_Cancel"; ExecuteStoredProcedure(InsertCommand); ReturnValue = int.Parse(InsertCommand.Parameters[0].Value.ToString()); return(ReturnValue); } }
public static List <CustomerAccountReceipt> GetCustomerAccountReceiptsByDCAccountID(int DCAccountID) { List <CustomerAccountReceipt> CustomerAccountReceiptList = new List <CustomerAccountReceipt>(); DataTable CustomerAccountReceiptTable = CustomerAccountReceiptDataAccess.GetInstance.GetCustomerAccountReceiptsByDCAccountID(DCAccountID); foreach (DataRow dr in CustomerAccountReceiptTable.Rows) { CustomerAccountReceipt TheCustomerAccountReceipt = DataRowToObject(dr); CustomerAccountReceiptList.Add(TheCustomerAccountReceipt); } return(CustomerAccountReceiptList); }
public static CustomerAccountReceipt GetFirstReceiptByDCAccountID(int DCAccountID) { CustomerAccountReceipt ReturnValue; List <CustomerAccountReceipt> TheCustomerAccountReceiptList = GetCustomerAccountReceiptsByDCAccountID(DCAccountID); if (TheCustomerAccountReceiptList.Count > 0) { ReturnValue = (TheCustomerAccountReceiptList.OrderBy(Receipt => Receipt.ReceiptDate)).First(); } else { ReturnValue = new CustomerAccountReceipt(); } return(ReturnValue); }
public int UpdatePolicyTypeChange(CustomerAccount theCustomerAccount, CustomerAccountReceipt theCustomerAccountReceipt) { int ReturnValue = 0; using (SqlCommand UpdateCommand = new SqlCommand()) { UpdateCommand.CommandType = CommandType.StoredProcedure; UpdateCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output; UpdateCommand.Parameters.Add(GetParameter("@CustomerAccountID", SqlDbType.Int, theCustomerAccount.CustomerAccountID)); UpdateCommand.Parameters.Add(GetParameter("@PolicyTypeID", SqlDbType.Int, theCustomerAccount.PolicyTypeID)); UpdateCommand.Parameters.Add(GetParameter("@InstallmentMode", SqlDbType.VarChar, theCustomerAccount.InstallmentMode)); UpdateCommand.Parameters.Add(GetParameter("@TermInMonths", SqlDbType.Int, theCustomerAccount.TermInMonths)); UpdateCommand.Parameters.Add(GetParameter("@InstallmentAmount", SqlDbType.Decimal, theCustomerAccount.InstallmentAmount)); UpdateCommand.Parameters.Add(GetParameter("@NumberOfInstallmentsToBePaid", SqlDbType.Int, theCustomerAccount.NumberOfInstallmentsToBePaid)); //UpdateCommand.Parameters.Add(GetParameter("@NumberOfInstallmentsPaid", SqlDbType.Int, theCustomerAccount.NumberOfInstallmentsPaid)); UpdateCommand.Parameters.Add(GetParameter("@DueDateOfLastPayment", SqlDbType.VarChar, theCustomerAccount.DueDateOfLastPayment)); UpdateCommand.Parameters.Add(GetParameter("@DueDateOfMaturity", SqlDbType.VarChar, theCustomerAccount.DueDateOfMaturity)); UpdateCommand.Parameters.Add(GetParameter("@PayToCompany", SqlDbType.Decimal, theCustomerAccount.PayToCompany)); UpdateCommand.Parameters.Add(GetParameter("@GuaranteedDividend", SqlDbType.Decimal, theCustomerAccount.GuaranteedDividend)); UpdateCommand.Parameters.Add(GetParameter("@BonusAmount", SqlDbType.Decimal, theCustomerAccount.BonusAmount)); UpdateCommand.Parameters.Add(GetParameter("@PayByCompany", SqlDbType.Decimal, theCustomerAccount.PayByCompany)); UpdateCommand.Parameters.Add(GetParameter("@MoneyBackPayable", SqlDbType.Decimal, theCustomerAccount.MoneybackPayable)); //Cancelled/Insert Receipt and Manage Scroll UpdateCommand.Parameters.Add(GetParameter("@CancelledReceiptID", SqlDbType.Int, theCustomerAccountReceipt.ReceiptID)); UpdateCommand.Parameters.Add(GetParameter("@ReceiptSeries", SqlDbType.VarChar, theCustomerAccountReceipt.ReceiptSeries)); UpdateCommand.Parameters.Add(GetParameter("@ReceiptDate", SqlDbType.VarChar, theCustomerAccountReceipt.ReceiptDate)); UpdateCommand.Parameters.Add(GetParameter("@InstallmentNumberFrom", SqlDbType.Int, theCustomerAccountReceipt.InstallmentNumberFrom)); UpdateCommand.Parameters.Add(GetParameter("@InstallmentNumberTo", SqlDbType.Int, theCustomerAccountReceipt.InstallmentNumberTo)); UpdateCommand.Parameters.Add(GetParameter("@InstallmentAmountPayable", SqlDbType.Decimal, theCustomerAccountReceipt.InstallmentAmountPayable)); UpdateCommand.Parameters.Add(GetParameter("@InstallmentAmountPaid", SqlDbType.Decimal, theCustomerAccountReceipt.InstallmentAmountPaid)); UpdateCommand.Parameters.Add(GetParameter("@AdmissionOrFineAmount", SqlDbType.Decimal, theCustomerAccountReceipt.AdmissionOrFineAmount)); UpdateCommand.Parameters.Add(GetParameter("@RebateAmount", SqlDbType.Decimal, theCustomerAccountReceipt.RebateAmount)); UpdateCommand.Parameters.Add(GetParameter("@PaymentMode", SqlDbType.VarChar, theCustomerAccountReceipt.PaymentMode)); UpdateCommand.Parameters.Add(GetParameter("@PaymentReference", SqlDbType.VarChar, theCustomerAccountReceipt.PaymentReference)); UpdateCommand.Parameters.Add(GetParameter("@DueDateOfNextInstallment", SqlDbType.VarChar, theCustomerAccountReceipt.DueDateOfNextInstallment)); UpdateCommand.Parameters.Add(GetParameter("@ScrollID", SqlDbType.Int, theCustomerAccountReceipt.ScrollID)); UpdateCommand.Parameters.Add(GetParameter("@OfficeID", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.OfficeID)); UpdateCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID)); UpdateCommand.CommandText = "pCRM_CustomerAccounts_UpdatePolicyType"; ExecuteStoredProcedure(UpdateCommand); ReturnValue = int.Parse(UpdateCommand.Parameters[0].Value.ToString()); return(ReturnValue); } }
public static int UpdatePolicyTypeChange(CustomerAccount theCustomerAccount, CustomerAccountReceipt theCustomerAccountReceipt) { return(ChangePolicyTypeDataAccess.GetInstance.UpdatePolicyTypeChange(theCustomerAccount, theCustomerAccountReceipt)); }
public int InsertCustomerAccount(CustomerAccount theCustomerAccount, CustomerAccountReceipt theCustomerAccountReceipt) { return(CustomerAccountIntegration.InsertCustomerAccount(theCustomerAccount, theCustomerAccountReceipt)); }
public int InsertCustomerAccount(CustomerAccount theCustomerAccount, CustomerAccountReceipt theCustomerAccountReceipt) { int ReturnValue = 0; using (SqlCommand InsertCommand = new SqlCommand()) { InsertCommand.CommandType = CommandType.StoredProcedure; InsertCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output; InsertCommand.Parameters.Add(GetParameter("@CustomerID", SqlDbType.Int, theCustomerAccount.CustomerID)); InsertCommand.Parameters.Add(GetParameter("@IsJointApplication", SqlDbType.Bit, theCustomerAccount.IsJointApplication)); InsertCommand.Parameters.Add(GetParameter("@ApplicationFormNumber", SqlDbType.VarChar, theCustomerAccount.ApplicationFormNumber)); InsertCommand.Parameters.Add(GetParameter("@ApplicationDate", SqlDbType.VarChar, theCustomerAccount.ApplicationDate)); InsertCommand.Parameters.Add(GetParameter("@SecondApplicantName", SqlDbType.VarChar, theCustomerAccount.SecondApplicantName)); InsertCommand.Parameters.Add(GetParameter("@SecondApplicantAge", SqlDbType.Int, theCustomerAccount.SecondApplicantAge)); InsertCommand.Parameters.Add(GetParameter("@SecondApplicantSignature", SqlDbType.VarBinary, theCustomerAccount.SecondApplicantSignature)); InsertCommand.Parameters.Add(GetParameter("@SecondApplicantPANGIR", SqlDbType.VarChar, theCustomerAccount.SecondApplicantPANGIR)); InsertCommand.Parameters.Add(GetParameter("@ThirdApplicantName", SqlDbType.VarChar, theCustomerAccount.ThirdApplicantName)); InsertCommand.Parameters.Add(GetParameter("@ThirdApplicantAge", SqlDbType.Int, theCustomerAccount.ThirdApplicantAge)); InsertCommand.Parameters.Add(GetParameter("@ThirdApplicantSignature", SqlDbType.VarBinary, theCustomerAccount.ThirdApplicantSignature)); InsertCommand.Parameters.Add(GetParameter("@ThirdApplicantPANGIR", SqlDbType.VarChar, theCustomerAccount.ThirdApplicantPANGIR)); InsertCommand.Parameters.Add(GetParameter("@NomineeName", SqlDbType.VarChar, theCustomerAccount.NomineeName)); InsertCommand.Parameters.Add(GetParameter("@Nominee_Permanent_TownOrCity", SqlDbType.VarChar, theCustomerAccount.Nominee_Permanent_TownOrCity)); InsertCommand.Parameters.Add(GetParameter("@Nominee_Permanent_Landmark", SqlDbType.VarChar, theCustomerAccount.Nominee_Permanent_Landmark)); InsertCommand.Parameters.Add(GetParameter("@Nominee_Permanent_PinCode", SqlDbType.VarChar, theCustomerAccount.Nominee_Permanent_PinCode)); InsertCommand.Parameters.Add(GetParameter("@Nominee_Permanent_DistrictID", SqlDbType.Int, theCustomerAccount.Nominee_Permanent_DistrictID)); InsertCommand.Parameters.Add(GetParameter("@NomineeRelationship", SqlDbType.VarChar, theCustomerAccount.NomineeRelationship)); InsertCommand.Parameters.Add(GetParameter("@NomineeAge", SqlDbType.Int, theCustomerAccount.NomineeAge)); InsertCommand.Parameters.Add(GetParameter("@PolicyTypeID", SqlDbType.Int, theCustomerAccount.PolicyTypeID)); InsertCommand.Parameters.Add(GetParameter("@InstallmentMode", SqlDbType.VarChar, theCustomerAccount.InstallmentMode)); InsertCommand.Parameters.Add(GetParameter("@TermInMonths", SqlDbType.Int, theCustomerAccount.TermInMonths)); InsertCommand.Parameters.Add(GetParameter("@InstallmentAmount", SqlDbType.Decimal, theCustomerAccount.InstallmentAmount)); InsertCommand.Parameters.Add(GetParameter("@FieldForceID", SqlDbType.Int, theCustomerAccount.FieldForceID)); InsertCommand.Parameters.Add(GetParameter("@FieldForceCode", SqlDbType.VarChar, theCustomerAccount.FieldForceCode)); InsertCommand.Parameters.Add(GetParameter("@InstallmentAmountPayable", SqlDbType.Decimal, theCustomerAccountReceipt.InstallmentAmountPayable)); InsertCommand.Parameters.Add(GetParameter("@AdmissionOrFineAmount", SqlDbType.Decimal, theCustomerAccountReceipt.AdmissionOrFineAmount)); InsertCommand.Parameters.Add(GetParameter("@RebateAmount", SqlDbType.Decimal, theCustomerAccountReceipt.RebateAmount)); InsertCommand.Parameters.Add(GetParameter("@PaymentMode", SqlDbType.VarChar, theCustomerAccountReceipt.PaymentMode)); InsertCommand.Parameters.Add(GetParameter("@PaymentReference", SqlDbType.VarChar, theCustomerAccountReceipt.PaymentReference)); InsertCommand.Parameters.Add(GetParameter("@ScrollID", SqlDbType.Int, theCustomerAccountReceipt.ScrollID)); InsertCommand.Parameters.Add(GetParameter("@NumberOfInstallmentsToBePaid", SqlDbType.Int, theCustomerAccount.NumberOfInstallmentsToBePaid)); InsertCommand.Parameters.Add(GetParameter("@DueDateOfLastPayment", SqlDbType.VarChar, theCustomerAccount.DueDateOfLastPayment)); InsertCommand.Parameters.Add(GetParameter("@DueDateOfMaturity", SqlDbType.VarChar, theCustomerAccount.DueDateOfMaturity)); InsertCommand.Parameters.Add(GetParameter("@PayToCompany", SqlDbType.Decimal, theCustomerAccount.PayToCompany)); InsertCommand.Parameters.Add(GetParameter("@GuaranteedDividend", SqlDbType.Decimal, theCustomerAccount.GuaranteedDividend)); InsertCommand.Parameters.Add(GetParameter("@BonusAmount", SqlDbType.Decimal, theCustomerAccount.BonusAmount)); InsertCommand.Parameters.Add(GetParameter("@PayByCompany", SqlDbType.Decimal, theCustomerAccount.PayByCompany)); InsertCommand.Parameters.Add(GetParameter("@MoneyBackPayable", SqlDbType.Decimal, theCustomerAccount.MoneybackPayable)); InsertCommand.Parameters.Add(GetParameter("@DCAccountID", SqlDbType.Int, theCustomerAccount.DCAccountID)); InsertCommand.Parameters.Add(GetParameter("@InstallmentAmountPaid", SqlDbType.Decimal, theCustomerAccountReceipt.InstallmentAmountPaid)); InsertCommand.Parameters.Add(GetParameter("@DueDateOfNextInstallment", SqlDbType.VarChar, theCustomerAccountReceipt.DueDateOfNextInstallment)); InsertCommand.Parameters.Add(GetParameter("@OfficeID", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.OfficeID)); InsertCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID)); InsertCommand.CommandText = "pCRM_CustomerAccounts_Insert"; ExecuteStoredProcedure(InsertCommand); ReturnValue = int.Parse(InsertCommand.Parameters[0].Value.ToString()); return(ReturnValue); } }
public static int InsertCustomerAccountReceipt(CustomerAccountReceipt theCustomerAccountReceipt) { return(CustomerAccountReceiptDataAccess.GetInstance.InsertCustomerAccountReceipt(theCustomerAccountReceipt)); }
public int UpdatePolicyTypeChange(CustomerAccount theCustomerAccount, CustomerAccountReceipt theCustomerAccountReceipt) { return(ChangePolicyTypeIntegration.UpdatePolicyTypeChange(theCustomerAccount, theCustomerAccountReceipt)); }
public int CancelCustomerAccountReceipt(CustomerAccountReceipt theCustomerAccountReceipt) { return(CustomerAccountReceiptIntegration.CancelCustomerAccountReceipt(theCustomerAccountReceipt)); }