1

Konu: Forma SET DELE ON komutu

Forma SET DELE ON komutu

Çalışmadı.

Gride te silinmiş kayıt gözükmeye devam ediyor.

Sorun ne olabilir ?

Teşekkürler

2

Re: Forma SET DELE ON komutu

go recno()

3

Re: Forma SET DELE ON komutu

Aşagıdaki programda program çalıştığında
GRID kısmında silinmiş kayıtlar da gözüküyor.
Başta SET DELE ON komutunu kullanmama rağmen komut görevini yapmıyor ?

go recno()

komutu sorunu çözebilirmi ?




********************************************************************************************
Clear All
SET TALK OFF
SET NOTIFY OFF
SET DELE ON
*SELE 1
*USE bayrak INDEX bayrak1,bayrak2

Public oForm
oForm = Createobject("bayrak")
oForm.Show(1)

Define Class bayrak As Form
  DataSession = 2
  Top    = 2
  Left   = 50
  Height = 390 
  Width  = 350
  Name   = "bayrak"
  Caption = "Bayrak Kodu"

  orecord = .Null.

  Add Object lblno As Label With ;
    left = 5, Top = 5, Width = 45, Caption = "Kodu :"

  Add Object lbladi As Label With ;
    left = 5, Top = 30, AutoSize=.T., Caption = "Adı     :"

  Add Object txtNo As myTextBox With ;
      Top = 2, ;
      left = 45, ;
      Width = 35, ;
      Enabled = .F.
      *SelectOnEntry = .T., ControlSource = "bayrak.no"

  Add Object txtAdi As myTextBox With ;
       Top = 27, ;
       left = 45, ;
       Width = 150, ;
       Enabled = .F.
    *,ControlSource = "bayrak.adi"

   Add Object cmdNew as CommandButton With ;
        Top = 2, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Yeni Kayıt', ;
        Enabled = .t.

    Add Object cmdSave as CommandButton With ;
        Top = 2, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Sakla', ;
        Visible = .f.

    Add Object cmdSave2 as CommandButton With ;
        Top = 2, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Sakla', ;
        Visible = .f.
       
    Add Object cmdEdit as CommandButton With ;
        Top = 32, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Düzelt', ;
        Enabled = .t.

    Add Object cmdCancel as CommandButton With ;
        Top = 32, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Vazgeç', ;
        Visible = .f.

    Add Object cmdUpdate as CommandButton With ;
        Top = 32, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Sakla', ;
        Visible = .f.

    Add Object cmdDelete as CommandButton With ;
        Top = 62, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Sil', ;
        Enabled = .t.

    Add Object cmdClose as CommandButton With ;
        Top = 92, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Kapat'

    Add Object grdListe as myGrid


    Procedure cmdNew.Click
        ppNew()
    EndProc

    Procedure cmdSave.Click
        ppSave()
    EndProc

    Procedure cmdSave2.Click
        ppSave2()
    EndProc

    Procedure cmdCancel.Click
        ppCancel()
    EndProc     

    Procedure cmdEdit.Click
        ppEdit()
    EndProc

    Procedure cmdDelete.Click
        myDelete()
    EndProc   
   
    Procedure cmdClose.Click
        CLOSE ALL   
        thisform.Release
    EndProc
     
*  Add Object grdOrders As Grid With ;
*    Left = 10, Top = 90, Height = 400, Width = 780, ;
*    RecordSource = "Orders", ;
*    LinkMaster = "Customer", ;
*    ChildOrder = "cust_id",;
*    RelationalExpr = "cust_id"

  Procedure Load
     SELE 1
     USE bayrak INDEX bayrak1,bayrak2
*    Use bayrak INDEX bayrak1,bayrak2
*    In 0
*    Use (_samples+"data\orders") In 0

*    cursorsetprop("buffering",5,"customer")
*    cursorsetprop("buffering",5,"orders")
  Endproc

Enddefine
******************************************************************
Define Class myTextBox as TextBox
******************************************************************
    Enabled = .f.
    DisabledForeColor = Rgb(0,0,0)
    SelectOnEntry = .t.
EndDefine

******************************************************************
Procedure ppNew
******************************************************************
    With oForm
*        APPEND BLANK
        .txtNo.Enabled = .t.
        .txtNo.Value = 0
        .txtAdi.Enabled = .t.
        .txtAdi.Value = ''

        .cmdNew.Visible = .f.
        .cmdSave.Visible = .t.
        .cmdCancel.Visible = .t.       
        .cmdEdit.Visible = .f.
        .cmdDelete.Visible = .f.
        .cmdClose.Visible = .f.                       
*        .grdListe.Enabled = .f.
        .txtNo.SetFocus()
    EndWith
EndProc

******************************************************************
Procedure ppSave
******************************************************************
    With oForm
     sakla1=RECNO()
        If .txtNo.Value > 0
         SET ORDER TO 1
         SEEK .txtNo.Value
*         ? .txtNo.Value
*         BROWSE
*         WAIT
          IF FOUND()
*             ? "11"
*             WAIT
*             GO sakla1
  *           DELE
           MessageBox('Aynı Numaralı'+Chr(13)+'Kayıt Mevcut')

          ELSE
*             ? "22"
*             WAIT
           APPEND BLANK
           REPLA no  WITH .txtNo.Value 
           REPLA adi WITH .txtAdi.Value 

*           Thisform.Refresh()
           MessageBox('Kayıt işlemi'+Chr(13)+'başarıyla tamamlandı')
          ENDIF
        EndIf

        .txtNo.Enabled = .f.
        .txtAdi.Enabled = .f.
        .cmdNew.Visible = .t.
        .cmdSave.Visible = .f.
        .cmdCancel.Visible = .f.       
        .cmdEdit.Visible = .t.
        .cmdDelete.Visible = .t.
        .cmdClose.Visible = .t.                       

        .grdListe.Refresh()
        .grdListe.SetFocus()
       
*        .cmdListe.Click()
*        .grdListe.Enabled = .t.
*        .grdListe.SetFocus()


    EndWith
EndProc

******************************************************************
Procedure ppSave2
******************************************************************
    With oForm

*         REPLA no  WITH .txtNo.Value 
         REPLA adi WITH .txtAdi.Value 

        .txtNo.Enabled = .f.
        .txtAdi.Enabled = .f.
        .cmdNew.Visible = .t.
        .cmdSave.Visible = .f.
        .cmdCancel.Visible = .f.       
        .cmdEdit.Visible = .t.
        .cmdDelete.Visible = .t.
        .cmdClose.Visible = .t.                       

        .grdListe.Refresh()
        .grdListe.SetFocus()
       
*        .cmdListe.Click()
*        .grdListe.Enabled = .t.
*        .grdListe.SetFocus()


    EndWith
EndProc

******************************************************************
Procedure ppCancel
******************************************************************
    With oForm

        .txtNo.Enabled = .f.
        .txtAdi.Enabled = .f.
        .cmdNew.Visible = .t.
        .cmdSave.Visible = .f.
        .cmdSave2.Visible = .f.
        .cmdCancel.Visible = .f.       
        .cmdEdit.Visible = .t.
        .cmdDelete.Visible = .t.
        .cmdClose.Visible = .t.                       

        .grdListe.Refresh()
        .grdListe.SetFocus()
       
*        .cmdListe.Click()
*        .grdListe.Enabled = .t.
*        .grdListe.SetFocus()


    EndWith
EndProc

******************************************************************
Procedure ppEdit
******************************************************************
    With oForm
*        APPEND BLANK
        .txtNo.Enabled = .f.
        .txtNo.Value = no
        .txtAdi.Enabled = .t.
        .txtAdi.Value = adi

        .cmdNew.Visible = .f.
        .cmdSave2.Visible = .t.
        .cmdCancel.Visible = .t.       
        .cmdEdit.Visible = .f.
        .cmdDelete.Visible = .f.
        .cmdClose.Visible = .f.                       
*        .grdListe.Enabled = .f.
        .txtAdi.SetFocus()
    EndWith
EndProc

******************************************************************
Procedure myDelete
******************************************************************
    With oForm
*        If .tnHandle > 0
            m.lnResult = MessageBox('Silmek istediğinize'+Chr(13)+'eminmisiniz?', ;
                4+32+256, 'Silme Onayı')
            If lnResult = 6
               DELE
               MessageBox('Silme işlemi'+Chr(13)+'başarıyla tamamlandı', 64, 'Silme Onayı')

*                .cmdListe.Click()
                .grdListe.Refresh()
                .grdListe.SetFocus()
            EndIf
*        EndIf
    EndWith
EndProc

******************************************************************
Define Class myGrid as Grid
******************************************************************
    Top = 62
    Left = 2
    Height = 310
    Width = 220
    ColumnCount = 2
    DeleteMark = .t.
    RecordMark = .t.
    ReadOnly = .T.
    RecordSource = "bayrak"
    ScrollBars = 2
    GridLineColor = Rgb(192,192,192)
   
    Procedure Init
        With this
*       Scatter Name This.oRecord Memo

            .Column1.Header1.Caption = 'Kodu'
            .Column1.Width = 50       
            .Column2.Header1.Caption = 'Adı'
            .Column2.Width = 150       
*            .Column3.Header1.Caption = 'Yaşı'
*            .Column4.Header1.Caption = 'Maaşı'
*            .Column4.Width = 100       
        EndWith
    this.SetAll('Enabled',.f.,'textbox')
    this.SetAll('DisabledForeColor',0,'textbox')

    EndProc
   
    Procedure AfterRowColChange
        Lparameters nColIndex
        DoDefault(nColIndex)
        With oForm
            .txtno.Value = No
            .txtadi.Value = Adi
*            .txtYas.Value = Yas
*            .txtMaas.Value = Maas
        EndWith
       Thisform.Refresh()
    EndProc
EndDefine

4

Re: Forma SET DELE ON komutu

Onders; "Set Deleted ON" ise zaten silinmiş kayıtları göstermiyorsun demektir. Grid i refresh etsen?

Uğur
-------------------------------------------------------------------------------------------------------------
Hayat bir bisiklete binmek gibidir. Pedalı çevirmeye devam ettiğiniz sürece düşmezsiniz. Claude Peppeer
Kusuru söylenmeyen adam, ayıbını hüner sanır.  Türk Atasözü

5

Re: Forma SET DELE ON komutu

Komutu aşağıdaki gibi kullanınca sorun düzeldi. -))


  Procedure Load
     SET DELE ON
     SELE 1
     USE bayrak INDEX bayrak1,bayrak2
  Endproc

6

Re: Forma SET DELE ON komutu

Set Dreleted

diger bircok set komutu gibi datasession'a ozeldir. Sen form oncesi kuruyorsun, formun datasession'u 2. Form.Load'da kurunca duzelir.

7

Re: Forma SET DELE ON komutu

Teşekkürler