Esempio n. 1
0
        public static FeePayment CreateFeePayment(SqlDataReader dr, int planId, int defendantId, int feeTypeId)
        {
            FeePayment payment = null;

            if (!dr.IsClosed && dr.HasRows)
            {
                // getting id that uniquely identifies the object
                DateTime receivedDate = (DateTime)dr["receiveddate"];
                string   updatedby    = dr["updatedby"].ToString();
                DateTime?updateddate  = (DateTime)dr["updateddate"];

                payment = new FeePayment(planId, defendantId, feeTypeId, receivedDate, updatedby, updateddate);

                payment.RaiseChangedEvents = false;

                if (!dr.IsDBNull(dr.GetOrdinal("amount")))
                {
                    payment.Amount = Convert.ToDouble(dr["amount"]);
                }
                payment.Save();

                payment.RaiseChangedEvents = true;
            }

            return(payment);
        }
Esempio n. 2
0
        public FeePayment Clone()
        {
            FeePayment feepayment = new FeePayment(this.PlanId, this.ID, this.FeeTypeId, this.ReceivedDate, this.UpdatedBy, this.UpdatedDate);

            feepayment.RaiseChangedEvents = false;

            feepayment.Amount = this.Amount;
            feepayment.Save();

            feepayment.RaiseChangedEvents = true;

            return(feepayment);
        }
Esempio n. 3
0
        public static FeePayment UpdateFeePaymentIds(FeePayment feePayment, int planId, int defendantId, int feeTypeId)
        {
            FeePayment payment = null;

            // getting id that uniquely identifies the object
            payment = new FeePayment(planId, defendantId, feeTypeId, feePayment.ReceivedDate, feePayment.UpdatedBy, feePayment.UpdatedDate);

            payment.RaiseChangedEvents = false;

            payment.Amount = feePayment.Amount;
            payment.Save();

            payment.MyState = feePayment.MyState;

            payment.RaiseChangedEvents = true;

            return(payment);
        }