コード例 #1
0
ファイル: MonthlyChargeModel.cs プロジェクト: omarkhd/gymk
 public bool UpdatePaymentOf(Member m, DateTime sd, Payment p)
 {
     string sql = "update " + this.TableName;
     sql += " set Payment = @p0";
     sql += " where Member = @p1 and StartDate = @p2";
     return (long) this.DoNonQuery(sql, p.Id, m.Id, sd.ToString("yyyy-MM-dd")) > 0;
 }
コード例 #2
0
ファイル: PaymentRuler.cs プロジェクト: omarkhd/gymk
        public static void ChargeFirstMonth(Member m)
        {
            m.Sync();
            int month = DateTime.Now.Month;
            int year = DateTime.Now.Year;
            DateTime s = PaymentRuler.ComputeStartDate(m, month, year);
            DateTime e = PaymentRuler.ComputeEndDate(m, month, year);

            MonthlyChargeModel mcm = new MonthlyChargeModel();
            mcm.Insert(m, s, e);

            if(!m.ChargeFirstMonth)
            {
                Payment p = new Payment();
                p.Amount = 0;
                p.Discount = 0;
                PaymentModel pm = new PaymentModel();
                pm.Insert(p);
                p.Id = pm.LastInsertId;
                mcm.UpdatePaymentOf(m, s, p);
            }
        }
コード例 #3
0
ファイル: PaymentModel.cs プロジェクト: omarkhd/gymk
 public bool Insert(Payment p)
 {
     return this.Insert(p.Amount, p.Discount);
 }