Example #1
0
        private void afblGridControl_DragDrop(object sender, DragEventArgs e)
        {
            GridControl grid = (GridControl)sender;
            Point       pt   = new Point(e.X, e.Y);

            pt = grid.PointToClient(pt);
            GridView view = grid.GetViewAt(pt) as GridView;

            AccountDataSet.AFDLRow srcRow     = e.Data.GetData(typeof(AccountDataSet.AFDLRow)) as AccountDataSet.AFDLRow;
            GridHitInfo            trgHitInfo = view.CalcHitInfo(grid.PointToClient(new Point(e.X, e.Y)));
            int AFBid = (int)view.GetRowCellValue(trgHitInfo.RowHandle, colAFBIDb);


            object trh, kur;

            srcRow.AFBID = AFBid;
            if ((int)AFBid == 0)
            {
                srcRow.BKUR = -1;
                trh         = DateTime.Today;
            }
            else
            {
                AccountDataSet.AFBLRow pRow = srcRow.GetParentRow("AFBL_AFDL") as AccountDataSet.AFBLRow;
                srcRow.BKUR = pRow.BKUR;   //srcRow.GetParentRow("AFBL_AFDL")["KUR"];

                trh = pRow.IsFTRTRHNull() ? DateTime.Today : pRow.FTRTRH;
            }
            kur = accountQueriesTableAdapter.AFB_KUR(srcRow.DDVZ, (DateTime)trh);
            view.SetRowCellValue(trgHitInfo.RowHandle, colDKURd, kur);

            view.RefreshData();
        }
Example #2
0
        private void duplicateRecordToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!afdlGridView.IsDataRow(afdlGridView.FocusedRowHandle))
            {
                return;
            }

            if (afblGridView.GetFocusedRowCellValue(colEDITABLE).ToString() != "T")
            {
                return;
            }

            /*
             * // Baslik Aciksa (0 herzaman acik)
             * if (afblGridView.GetFocusedRowCellValue(colDRMb).ToString() != "A")
             *  return;
             *
             * // Basligin Yetkisine bak
             * //if (!isIslYetkili())
             * //    return;
             *
             * // Ops'un AccYetkisine bak
             * if (!isAccYetkili())
             *  return;
             */
            AccountDataSet.AFDLRow sRow = (AccountDataSet.AFDLRow)afdlGridView.GetDataRow(afdlGridView.FocusedRowHandle);
            AccountDataSet.AFDLRow dRow = accountDataSet.AFDL.NewAFDLRow();

            /*
             * dRow.AFBID = sRow.AFBID;
             * dRow.AFDID = (int)accountQueriesTableAdapter.GET_PK("ACC"); ;
             * dRow.TUR = sRow.TUR;
             * dRow.FRTID = sRow.FRTID;
             * dRow.OPHM = sRow.OPHM;
             * dRow.OPID = sRow.OPID;
             * dRow.MIK = 1m;
             * dRow.DDVZ = sRow.DDVZ;
             * dRow.DKUR = sRow.DKUR;
             */
            //for (int i = 0; i < dRow.ItemArray.Length; i++)
            //    dRow.ItemArray[i] = sRow.ItemArray[i];
            dRow.ItemArray = sRow.ItemArray;
            dRow.AFDID     = (int)accountQueriesTableAdapter.GET_PK("ACC");;

            afdlGridView.BeginDataUpdate();
            accountDataSet.AFDL.AddAFDLRow(dRow);
            afdlGridView.EndDataUpdate();
        }
Example #3
0
        void DVTrepositoryItemLookUpEdit_Closed(object sender, DevExpress.XtraEditors.Controls.ClosedEventArgs e)
        {
            var a = sender as LookUpEdit;

            if (a.OldEditValue != a.EditValue)
            {
                object trh, kur;

                if (afdlGridControl.IsFocused)
                {
                    if ((int)afdlGridView.GetFocusedRowCellValue(colAFBIDd) == 0)
                    {
                        trh = DateTime.Today;
                    }
                    else
                    {
                        AccountDataSet.AFDLRow dRow = afdlGridView.GetDataRow(afdlGridView.FocusedRowHandle) as AccountDataSet.AFDLRow;
                        AccountDataSet.AFBLRow pRow = dRow.GetParentRow("AFBL_AFDL") as AccountDataSet.AFBLRow;
                        //AccountDataSet.AFBLRow pRow = afdlGridView.GetDataRow(afblGridView.FocusedRowHandle).GetParentRow("AFBL_AFDL") as AccountDataSet.AFBLRow;
                        trh = pRow.IsFTRTRHNull() ? DateTime.Today : pRow.FTRTRH;
                    }
                    kur = accountQueriesTableAdapter.AFB_KUR(a.EditValue.ToString(), (DateTime)trh);
                    afdlGridView.SetFocusedRowCellValue(colDKURd, kur);
                }
                if (afblGridControl.IsFocused)
                {
                    if ((int)afblGridView.GetFocusedRowCellValue(colAFBIDd) == 0)
                    {
                        trh = DateTime.Today;
                    }
                    else
                    {
                        trh = afblGridView.GetFocusedRowCellValue(colFTRTRHb) == DBNull.Value ? DateTime.Today : afblGridView.GetFocusedRowCellValue(colFTRTRHb);
                    }

                    kur = accountQueriesTableAdapter.AFB_KUR(a.EditValue.ToString(), (DateTime)trh);
                    afblGridView.SetFocusedRowCellValue(colBKURb, kur);

                    AccountDataSet.AFDLRow[] cRows = afblGridView.GetDataRow(afblGridView.FocusedRowHandle).GetChildRows("AFBL_AFDL") as AccountDataSet.AFDLRow[];
                    for (int i = 0; i < cRows.Length; i++)
                    {
                        cRows[i].BKUR = (Single)kur;
                    }
                }
            }
        }
Example #4
0
        private void duplicateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!chargeGridView.IsDataRow(chargeGridView.FocusedRowHandle))
            {
                return;
            }

            if (chargeGridView.GetFocusedRowCellValue("EDITABLE").ToString() != "T")
            {
                return;
            }

            AccountDataSet.AFDLRow sRow = (AccountDataSet.AFDLRow)chargeGridView.GetDataRow(chargeGridView.FocusedRowHandle);
            AccountDataSet.AFDLRow dRow = accountDataSet.AFDL.NewAFDLRow();

            dRow.ItemArray   = sRow.ItemArray;
            dRow.AFDID       = (int)accountQueriesTableAdapter.GET_PK("ACC");;
            dRow["INSTYP"]   = DBNull.Value;
            dRow["EDITABLE"] = "T";

            //chargeGridView.BeginDataUpdate();
            accountDataSet.AFDL.AddAFDLRow(dRow);
            //chargeGridView.EndDataUpdate();
        }