Forum
Merhaba bilgileri excel'e aktardığımda excelde "" şöyle bir şey çıkıyor. Ne olduğuna anlam veremedim. Kodlar aşağıdaki gibidir.
c.Open()
Dim adapp18 As New SqlDataAdapter("select * from personel where faturanum='" & TextBox13.Text & "'", c)
Dim des18 As New DataSet
adapp18.Fill(des18, "ana")
Dim kes18 As New DataView
kes18.Table = des18.Tables("ana")
DataGridView5.DataSource = kes18
Dim adapp As New SqlDataAdapter("select * from fatura ", c)
Dim des As New DataSet
adapp.Fill(des, "ana")
Dim kes As New DataView
kes.Table = des.Tables("ana")
DataGridView3.DataSource = kes
' DataGridView1.Colums(0).Row(0).Cell(2).Value()
TextBox5.Text = DataGridView3.Rows(0).Cells(0).Value
TextBox6.Text = DataGridView3.Rows(0).Cells(1).Value
Dim i As Integer
For i = TextBox5.Text To TextBox6.Text
ListBox8.Items.Add(i)
Next
If RadioButton2.Checked = True And ComboBox2.Text = "" Then
MsgBox("Kampanya kodu seçiniz.", MsgBoxStyle.OkOnly, "Uyarı")
Else
If (RadioButton1.Checked = True Or RadioButton4.Checked = True) Then
'MessageBox.Show("burdayım")
If (TextBox13.Text <> "") Then
If (Convert.ToInt32(TextBox13.Text) >= Convert.ToInt32(TextBox5.Text) And Convert.ToInt32(TextBox13.Text) < Convert.ToInt32(TextBox6.Text)) Then
Dim a
For a = 0 To ListBox8.Items.Count()
If (TextBox13.Text = ListBox8.Items(a).ToString) Then
'MessageBox.Show(DataGridView5.Rows.Count)
If (DataGridView5.Rows.Count <= 1) Then
'fatura numarasından başka yoksa
Dim command As New SqlCommand("insert into sanane (uyarı) values ('Not:Aktivasyon kodlarının raf ömrü 24 Aydır.')", connect)
command.ExecuteNonQuery()
Dim adap As New SqlDataAdapter("select * from sanane", connect)
Dim ds As New DataSet
adap.Fill(ds, "sanane")
Dim goster As New DataView
goster.Table = ds.Tables("sanane")
DataGridView1.DataSource = goster
DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
DataGridView1.Columns(0).HeaderText = "Ürün Bilgileri"
DataGridView1.Columns(1).HeaderText = "Aktivasyon Kodu"
DataGridView1.Columns(2).HeaderText = ""
DataGridView1.Columns(3).HeaderText = "Barkod"
Try
For i = 0 To DataGridView1.RowCount - 1
dess.Key = hash.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes("ea463**"))
dess.Mode = Security.Cryptography.CipherMode.ECB
Dim Desencrypter As System.Security.Cryptography.ICryptoTransform = dess.CreateDecryptor
Dim buffer As Byte() = Convert.FromBase64String(DataGridView1.Rows(i).Cells(1).Value)
DataGridView1.Rows(i).Cells(1).Value = System.Text.ASCIIEncoding.ASCII.GetString(Desencrypter.TransformFinalBlock(buffer, 0, buffer.Length))
Next
Catch ex As Exception
'MsgBox(Err.Description)
End Try
Dim yol
SaveFileDialog1.Filter = "Csv Dosyaları(*.csv)|*.csv | Tüm Dosyalar (*.*)|*.*"
Try
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
yol = SaveFileDialog1.FileName
Dim gridData(DataGridView1.Rows.Count - 1) As String
For Each r As DataGridViewRow In DataGridView1.Rows
If r.IsNewRow Then Exit For
Dim cellValues(DataGridView1.Rows(r.Index).Cells.Count - 1) As String
For Each c As DataGridViewCell In DataGridView1.Rows(r.Index).Cells
cellValues(c.ColumnIndex) = c.Value.ToString
Next
gridData(r.Index) = String.Join(" " & vbTab, cellValues)
Next
Dim lines = From line In gridData _
Where line <> Nothing _
Select line
IO.File.WriteAllLines(yol, lines.ToArray, System.Text.Encoding.UTF8)
Dim comman As New SqlCommand("select numara,barkod from sanane", connect)
Dim der As SqlDataReader = comman.ExecuteReader
While der.Read
ListBox6.Items.Add(der(0))
ListBox9.Items.Add(der(1))
End While
connect.Close()
connect.Open()
Try
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
SmtpServer.Credentials = New _
Net.NetworkCredential(DataGridView7.Rows(0).Cells(0).Value, DataGridView7.Rows(0).Cells(1).Value)
SmtpServer.Port = 25
SmtpServer.Host = "10.0.0.9"
SmtpServer.EnableSsl = False
mail = New MailMessage()
mail.From = New MailAddress(DataGridView7.Rows(0).Cells(3).Value)
mail.To.Add(DataGridView7.Rows(0).Cells(2).Value)
mail.To.Add("[email protected]")
mail.Subject = Label1.Text + " firmasına" + " Fatura Num: " + TextBox13.Text + " olan " + Convert.ToString(ListBox6.Items.Count - 1) + " adet ürün mail ile çıkıldı"
mail.IsBodyHtml = True
Dim myMessage As String = "<b>" + "Adet: " + "</b>" + Convert.ToString(ListBox6.Items.Count - 1) + Environment.NewLine
myMessage = myMessage + "<table border=0><tr>" + "<b>" + " FT.No: " + "</b>" + TextBox13.Text + "<td>" + "<b>" + " Firma Adı: " + "</b>" + Label1.Text + "</td><td><tr><td>"
myMessage = myMessage + "<b>" + "Ürün Adı " + "</b><td><td>"
myMessage = myMessage + "<b>" + "Barkod" + "</b><tr><td>"
Dim deger2, deger4
Dim sayma As Integer
For i = 0 To ListBox6.Items.Count - 1
deger4 = ListBox6.Items(i)
Next
For i = 0 To ListBox6.Items.Count - 2
deger2 = ListBox6.Items(i)
Dim adapp100 As New SqlDataAdapter("select barkod from personel where numara='" & deger2 & "'", c)
Dim des100 As New DataSet
adapp100.Fill(des100, "ana")
Dim kes100 As New DataView
kes100.Table = des100.Tables("ana")
DataGridView6.DataSource = kes100
' MessageBox.Show(ListBox6.Items.Count)
' MessageBox.Show(DataGridView6.Rows.Count)
myMessage = myMessage + DataGridView1.Rows(i).Cells(0).Value + "<td><td>" + DataGridView6.Rows(0).Cells(0).Value + "</td><tr><td>" + Environment.NewLine
mail.Body = myMessage
Next
SmtpServer.Send(mail)
MsgBox("Mail send")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Dim sor, sor2, deger
sor = MsgBox("Dosya oluşturuldu.Gönderdiklerinizi kaydetmek istiyor musunuz?", MsgBoxStyle.Information + MsgBoxStyle.YesNo, "İşlem Başarılı")
If sor = 7 Then
sor2 = MsgBox("Değişiklikleri iptal ettiniz geri dönmek istermisiniz?.Değişiklikleriniz kaydedilsin mi?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, " ")
If sor2 = 6 Then
GoTo son2
End If
ElseIf sor = 6 Then
son2:
If RadioButton1.Checked = True Or RadioButton4.Checked = True Then
For i = 0 To ListBox6.Items.Count - 1
deger = ListBox6.Items(i)
Dim conn As New SqlCommand("update personel set yazdirilma_durumu='Satıldı',yazdirmatar='" & Today & "', bayi='" & Label1.Text & "', cikistur='Mail',cikistar='" & Today & "',faturanum='" & TextBox13.Text & "',alici='" & kime & "' where numara='" & deger & "'", connect)
conn.ExecuteNonQuery()
Next
End If
End If
Dim commandt As New SqlCommand("select count(orderno) from personel", connect)
Form1.ToolStripStatusLabel2.Text = commandt.ExecuteScalar
Dim stok As New SqlCommand("select count(orderno) from personel where yazdirilma_durumu<>'Satıldı'", connect)
Form1.ToolStripStatusLabel5.Text = stok.ExecuteScalar
Dim satıl As New SqlCommand("select count(orderno) from personel where yazdirilma_durumu='Satıldı'", connect)
Form1.ToolStripStatusLabel8.Text = satıl.ExecuteScalar
Dim anaa As New SqlCommand("select count(orderno) from ana", connect)
Form1.ToolStripStatusLabel10.Text = anaa.ExecuteScalar
Dim seciliorder As New SqlCommand("select count(orderno) from personel where orderno=" & Form1.DataGridView2.Rows(Form1.satır).Cells(0).Value & "", connect)
Form1.ToolStripStatusLabel14.Text = seciliorder.ExecuteScalar
Dim adaps As New SqlDataAdapter("SELECT orderno,barkod,numara,urunadi,giristar,yazdirilma_durumu,yazdirmatar,cikistur,cikistar,kodtur,bayi,puan,kampanyakodu,faturanum FROM (SELECT ROW_NUMBER() OVER (ORDER BY barkod ASC) AS Row , personel.* FROM personel WHERE orderno=" & Val(Form1.DataGridView2.Rows(0).Cells(0).Value) & ") AS Row_Tablo WHERE Row_Tablo.Row BETWEEN 0 AND 100 ", connect)
Dim dws As New DataSet
adaps.Fill(dws, "personel")
Dim goester As New DataView
goester.Table = dws.Tables("personel")
goester.RowFilter = "orderno='" & Form1.DataGridView2.Rows(0).Cells(0).Value & "'"
Form1.DataGridView4.DataSource = goester
Try
For i = 0 To Form1.DataGridView4.RowCount - 1
dess.Key = hash.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes("ea463**"))
dess.Mode = Security.Cryptography.CipherMode.ECB
Dim Desencrypter As System.Security.Cryptography.ICryptoTransform = dess.CreateDecryptor
Dim buffer As Byte() = Convert.FromBase64String(Form1.DataGridView4.Rows(i).Cells(2).Value)
Form1.DataGridView4.Rows(i).Cells(2).Value = System.Text.ASCIIEncoding.ASCII.GetString(Desencrypter.TransformFinalBlock(buffer, 0, buffer.Length))
Next
Catch ex As Exception
'MsgBox(Err.Description)
End Try
Try
Form1.DataGridView4.Columns(0).HeaderText = "Order Numarası"
Form1.DataGridView4.Columns(1).HeaderText = "Barkod Numarası"
Form1.DataGridView4.Columns(2).HeaderText = "Aktivasyon Kodu"
Form1.DataGridView4.Columns(3).HeaderText = "Ürün Adı"
Form1.DataGridView4.Columns(4).HeaderText = "Sisteme Giriş Tarihi"
Form1.DataGridView4.Columns(5).HeaderText = "Durum"
Form1.DataGridView4.Columns(6).HeaderText = "Yazdırılma Tarihi"
Form1.DataGridView4.Columns(7).HeaderText = "Çıkış Türü"
Form1.DataGridView4.Columns(8).HeaderText = "Çıkış Tarihi"
Form1.DataGridView4.Columns(9).HeaderText = "Kod Türü"
Form1.DataGridView4.Columns(10).HeaderText = "Bayi Adı"
Form1.DataGridView4.Columns(11).HeaderText = "Puanı"
Form1.DataGridView4.Columns(12).HeaderText = "Kampanya Kodu"
Form1.DataGridView4.Columns(13).HeaderText = "Fatura Numarası"
Form1.DataGridView4.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
Catch ex As Exception
MsgBox(Err.Description)
End Try
'Form1.DataGridView2.Refresh()
' Form1.DataGridView1.Refresh()
For i = 0 To Form1.DataGridView4.RowCount - 1
Try
If Form1.DataGridView4.Rows(i).Cells(5).Value = "Stok" Or Form1.DataGridView4.Rows(i).Cells(5).Value = "Raf Stok" Then
Form1.DataGridView4.Rows(i).DefaultCellStyle.BackColor = Color.LightBlue
ElseIf Form1.DataGridView4.Rows(i).Cells(5).Value = "Satıldı" Or Form1.DataGridView4.Rows(i).Cells(5).Value = "Hediye" Or Form1.DataGridView4.Rows(i).Cells(5).Value = "Kod Değişimi" Then
Form1.DataGridView4.Rows(i).DefaultCellStyle.BackColor = Color.Silver
End If
Catch ex As Exception
MsgBox(Err.Description)
End Try
Next
Me.Close()
Exit For
End If
Catch ex As Exception
MsgBox(Err.Description)
End Try
Else
MessageBox.Show("Fatura numarası daha önce girilmiş!", _
"Sorgu Uyarı", _
MessageBoxButtons.OK, _
MessageBoxIcon.Error)
Exit For
End If
End If
Next
Else
MessageBox.Show("Fatura Aralığı geçersiz!", _
"Sorgu Uyarı", _
MessageBoxButtons.OK, _
MessageBoxIcon.Error)
End If
Else
MessageBox.Show("Fatura Aralığı geçersiz!", _
"Sorgu Uyarı", _
MessageBoxButtons.OK, _
MessageBoxIcon.Error)
End If
Else
' MessageBox.Show("burdayım2")
'promosyon hediye kod değişimi olduğunda
Dim deger
If RadioButton2.Checked = True Then
If ComboBox2.Text <> "" Then
For i = 0 To ListBox6.Items.Count - 1
deger = ListBox6.Items(i)
Dim conn As New SqlCommand("update personel set yazdirilma_durumu='Hediye',yazdirmatar='" & Today & "', bayi='" & Label1.Text & "', cikistur='Mail',cikistar='" & Today & "',alici='" & kime & "' where numara='" & deger & "'", connect)
conn.ExecuteNonQuery()
Next
Dim yol
SaveFileDialog1.Filter = "Csv Dosyaları(*.csv)|*.csv | Tüm Dosyalar (*.*)|*.*"
Try
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
yol = SaveFileDialog1.FileName
Dim gridData(DataGridView1.Rows.Count - 1) As String
For Each r As DataGridViewRow In DataGridView1.Rows
If r.IsNewRow Then Exit For
Dim cellValues(DataGridView1.Rows(r.Index).Cells.Count - 1) As String
For Each c As DataGridViewCell In DataGridView1.Rows(r.Index).Cells
cellValues(c.ColumnIndex) = c.Value.ToString
Next
gridData(r.Index) = String.Join(" " & vbTab, cellValues)
Next
Dim lines = From line In gridData _
Where line <> Nothing _
Select line
IO.File.WriteAllLines(yol, lines.ToArray, System.Text.Encoding.UTF8)
Dim comman As New SqlCommand("select numara from sanane", connect)
Dim der As SqlDataReader = comman.ExecuteReader
While der.Read
ListBox6.Items.Add(der(0))
End While
connect.Close()
connect.Open()
Dim sor, sor2
sor = MsgBox("Dosya oluşturuldu.Gönderdiklerinizi kaydetmek istiyor musunuz?", MsgBoxStyle.Information + MsgBoxStyle.YesNo, "İşlem Başarılı")
If sor = 7 Then
sor2 = MsgBox("Değişiklikleri iptal ettiniz geri dönmek istermisiniz?.Değişiklikleriniz kaydedilsin mi?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, " ")
If sor2 = 6 Then
GoTo son3
End If
ElseIf sor = 6 Then
son3:
If RadioButton3.Checked Then
For i = 0 To ListBox6.Items.Count - 1
deger = ListBox6.Items(i)
Dim conn As New SqlCommand("update personel set yazdirilma_durumu='Hediye',yazdirmatar='" & Today & "', bayi='" & Label1.Text & "', cikistur='Mail',cikistar='" & Today & "',alici='" & kime & "' where numara='" & deger & "'", connect)
conn.ExecuteNonQuery()
Next
End If
End If
Dim commandt As New SqlCommand("select count(orderno) from personel", connect)
Form1.ToolStripStatusLabel2.Text = commandt.ExecuteScalar
Dim stok As New SqlCommand("select count(orderno) from personel where yazdirilma_durumu<>'Satıldı'", connect)
Form1.ToolStripStatusLabel5.Text = stok.ExecuteScalar
Dim satıl As New SqlCommand("select count(orderno) from personel where yazdirilma_durumu='Satıldı'", connect)
Form1.ToolStripStatusLabel8.Text = satıl.ExecuteScalar
Dim anaa As New SqlCommand("select count(orderno) from ana", connect)
Form1.ToolStripStatusLabel10.Text = anaa.ExecuteScalar
Dim seciliorder As New SqlCommand("select count(orderno) from personel where orderno=" & Form1.DataGridView2.Rows(Form1.satır).Cells(0).Value & "", connect)
Form1.ToolStripStatusLabel14.Text = seciliorder.ExecuteScalar
Dim adaps As New SqlDataAdapter("SELECT orderno,barkod,numara,urunadi,giristar,yazdirilma_durumu,yazdirmatar,cikistur,cikistar,kodtur,bayi,puan,kampanyakodu,faturanum FROM (SELECT ROW_NUMBER() OVER (ORDER BY barkod ASC) AS Row , personel.* FROM personel WHERE orderno=" & Val(Form1.DataGridView2.Rows(0).Cells(0).Value) & ") AS Row_Tablo WHERE Row_Tablo.Row BETWEEN 0 AND 100 ", connect)
Dim dws As New DataSet
adaps.Fill(dws, "personel")
Dim goester As New DataView
goester.Table = dws.Tables("personel")
goester.RowFilter = "orderno='" & Form1.DataGridView2.Rows(0).Cells(0).Value & "'"
Form1.DataGridView4.DataSource = goester
Try
For i = 0 To Form1.DataGridView4.RowCount - 1
dess.Key = hash.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes("ea463**"))
dess.Mode = Security.Cryptography.CipherMode.ECB
Dim Desencrypter As System.Security.Cryptography.ICryptoTransform = dess.CreateDecryptor
Dim buffer As Byte() = Convert.FromBase64String(Form1.DataGridView4.Rows(i).Cells(2).Value)
Form1.DataGridView4.Rows(i).Cells(2).Value = System.Text.ASCIIEncoding.ASCII.GetString(Desencrypter.TransformFinalBlock(buffer, 0, buffer.Length))
Next
Catch ex As Exception
'MsgBox(Err.Description)
End Try
Try
Form1.DataGridView4.Columns(0).HeaderText = "Order Numarası"
Form1.DataGridView4.Columns(1).HeaderText = "Barkod Numarası"
Form1.DataGridView4.Columns(2).HeaderText = "Aktivasyon Kodu"
Form1.DataGridView4.Columns(3).HeaderText = "Ürün Adı"
Form1.DataGridView4.Columns(4).HeaderText = "Sisteme Giriş Tarihi"
Form1.DataGridView4.Columns(5).HeaderText = "Durum"
Form1.DataGridView4.Columns(6).HeaderText = "Yazdırılma Tarihi"
Form1.DataGridView4.Columns(7).HeaderText = "Çıkış Türü"
Form1.DataGridView4.Columns(8).HeaderText = "Çıkış Tarihi"
Form1.DataGridView4.Columns(9).HeaderText = "Kod Türü"
Form1.DataGridView4.Columns(10).HeaderText = "Bayi Adı"
Form1.DataGridView4.Columns(11).HeaderText = "Puanı"
Form1.DataGridView4.Columns(12).HeaderText = "Kampanya Kodu"
Form1.DataGridView4.Columns(13).HeaderText = "Fatura Numarası"
Form1.DataGridView4.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
Catch ex As Exception
MsgBox(Err.Description)
End Try
'Form1.DataGridView2.Refresh()
' Form1.DataGridView1.Refresh()
For i = 0 To Form1.DataGridView4.RowCount - 1
Try
If Form1.DataGridView4.Rows(i).Cells(5).Value = "Stok" Or Form1.DataGridView4.Rows(i).Cells(5).Value = "Raf Stok" Then
Form1.DataGridView4.Rows(i).DefaultCellStyle.BackColor = Color.LightBlue
ElseIf Form1.DataGridView4.Rows(i).Cells(5).Value = "Satıldı" Or Form1.DataGridView4.Rows(i).Cells(5).Value = "Hediye" Or Form1.DataGridView4.Rows(i).Cells(5).Value = "Kod Değişimi" Then
Form1.DataGridView4.Rows(i).DefaultCellStyle.BackColor = Color.Silver
End If
Catch ex As Exception
MsgBox(Err.Description)
End Try
Next
Me.Close()
End If
Catch ex As Exception
MsgBox(Err.Description)
End Try
Else
MsgBox("Kampanya kodu seçiniz.", MsgBoxStyle.OkOnly, "Uyarı")
End If
End If
If RadioButton3.Checked = True Then
For i = 0 To ListBox6.Items.Count - 1
deger = ListBox6.Items(i)
Dim conn As New SqlCommand("update personel set yazdirilma_durumu='Kod Değişimi',yazdirmatar='" & Today & "', bayi='" & Label1.Text & "', cikistur='Mail',cikistar='" & Today & "',alici='" & kime & "' where numara='" & deger & "'", connect)
conn.ExecuteNonQuery()
Next
Dim yol
SaveFileDialog1.Filter = "Csv Dosyaları(*.csv)|*.csv | Tüm Dosyalar (*.*)|*.*"
Try
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
yol = SaveFileDialog1.FileName
Dim gridData(DataGridView1.Rows.Count - 1) As String
For Each r As DataGridViewRow In DataGridView1.Rows
If r.IsNewRow Then Exit For
Dim cellValues(DataGridView1.Rows(r.Index).Cells.Count - 1) As String
For Each c As DataGridViewCell In DataGridView1.Rows(r.Index).Cells
cellValues(c.ColumnIndex) = c.Value.ToString
Next
gridData(r.Index) = String.Join(" " & vbTab, cellValues)
Next
Dim lines = From line In gridData _
Where line <> Nothing _
Select line
IO.File.WriteAllLines(yol, lines.ToArray, System.Text.Encoding.UTF8)
Dim comman As New SqlCommand("select numara from sanane", connect)
Dim der As SqlDataReader = comman.ExecuteReader
While der.Read
ListBox6.Items.Add(der(0))
End While
connect.Close()
connect.Open()
Dim sor, sor2
sor = MsgBox("Dosya oluşturuldu.Gönderdiklerinizi kaydetmek istiyor musunuz?", MsgBoxStyle.Information + MsgBoxStyle.YesNo, "İşlem Başarılı")
If sor = 7 Then
sor2 = MsgBox("Değişiklikleri iptal ettiniz geri dönmek istermisiniz?.Değişiklikleriniz kaydedilsin mi?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, " ")
If sor2 = 6 Then
GoTo son4
End If
ElseIf sor = 6 Then
son4:
If RadioButton3.Checked Then
For i = 0 To ListBox6.Items.Count - 1
deger = ListBox6.Items(i)
Dim conn As New SqlCommand("update personel set yazdirilma_durumu='Kod Değişimi',yazdirmatar='" & Today & "', bayi='" & Label1.Text & "', cikistur='Mail',cikistar='" & Today & "',alici='" & kime & "' where numara='" & deger & "'", connect)
conn.ExecuteNonQuery()
Next
End If
End If
Dim commandt As New SqlCommand("select count(orderno) from personel", connect)
Form1.ToolStripStatusLabel2.Text = commandt.ExecuteScalar
Dim stok As New SqlCommand("select count(orderno) from personel where yazdirilma_durumu<>'Satıldı'", connect)
Form1.ToolStripStatusLabel5.Text = stok.ExecuteScalar
Dim satıl As New SqlCommand("select count(orderno) from personel where yazdirilma_durumu='Satıldı'", connect)
Form1.ToolStripStatusLabel8.Text = satıl.ExecuteScalar
Dim anaa As New SqlCommand("select count(orderno) from ana", connect)
Form1.ToolStripStatusLabel10.Text = anaa.ExecuteScalar
Dim seciliorder As New SqlCommand("select count(orderno) from personel where orderno=" & Form1.DataGridView2.Rows(Form1.satır).Cells(0).Value & "", connect)
Form1.ToolStripStatusLabel14.Text = seciliorder.ExecuteScalar
Dim adaps As New SqlDataAdapter("SELECT orderno,barkod,numara,urunadi,giristar,yazdirilma_durumu,yazdirmatar,cikistur,cikistar,kodtur,bayi,puan,kampanyakodu,faturanum FROM (SELECT ROW_NUMBER() OVER (ORDER BY barkod ASC) AS Row , personel.* FROM personel WHERE orderno=" & Val(Form1.DataGridView2.Rows(0).Cells(0).Value) & ") AS Row_Tablo WHERE Row_Tablo.Row BETWEEN 0 AND 100 ", connect)
Dim dws As New DataSet
adaps.Fill(dws, "personel")
Dim goester As New DataView
goester.Table = dws.Tables("personel")
goester.RowFilter = "orderno='" & Form1.DataGridView2.Rows(0).Cells(0).Value & "'"
Form1.DataGridView4.DataSource = goester
Try
For i = 0 To Form1.DataGridView4.RowCount - 1
dess.Key = hash.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes("ea463**"))
dess.Mode = Security.Cryptography.CipherMode.ECB
Dim Desencrypter As System.Security.Cryptography.ICryptoTransform = dess.CreateDecryptor
Dim buffer As Byte() = Convert.FromBase64String(Form1.DataGridView4.Rows(i).Cells(2).Value)
Form1.DataGridView4.Rows(i).Cells(2).Value = System.Text.ASCIIEncoding.ASCII.GetString(Desencrypter.TransformFinalBlock(buffer, 0, buffer.Length))
Next
Catch ex As Exception
'MsgBox(Err.Description)
End Try
Try
Form1.DataGridView4.Columns(0).HeaderText = "Order Numarası"
Form1.DataGridView4.Columns(1).HeaderText = "Barkod Numarası"
Form1.DataGridView4.Columns(2).HeaderText = "Aktivasyon Kodu"
Form1.DataGridView4.Columns(3).HeaderText = "Ürün Adı"
Form1.DataGridView4.Columns(4).HeaderText = "Sisteme Giriş Tarihi"
Form1.DataGridView4.Columns(5).HeaderText = "Durum"
Form1.DataGridView4.Columns(6).HeaderText = "Yazdırılma Tarihi"
Form1.DataGridView4.Columns(7).HeaderText = "Çıkış Türü"
Form1.DataGridView4.Columns(8).HeaderText = "Çıkış Tarihi"
Form1.DataGridView4.Columns(9).HeaderText = "Kod Türü"
Form1.DataGridView4.Columns(10).HeaderText = "Bayi Adı"
Form1.DataGridView4.Columns(11).HeaderText = "Puanı"
Form1.DataGridView4.Columns(12).HeaderText = "Kampanya Kodu"
Form1.DataGridView4.Columns(13).HeaderText = "Fatura Numarası"
Form1.DataGridView4.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
Catch ex As Exception
MsgBox(Err.Description)
End Try
'Form1.DataGridView2.Refresh()
' Form1.DataGridView1.Refresh()
For i = 0 To Form1.DataGridView4.RowCount - 1
Try
If Form1.DataGridView4.Rows(i).Cells(5).Value = "Stok" Or Form1.DataGridView4.Rows(i).Cells(5).Value = "Raf Stok" Then
Form1.DataGridView4.Rows(i).DefaultCellStyle.BackColor = Color.LightBlue
ElseIf Form1.DataGridView4.Rows(i).Cells(5).Value = "Satıldı" Or Form1.DataGridView4.Rows(i).Cells(5).Value = "Hediye" Or Form1.DataGridView4.Rows(i).Cells(5).Value = "Kod Değişimi" Then
Form1.DataGridView4.Rows(i).DefaultCellStyle.BackColor = Color.Silver
End If
Catch ex As Exception
MsgBox(Err.Description)
End Try
Next
Me.Close()
End If
Catch ex As Exception
MsgBox(Err.Description)
End Try
End If
End If
End If
End Sub
Merhaba [b]İsmet Bey[/b], bu tarz sorunlarda dosyayı görmek gerek.
Teşekkürler. Bu arada bey değil HANIM.
bey küçük HANIM büyük... peki
İyi akşamlar..
vurgulamak istedim
İyi günler.
Peki [b]İsmet Hanım[/b]..
Önceki mesajımda da söylediğim gibi, bu konuda net bir çözüm sunmak için projeyi görmek gerekir.
Eğer bir sakıncası yoksa gönderirseniz inceleyip size bir çözüm sunabilirim.
Hoşça kalın !
Murat BEY
Kurumsal bir firmada çalıştığımdan dolayı database server üzerinde çalışıyor bu yüzden projeyi size gönderemiyorum
Anlıyorum [b]İsmet Hanım[/b], peki...
[b]Excel [/b] ve [b]VBA[/b] ile ilgili herhangi bir istek ya da sorununuz olduğunda net bir çözüm sunarım.
Hoşça kalın !