예제 #1
0
        public void UpdateMandeh()
        {
            DataTable dt = SelectForEslah();

            long   sumbedehkari = 0, sumbestankari = 0, lastmandeh = 0;
            string tashkhisRow = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                lastmandeh  = 0;
                tashkhisRow = "";

                sumbedehkari  += long.Parse(dt.Rows[i]["bedehkari"].ToString());
                sumbestankari += long.Parse(dt.Rows[i]["bestankari"].ToString());

                lastmandeh = sumbestankari - sumbedehkari;

                if (lastmandeh > 0)
                {
                    tashkhisRow = "�������";
                }
                else if (lastmandeh <= 0)
                {
                    tashkhisRow = "�����";
                }

                UpdateAfterHamahangSazi(tashkhisRow, Math.Abs(lastmandeh), long.Parse(dt.Rows[i]["radif"].ToString()), dt.Rows[i]["stdno"].ToString(), i);
            }
            std sic = new std();

            sic.stdno  = this.stdno;;
            sic.hesab  = Math.Abs(lastmandeh);
            sic.status = tashkhisRow;
            sic.UpdateAfterGhabz();
        }