示例#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();
        }
示例#2
0
        private void yeniFaturaYaratVeEkleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if ((int)chargeGridView.GetFocusedRowCellValue("AFDID") < 0)
            {
                return;
            }

            AccountDataSet.AFBLRow afblRow = accountDataSet.AFBL.NewAFBLRow();

            afblRow.EDITABLE = "T";
            afblRow.AFBID    = (int)accountQueriesTableAdapter.GET_PK("ACC");
            afblRow.FRTID    = (int)chargeGridView.GetFocusedRowCellValue("FRTID");
            afblRow.TUR      = (string)chargeGridView.GetFocusedRowCellValue("TUR");
            afblRow.TUR3     = "O"; // Ops  Tur2: Firmasindan alinacak, aslinda onemi yok, icindeki kdv belirliyor hesabi
            afblRow.DRM      = "A"; //Acik
            afblRow.FTRTRH   = DateTime.Today;
            afblRow.BDVZ     = (string)chargeGridView.GetFocusedRowCellValue("DDVZ");
            afblRow.BKUR     = 0; // (float)chargeGridView.GetFocusedRowCellValue("DKUR");

            if (chargeGridView.GetFocusedRowCellValue("DKNFRTID") != DBNull.Value)
            {
                afblRow["DKNFRTID"] = chargeGridView.GetFocusedRowCellValue("DKNFRTID");
                afblRow["DKNDVZ"]   = "TRL";
            }
            accountDataSet.AFBL.AddAFBLRow(afblRow);

            chargeGridView.SetFocusedRowCellValue("AFBID", afblRow.AFBID);
            chargeGridView.UpdateCurrentRow();
        }
示例#3
0
 void AFDL_RowChanging(object sender, DataRowChangeEventArgs e)
 {
     if (!loading)
     {
         var aa = e.Action;
         var bb = e.Row.RowState;
         var cc = e.Row["AFBID"];
         //e.Row.HasVersion(DataRowVersion.
         int afbID = (int)e.Row["AFBID", DataRowVersion.Original];
         AccountDataSet.AFBLRow afbRow = this.accountDataSet.AFBL.FindByAFBID(afbID);
         if (afbRow.RowState == DataRowState.Unchanged)
         {
             afbRow.SetModified();
         }
     }
 }
示例#4
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;
                    }
                }
            }
        }
示例#5
0
        private void yeniFaturaBasligiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AccountDataSet.AFBLRow afblRow = accountDataSet.AFBL.NewAFBLRow();

            afblRow.AFBID  = (int)accountQueriesTableAdapter.GET_PK("ACC");
            afblRow.FRTID  = (int)afdlGridView.GetFocusedRowCellValue(colFRTIDd);
            afblRow.TUR    = (string)afdlGridView.GetFocusedRowCellValue(colTURd);
            afblRow.TUR3   = "O"; // Ops  Tur2: Firmasindan alinacak, aslinda onemi yok, icindeki kdv belirliyor hesabi
            afblRow.DRM    = "A"; //Acik
            afblRow.FTRTRH = DateTime.Today;
            afblRow.BDVZ   = (string)afdlGridView.GetFocusedRowCellValue(colDDVZd);
            afblRow.BKUR   = (float)afdlGridView.GetFocusedRowCellValue(colDKURd);


            accountDataSet.AFBL.AddAFBLRow(afblRow);

            afdlGridView.SetFocusedRowCellValue(colAFBIDd, afblRow.AFBID);
            afdlGridView.UpdateCurrentRow();
        }