Esempio n. 1
0
        public override bool Equals(Object obj)
        {
            Fraction fractionObj = obj as Fraction;

            if (fractionObj == null)
            {
                return(false);
            }
            else
            {
                return(Numer.Equals(fractionObj.Numer) && Denom.Equals(fractionObj.Denom));
            }
        }
Esempio n. 2
0
        List <PktDenom> loadSaldoAwal(KumpulanPrediksi prediksi)
        {
            List <PktDenom> ret     = new List <PktDenom>();
            String          kodePkt = KodePktCombo.SelectedItem.ToString();

            if (kodePkt.ToLower().Contains("jabo") || kodePkt.ToLower().Contains("kanwil"))
            {
                List <String> listPkt = (from x in db.Pkts
                                         where x.kanwil == kodePkt && !x.kodePkt.Contains("CCAS")
                                         select x.kodePkt).ToList();

                foreach (var temp in listPkt)
                {
                    var q = (from x in db.TransaksiAtms.AsEnumerable()
                             where x.kodePkt == temp && x.tanggal == Variables.todayDate.AddDays(-1)
                             select new PktDenom {
                        kodePkt = x.kodePkt,
                        tanggal = x.tanggal.AddDays(1),
                        d100 = (Int64)x.saldoAkhir100,
                        d50 = (Int64)x.saldoAkhir50,
                        d20 = (Int64)x.saldoAkhir20,
                    }).FirstOrDefault();
                    if (q != null)
                    {
                        ret.Add(q);
                    }
                    else
                    {
                        ret.Add(new PktDenom()
                        {
                            tanggal = Variables.todayDate, d100 = 0, d50 = 0, d20 = 0, kodePkt = temp
                        });
                    }
                }
            }
            else if (kodePkt.ToLower() == "all")
            {
                List <String> listPkt = (from x in db.Pkts
                                         where !x.kodePkt.Contains("CCAS")
                                         select x.kodePkt).ToList();

                foreach (var temp in listPkt)
                {
                    var q = (from x in db.TransaksiAtms.AsEnumerable()
                             where x.kodePkt == temp && x.tanggal == Variables.todayDate.AddDays(-1)
                             select new PktDenom
                    {
                        kodePkt = x.kodePkt,
                        tanggal = x.tanggal.AddDays(1),
                        d100 = (Int64)x.saldoAkhir100,
                        d50 = (Int64)x.saldoAkhir50,
                        d20 = (Int64)x.saldoAkhir20,
                    }).FirstOrDefault();
                    if (q != null)
                    {
                        ret.Add(q);
                    }
                    else
                    {
                        ret.Add(new PktDenom()
                        {
                            tanggal = Variables.todayDate, d100 = 0, d50 = 0, d20 = 0, kodePkt = temp
                        });
                    }
                }
            }
            else
            {
                Denom saldoAwal = prediksi.loadSaldoAwal(kodePkt);
                var   q         = (from x in db.TransaksiAtms.AsEnumerable()
                                   where x.kodePkt == kodePkt && x.tanggal == Variables.todayDate.AddDays(-1)
                                   select new PktDenom
                {
                    kodePkt = x.kodePkt,
                    tanggal = x.tanggal.AddDays(1),
                    d100 = (Int64)x.saldoAkhir100,
                    d50 = (Int64)x.saldoAkhir50,
                    d20 = (Int64)x.saldoAkhir20,
                }).FirstOrDefault();
                if (q != null)
                {
                    ret.Add(q);
                }
                else
                {
                    ret.Add(new PktDenom()
                    {
                        tanggal = Variables.todayDate, d100 = 0, d50 = 0, d20 = 0, kodePkt = kodePkt
                    });
                }
            }
            return(ret);
        }