示例#1
0
        public void HesapKapama(Hesap h)
        {
            decimal hesaptakiPara = h.hesaptakiPara;
            byte    index         = HesapIndexBul(h);

            if (hesapSayisi > 1)
            {
                hesapList[index].ParaCek(hesaptakiPara);
                foreach (Hesap k in hesapList)
                {
                    if (k != h)
                    {
                        k.ParaEkle(hesaptakiPara);
                        break;
                    }
                }
                for (int i = index + 1; i < hesapSayisi; i++)
                {
                    hesapList[i - 1] = hesapList[i];
                }
                hesapList.RemoveAt(hesapList.Count - 1);//sondakini siler
                maxHesapSayisi++;
            }
            else//1tane hesabı var
            {
                hesapList[0].ParaCek(hesapList[0].hesaptakiPara);
                hesapList.Clear();
                hesapSayisi--;
            }
        }
示例#2
0
 public void HesapAc()
 {
     if (hesapList == null)
     {
         hesapList = new List <Hesap>();
     }
     if (hesapSayisi < maxHesapSayisi)
     {
         hesapSayisi++;
         hesap = new Hesap(müsteriNo * 100 + (hesapSayisi));
         hesapList.Add(hesap);
     }
 }
示例#3
0
        public byte HesapIndexBul(Hesap h)
        {
            byte index = 0;

            foreach (Hesap k in hesapList)
            {
                if (h.hesapNo == k.hesapNo)
                {
                    break;
                }
                index++;
            }
            return(index);
        }
示例#4
0
        private byte MüsteriIndexBul(Hesap h)
        {
            byte index = 0;
            int  müsteriNo;

            müsteriNo = (h.hesapNo - h.hesapNo % 100) / 100;
            foreach (Müsteri m in müsteriList)
            {
                if (m.müsteriNo == müsteriNo)
                {
                    break;
                }
                index++;
            }
            return(index);
        }
示例#5
0
        public void Havale(Hesap ana, Hesap hedef, decimal m)
        {
            int anaIndex   = MüsteriIndexBul(ana);
            int hedefIndex = MüsteriIndexBul(hedef);

            if ((float)müsteriList[anaIndex].MüsteriToplamParası() >
                (float)m + (float)m * müsteriList[anaIndex].HAVALEKATSAYISI)
            {
                müsteriList[anaIndex].hesapList[müsteriList[anaIndex].HesapIndexBul(ana)].
                ParaCek(m + Convert.ToDecimal((float)m *
                                              (float)müsteriList[anaIndex].HAVALEKATSAYISI));

                müsteriList[hedefIndex].hesapList[müsteriList[hedefIndex].HesapIndexBul(hedef)].
                ParaEkle(m);
            }
        }
示例#6
0
        public void HesaptanParaCekme(Hesap h, decimal m)
        {
            byte index = HesapIndexBul(h);

            if (ilkCekildigiTarih != DateTime.Now.Date)
            {
                kalanLimit        = GUNLUKLIMIT;
                ilkCekildigiTarih = DateTime.Now.Date;
            }

            if (hesapList[index].hesaptakiPara - m > 0 && kalanLimit >= m)
            {
                kalanLimit -= m;
                hesapList[index].ParaCek(m);
                cekilenPara += m;
            }

            else if (MüsteriToplamParası() - m > 0 && kalanLimit >= m)
            {
                kalanLimit -= m;
                decimal cekilecekPara = m;
                cekilecekPara -= hesapList[index].hesaptakiPara;
                hesapList[index].ParaCek(hesapList[index].hesaptakiPara);
                foreach (Hesap k in hesapList)
                {
                    if (k.hesaptakiPara - cekilecekPara > 0)
                    {
                        k.ParaCek(cekilecekPara);
                        break;
                    }
                    else
                    {
                        cekilecekPara -= k.hesaptakiPara;
                        k.ParaCek(k.hesaptakiPara);
                    }
                }
                cekilenPara += m;
            }
        }