Example #1
0
        private void kapatToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Validate();

            var view = afblGridView;

            if (!view.IsDataRow(view.FocusedRowHandle))
            {
                return;
            }

            if (view.GetFocusedRowCellValue(colDRMb).ToString() != "A")
            {
                return;
            }

            string tur = view.GetFocusedRowCellValue(colTURb).ToString();

            if (tur == "BS" || tur == "BA")
            {
                if (!Program.MF.EntryCheck("Account.FaturaKapaXF.Satis.Ops", false))
                {
                    return;
                }
            }
            if (tur == "AS" || tur == "AA")
            {
                if (!Program.MF.EntryCheck("Account.FaturaKapaXF.Alis.Ops", false))
                {
                    return;
                }
            }

            int AFBid = (int)view.GetFocusedRowCellValue(colAFBIDb);

            kaydetToolStripMenuItem.PerformClick();
            FaturaKapaXF frm = new FaturaKapaXF(AFBid, tur);

            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Read();
            }
        }
Example #2
0
        private void kapatToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var view = afbGridView;

            if (view.FocusedRowHandle == DevExpress.XtraGrid.GridControl.NewItemRowHandle || !view.IsDataRow(view.FocusedRowHandle))
            {
                return;
            }

            if (view.GetFocusedRowCellValue(colDRM).ToString() != "A")
            {
                return;
            }

            string tur        = view.GetFocusedRowCellValue(colTUR).ToString();
            string tur3       = view.GetFocusedRowCellValue(colTUR3).ToString();
            string entryCheck = "";

            if (tur == "BS" || tur == "BA")
            {
                if (tur3 == "O")
                {
                    entryCheck = "Account.FaturaKapaXF.Satis.Ops";
                }
                else
                {
                    entryCheck = "Account.FaturaKapaXF.Satis.Genel";
                }
            }
            else if (tur == "AS" || tur == "AA")
            {
                if (tur3 == "O")
                {
                    entryCheck = "Account.FaturaKapaXF.Alis.Ops";
                }
                else
                {
                    entryCheck = "Account.FaturaKapaXF.Alis.Genel";
                }
            }
            else if (tur == "AD" || tur == "BD")
            {
                if (tur3 == "O")
                {
                    entryCheck = "Account.FaturaKapaXF.Dekont.Ops";
                }
                else
                {
                    entryCheck = "Account.FaturaKapaXF.Dekont.Genel";
                }
            }

            if (entryCheck != "" && !Program.MF.EntryCheck(entryCheck, false))
            {
                return;
            }

            int          afbID = (int)view.GetFocusedRowCellValue(colAFBID);
            FaturaKapaXF frm   = new FaturaKapaXF(afbID, tur);

            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.afbTableAdapter.Fill(this.accountDataSet.AFB, string.Format("AFBid = {0}", afbID), Program.USR); //Refresh Clear=false
            }
            frm.Dispose();
        }
Example #3
0
        private void faturaKapaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Validate();

            var view = afbGridView;

            if (!view.IsDataRow(view.FocusedRowHandle))
            {
                return;
            }

            if (view.GetFocusedRowCellValue(colDRMb).ToString() != "A")
            {
                return;
            }

            string tur = view.GetFocusedRowCellValue(colTURb).ToString();

            if (tur == "BS" || tur == "BA")
            {
                if (!Program.MF.EntryCheck("Account.FaturaKapaXF.Satis.Ops", false))
                {
                    return;
                }
            }
            if (tur == "AS" || tur == "AA")
            {
                if (!Program.MF.EntryCheck("Account.FaturaKapaXF.Alis.Ops", false))
                {
                    return;
                }
            }

            if (this.accountDataSet.HasChanges())
            {
                XtraMessageBox.Show("Değişklik var önce kaydedin", "Fatura kapat");
                return;
            }

            int afbID = (int)view.GetFocusedRowCellValue(colAFBIDb);

            FaturaKapaXF frm = new FaturaKapaXF(afbID, tur);

            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                XtraMessageBox.Show("Fatura kapatıldı", "Fatura Kapat");
                //Refresh
                afblTableAdapter.ClearBeforeFill = false;
                afdlTableAdapter.ClearBeforeFill = false;
                afblTableAdapter.FillByAFBID(accountDataSet.AFBL, afbID, Program.USR);
                afdlTableAdapter.FillByAFBID(accountDataSet.AFDL, afbID, Program.USR);
                afblTableAdapter.ClearBeforeFill = true;
                afdlTableAdapter.ClearBeforeFill = true;

                /*
                 * //Kapandi, Remove AFDL, AFBL kayitlari
                 * DataRow[] dRows = this.accountDataSet.AFDL.Select(string.Format("AFBID = {0}", afbID));
                 * foreach (var dRow in dRows)
                 *  this.accountDataSet.AFDL.RemoveAFDLRow((AccountDataSet.AFDLRow)dRow);
                 *
                 * DataRow[] bRows = this.accountDataSet.AFBL.Select(string.Format("AFBID = {0}", afbID));
                 * this.accountDataSet.AFBL.RemoveAFBLRow((AccountDataSet.AFBLRow)bRows[0]);
                 */
            }
        }