Пример #1
0
        public bool UpdateClientWithPaymentDetails(string accNr, string bank, string branchCode)
        {
            Datahandler dh = Datahandler.getData();

            PD = new PaymentDetails(this, accNr, bank, branchCode);
            Dictionary <string, string[]> client_details = new Dictionary <string, string[]>();

            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_identifier, new string[] { DataAccesHelper.typeString, this.ClientIdentifier });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_id, new string[] { DataAccesHelper.typeString, this.PersonId });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_name, new string[] { DataAccesHelper.typeString, this.Name });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_surname, new string[] { DataAccesHelper.typeString, this.Surname });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_payMethod, new string[] { DataAccesHelper.typeString, this.PaymentMethod });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_status, new string[] { DataAccesHelper.typeString, this.Status });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_addrLine1, new string[] { DataAccesHelper.typeString, this.PersonAddress.AddressLine1 });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_addrLine2, new string[] { DataAccesHelper.typeString, this.PersonAddress.AddressLine2 });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_city, new string[] { DataAccesHelper.typeString, this.PersonAddress.City });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_postCode, new string[] { DataAccesHelper.typeString, this.PersonAddress.PostalCode });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_cell, new string[] { DataAccesHelper.typeString, this.PersonContact.Cell });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_email, new string[] { DataAccesHelper.typeString, this.PersonContact.Email });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_accNr, new string[] { DataAccesHelper.typeString, this.PD.AccNr });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_bank, new string[] { DataAccesHelper.typeString, this.PD.Bank });
            client_details.Add(QueryBuilder.spUpdateClientWithPaymentDetails.sp_branch, new string[] { DataAccesHelper.typeString, this.PD.BranchCode });

            return(dh.runStoredProcedure(QueryBuilder.spUpdateClientWithPaymentDetails.sp, client_details));
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            PaymentDetails pd = obj as PaymentDetails;

            if ((object)pd == null)
            {
                return(false);
            }
            return((this.PaymentDet_Client == pd.PaymentDet_Client) && (this.AccNr == pd.AccNr) && (this.Bank == pd.Bank) && (this.BranchCode == pd.BranchCode));
        }
Пример #3
0
        public List <PaymentDetails> GetAllPaymentDetails()
        {
            Datahandler           dh      = Datahandler.getData();
            List <PaymentDetails> details = new List <PaymentDetails>();
            DataTable             table   = dh.readDataFromDB(DataAccesHelper.QueryGetPaymentDetails);

            foreach (DataRow item in table.Rows)
            {
                PaymentDetails pd = new PaymentDetails();
                pd.AccNr             = item[DataAccesHelper.paymentDetAccNr].ToString();
                pd.Bank              = item[DataAccesHelper.paymentDetBank].ToString();
                pd.BranchCode        = item[DataAccesHelper.paymentDetBranch].ToString();
                pd.PaymentDet_Client = new Client();
                pd.PaymentDet_Client.ClientIdentifier = item[DataAccesHelper.paymentDetClientId].ToString();
                details.Add(pd);
            }
            return(details);
        }