Exemplo n.º 1
0
        public PlanFee Clone()
        {
            PlanFee planfee = new PlanFee(this.ID, this.DefendantId, this.FeeTypeId, this.UpdatedBy, this.UpdatedDate);

            planfee.RaiseChangedEvents = false;

            planfee.Amount = this.Amount;

            // cloning object collections
            planfee.Payments = (_Payments == null) ? null : _Payments.Clone();

            planfee.Save();

            planfee.RaiseChangedEvents = true;

            return(planfee);
        }
Exemplo n.º 2
0
        public static PlanFee UpdateFeeIds(PlanFee planFee, int planId, int defendantId)
        {
            PlanFee tmpfee = null;

            // getting id that uniquely identifies the object
            tmpfee = new PlanFee(planId, defendantId, planFee.FeeTypeId, planFee.UpdatedBy, planFee.UpdatedDate);

            tmpfee.RaiseChangedEvents = false;

            tmpfee.Amount = planFee.Amount;
            tmpfee.Save();

            tmpfee.MyState = planFee.MyState;

            tmpfee.RaiseChangedEvents = true;

            return(tmpfee);
        }
Exemplo n.º 3
0
        public static PlanFee CreateFee(SqlDataReader dr, int planId, int defendantId)
        {
            PlanFee tmpfee = null;

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

                tmpfee = new PlanFee(planId, defendantId, feeTypeId, updatedby, updateddate);

                tmpfee.RaiseChangedEvents = false;

                tmpfee.Amount = (!dr.IsDBNull(dr.GetOrdinal("amount"))) ? Convert.ToDouble(dr["amount"]) : 0;
                tmpfee.Save();

                tmpfee.RaiseChangedEvents = true;
            }

            return(tmpfee);
        }