private void dgvmonitor_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
int sayi = 0;
DataTable mydatatable = sqlbaglanti.verigetir(@"SELECT *
FROM _SIP LEFT join _SAT on _SAT.LOGICALREF =_SIP.SIPREF LEFT join _ODEME on _ODEME.SIPREF=_SIP.SIPREF LEFT join _DEPO on _DEPO.SIPREF=_SIP.SIPREF
", out sayi);
//mydatatable.Rows[I]["OD.TUTAR"].ToString() != null && mydatatable.Rows[I]["DEP.TESLIMEDILEN"].ToString() != null &&
for (int I = 0; I < dgvmonitor.Rows.Count - 1; I++)
{
dgvmonitor.Rows[I].Cells[0].Style.Font = new System.Drawing.Font("times new roman", 13, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[1].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[2].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[3].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[4].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[5].Style.Font = new System.Drawing.Font("times new roman", 13, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[6].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[7].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[8].Style.Font = new System.Drawing.Font("times new roman", 13, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[9].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[10].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[11].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[12].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[13].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[14].Style.Font = new System.Drawing.Font("times new roman", 13, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[15].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[I].Cells[16].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
if (Convert.ToString(dgvmonitor.Rows[I].Cells[7].Value.ToString()) != Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[10].Value.ToString()) == Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[12].Value.ToString()) == Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[16].Value.ToString()) == Convert.ToString(DBNull.Value))
{
dgvmonitor.Rows[I].Cells[0].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[1].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[2].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[3].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[4].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[5].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[6].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[7].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].DefaultCellStyle.BackColor = Color.DarkGray;
dgvmonitor.Rows[I].DefaultCellStyle.ForeColor = Color.White;
}
else
if (Convert.ToString(dgvmonitor.Rows[I].Cells[7].Value.ToString()) != Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[10].Value.ToString()) != Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[12].Value.ToString()) == Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[16].Value.ToString()) == Convert.ToString(DBNull.Value))
{
dgvmonitor.Rows[I].Cells[0].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[1].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[2].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[3].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[4].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[5].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[6].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[7].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[8].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[9].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[10].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].DefaultCellStyle.BackColor = Color.DarkGray;
dgvmonitor.Rows[I].DefaultCellStyle.ForeColor = Color.White;
}
else
if (Convert.ToString(dgvmonitor.Rows[I].Cells[7].Value.ToString()) != Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[10].Value.ToString()) != Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[12].Value.ToString()) != Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[16].Value.ToString()) == Convert.ToString(DBNull.Value))
{
dgvmonitor.Rows[I].Cells[0].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[1].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[2].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[3].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[4].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[5].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[6].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[7].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[8].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[9].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[10].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[11].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].Cells[12].Style.BackColor = Color.Blue;
dgvmonitor.Rows[I].DefaultCellStyle.BackColor = Color.DarkGray;
dgvmonitor.Rows[I].DefaultCellStyle.ForeColor = Color.White;
}
else
if (Convert.ToString(dgvmonitor.Rows[I].Cells[7].Value.ToString()) != Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[10].Value.ToString()) != Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[12].Value.ToString()) != Convert.ToString(DBNull.Value) && Convert.ToString(dgvmonitor.Rows[I].Cells[16].Value.ToString()) != Convert.ToString(DBNull.Value))
{
//dgvmonitor.Rows[I].Cells[0].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[1].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[2].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[3].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[4].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[5].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[6].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[7].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[8].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[9].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[10].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[11].Style.BackColor = Color.DeepSkyBlue;
//dgvmonitor.Rows[I].Cells[12].Style.BackColor = Color.DeepSkyBlue;
dgvmonitor.Rows[I].DefaultCellStyle.BackColor = Color.Blue;
dgvmonitor.Rows[I].DefaultCellStyle.ForeColor = Color.White;
}
}
}
private void timer1_Tick(object sender, EventArgs e)
{
int sayi = 0;
//string select = "SELECT [SIPARISNO] ,[SIPARISTARIHI],[SIPARISVEREN],[SIPARISALAN],[ALIMSHOTNO] ,[ALIMSHOTTARIHI],[ALIMTUTAR] ,[ODEMENO],[ODEMETARIHI] ,[DEPOTESLIMTARIHI] ,[FATURANO],[TESLIMALAN] ,[URETIMTESLIMALAN],[DURUM] ,[BANKA] ,[PLATOSHKANO],[PRICE]FROM [SIP2012].[dbo].[SIPFATURA]";
//dgvmonitor.DataSource = sqlbaglanti.verigetir(select, out sayi);
dgvmonitor.DataSource = sqlbaglanti.verigetir(@"SELECT *
FROM
(SELECT *,
(select od.FISHENO from _ODEME od where od.SIPREF = A.SIPLOG) AS [№ ПЛАТЕЖКИ],
(select DATE_ from _ODEME od where od.SIPREF = A.SIPLOG) AS [ДАТА ПЛАТЕЖКИ],
(select TUTAR from _ODEME od where od.SIPREF = A.SIPLOG) AS [СУММА ПЛАТЕЖКИ],
(select DATE_ from _TRANSPORT TR where TR.SIPREF = A.SIPLOG) AS [ДАТА ТРАНСПОРТИРОВКИ],
(select FIRMA from _TRANSPORT TR where TR.SIPREF = A.SIPLOG) AS [ТРАНСПОРТНАЯ ФИРМА],
(select DATE_ from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [ДАТА ПОЛУЧЕНИЕ (СКЛАД)],
(select FATURANO from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [№ СЧЕТ ФАТУРЫ],
(select TESLIMALAN from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [КТО ПРИНЯЛ (СКЛАД)],
(select TESLIMEDILEN from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [КОМУ ПЕРЕДАНО (СКЛАД)]
FROM
(select sat.FISHENO AS [№ ЗАЯВКИ],sat.DATE_ AS [ДАТА ЗАЯВКИ],sat.[SIPARISI VEREN] AS[ЗАКАЗЧИК],sat.[SIPARISI ALAN] AS [ПРИНЯЛ ЗАКАЗ],
SIP.LOGICALREF AS SIPLOG,SIP.FISHENO AS [№ СЧЕТА],SIP.DATE_ AS [ДАТА СЧЕТА],SIP.TOTAL AS [СУММА СЧЕТА]
from _SAT sat
INNER JOIN _SIP SIP ON sat.LOGICALREF =SIP.SIPREF where SIP.ACTIVE = 0) A)B
", out sayi);
//dgvmonitor.Rows[0].Cells[1].Style.BackColor = Color.Khaki;
int sayim = Convert.ToInt32(dgvmonitor.Columns.Count);
}
private void Form1_Load(object sender, EventArgs e)
{
dgvmonitor.ColumnHeadersHeight.ToString(Convert.ToString(50));
btnok.BackColor = Color.Blue;
btnok.ForeColor = Color.Red;
btnbekle.BackColor = Color.Gray;
btnbekle.Font = new System.Drawing.Font("Tahoma", 9, FontStyle.Bold);
btnbekle.ForeColor = Color.Red;
//StatusBar stat = new StatusBar();
//stat.Panels.Add("ILK PANEL");
//stat.Panels[0].Text = "ODABASI YAZILIM";
//stat.Panels[0].AutoSize = StatusBarPanelAutoSize.Spring;
//stat.Panels[0].BorderStyle = StatusBarPanelBorderStyle.None;
//stat.ShowPanels = true;
timer1.Start();
timer2.Stop();
int sayi = 0;
dgvmonitor.DataSource = sqlbaglanti.verigetir(@"SELECT *
FROM
(SELECT *,
(select od.FISHENO from _ODEME od where od.SIPREF = A.SIPLOG) AS [№ ПЛАТЕЖКИ],
(select DATE_ from _ODEME od where od.SIPREF = A.SIPLOG) AS [ДАТА ПЛАТЕЖКИ],
(select TUTAR from _ODEME od where od.SIPREF = A.SIPLOG) AS [СУММА ПЛАТЕЖКИ],
(select DATE_ from _TRANSPORT TR where TR.SIPREF = A.SIPLOG) AS [ДАТА ТРАНСПОРТИРОВКИ],
(select FIRMA from _TRANSPORT TR where TR.SIPREF = A.SIPLOG) AS [ТРАНСПОРТНАЯ ФИРМА],
(select DATE_ from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [ДАТА ПОЛУЧЕНИЕ (СКЛАД)],
(select FATURANO from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [№ СЧЕТ ФАТУРЫ],
(select TESLIMALAN from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [КТО ПРИНЯЛ (СКЛАД)],
(select TESLIMEDILEN from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [КОМУ ПЕРЕДАНО (СКЛАД)]
FROM
(select sat.FISHENO AS [№ ЗАЯВКИ],sat.DATE_ AS [ДАТА ЗАЯВКИ],sat.[SIPARISI VEREN] AS[ЗАКАЗЧИК],sat.[SIPARISI ALAN] AS [ПРИНЯЛ ЗАКАЗ],
SIP.LOGICALREF AS SIPLOG,SIP.FISHENO AS [№ СЧЕТА],SIP.DATE_ AS [ДАТА СЧЕТА],SIP.TOTAL AS [СУММА СЧЕТА]
from _SAT sat
INNER JOIN _SIP SIP ON sat.LOGICALREF =SIP.SIPREF where SIP.ACTIVE = 0) A)B
", out sayi);
dgvmonitor.ColumnHeadersDefaultCellStyle.ForeColor = Color.Yellow;
dgvmonitor.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("Tahoma", 9, FontStyle.Bold);
dgvmonitor.Columns[4].Visible = false;
int sayim = Convert.ToInt32(dgvmonitor.Columns.Count);
for (int i = 0; i < sayim; i++)
{
DataGridViewColumn column = dgvmonitor.Columns[i];
column.Width = 82;
DataGridViewRow satir = dgvmonitor.Rows[i];
satir.Height = 40;
DataGridViewCellStyle style = dgvmonitor.Rows[i].Cells[1].Style;
dgvmonitor.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("times new roman", 11, FontStyle.Bold);
// dgvmonitor.Font = new System.Drawing.Font("times new roman", 15, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[0].Style.Font = new System.Drawing.Font("times new roman", 13, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[1].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[2].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[3].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[4].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[5].Style.Font = new System.Drawing.Font("times new roman", 13, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[6].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[7].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[8].Style.Font = new System.Drawing.Font("times new roman", 13, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[9].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[10].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[11].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[12].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[13].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[14].Style.Font = new System.Drawing.Font("times new roman", 13, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[15].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
dgvmonitor.Rows[i].Cells[16].Style.Font = new System.Drawing.Font("times new roman", 12, FontStyle.Bold);
}
try
{
for (int i = 0; i < dgvmonitor.RowCount - 1; i++)
{
if (dgvmonitor.Rows[i].Cells[10].Value != null &&
dgvmonitor.Rows[i].Cells[10].Value != DBNull.Value)
{
// dgvmonitor.Rows[i].Cells[10].Value = String.Format("{0:N2}",
int.Parse(dgvmonitor.Rows[i].Cells[10].Value.ToString());
}
}
MessageBox.Show(" Gncelleme tamamland!", "˜LEM TAMAM");
}
catch (Exception hata)
{
MessageBox.Show(hata.Message.ToString(), "HATA MESAJI", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally { }
}
private void dgvmonitor_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
//for (int i = 0; i < dgvmonitor.Rows.Count - 1; i++)
//{
// if (Convert.ToString(dgvmonitor.Rows[i].Cells[16].Value) != Convert.ToString(DBNull.Value))
// {
// dgvmonitor.Rows[i].Visible = false;
// }
//}
if (e.RowIndex == -1)
//sütun başlıklarını dikey konuma çeviriyoruz
//{ if (e.ColumnIndex> -1)
//{ e.Paint(e.CellBounds, DataGridViewPaintParts.All& ~ DataGridViewPaintParts.ContentForeground); using (SolidBrush br = new SolidBrush(e.CellStyle.ForeColor)) using (StringFormat sf = new StringFormat()) { sf.FormatFlags = StringFormatFlags.DirectionVertical; e.Graphics.DrawString(e.Value.ToString(), e.CellStyle.Font, br, e.CellBounds, sf); } e.Handled = true; } }
for (int i = 0; i < dgvmonitor.Rows.Count; i++)
{
DataGridViewRow satir = dgvmonitor.Rows[i];
satir.Height = 40;
}
}
private void dgvmonitor_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void timer2_Tick(object sender, EventArgs e)
{
int sayi = 0;
DataTable mydatatabel = new DataTable(@"SELECT * FROM " +
"(SELECT *," +
"(select od.FISHENO from _ODEME od where od.SIPREF = A.SIPLOG) AS [№ ПЛАТЕЖКИ]," +
"(select DATE_ from _ODEME od where od.SIPREF = A.SIPLOG) AS [ДАТА ПЛАТЕЖКИ]," +
"(select TUTAR from _ODEME od where od.SIPREF = A.SIPLOG) AS [СУММА ПЛАТЕЖКИ]," +
"(select DATE_ from _TRANSPORT TR where TR.SIPREF = A.SIPLOG) AS [ДАТА ТРАНСПОРТИРОВКИ]," +
"(select FIRMA from _TRANSPORT TR where TR.SIPREF = A.SIPLOG) AS [ТРАНСПОРТНАЯ ФИРМА]," +
"(select DATE_ from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [ДАТА ПОЛУЧЕНИЕ (СКЛАД)]," +
"(select FATURANO from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [№ СЧЕТ ФАТУРЫ]," +
"(select TESLIMALAN from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [КТО ПРИНЯЛ (СКЛАД)]," +
"(select TESLIMEDILEN from _DEPO dep where dep.SIPREF = A.SIPLOG) AS [КОМУ ПЕРЕДАНО (СКЛАД)]" +
"FROM" +
"(select sat.FISHENO AS [№ ЗАЯВКИ],sat.DATE_ AS [ДАТА ЗАЯВКИ],sat.[SIPARISI VEREN] AS[ЗАКАЗЧИК],sat.[SIPARISI ALAN] AS [ПРИНЯЛ ЗАКАЗ]," +
"SIP.LOGICALREF AS SIPLOG,SIP.FISHENO AS [№ СЧЕТА],SIP.DATE_ AS [ДАТА СЧЕТА],SIP.TOTAL AS [СУММА СЧЕТА] from _SAT sat INNER JOIN _SIP SIP ON sat.LOGICALREF =SIP.SIPREF where SIP.ACTIVE = 0) A)B ");
if (timer2.Interval<= 10000)
{
for (int i = 0; i < 2; i++)
{
dgvmonitor.Rows[i].Cells[0].Value = mydatatabel.Rows[i]["№ ЗАЯВКИ"];
dgvmonitor.Rows[i].Cells[1].Value = mydatatabel.Rows[i]["ДАТА ЗАЯВКИ"];
dgvmonitor.Rows[i].Cells[2].Value = mydatatabel.Rows[i]["ЗАКАЗЧИК"];
dgvmonitor.Rows[i].Cells[3].Value = mydatatabel.Rows[i]["ПРИНЯЛ ЗАКАЗ"];
dgvmonitor.Rows[i].Cells[4].Value = mydatatabel.Rows[i]["№ СЧЕТА"];
dgvmonitor.Rows[i].Cells[5].Value = mydatatabel.Rows[i]["ДАТА СЧЕТА"];
dgvmonitor.Rows[i].Cells[6].Value = mydatatabel.Rows[i]["СУММА СЧЕТА"];
dgvmonitor.Rows[i].Cells[7].Value = mydatatabel.Rows[i]["№ ПЛАТЕЖКИ"];
dgvmonitor.Rows[i].Cells[8].Value = mydatatabel.Rows[i]["ДАТА ПЛАТЕЖКИ"];
dgvmonitor.Rows[i].Cells[9].Value = mydatatabel.Rows[i]["СУММА ПЛАТЕЖКИ"];
dgvmonitor.Rows[i].Cells[10].Value = mydatatabel.Rows[i]["ДАТА ТРАНСПОРТИРОВКИ"];
dgvmonitor.Rows[i].Cells[11].Value = mydatatabel.Rows[i]["ТРАНСПОРТНАЯ ФИРМА"];
dgvmonitor.Rows[i].Cells[12].Value = mydatatabel.Rows[i]["ДАТА ПОЛУЧЕНИЕ (СКЛАД)"];
dgvmonitor.Rows[i].Cells[13].Value = mydatatabel.Rows[i]["№ СЧЕТ ФАТУРЫ"];
dgvmonitor.Rows[i].Cells[14].Value = mydatatabel.Rows[i]["[КТО ПРИНЯЛ (СКЛАД)"];
dgvmonitor.Rows[i].Cells[15].Value = mydatatabel.Rows[i]["КОМУ ПЕРЕДАНО (СКЛАД)"];
}
if (timer2.Interval <= 20000)
{
for (int i = 2; i < 5; i++)
{
dgvmonitor.Rows[i].Cells[0].Value = mydatatabel.Rows[i]["№ ЗАЯВКИ"];
dgvmonitor.Rows[i].Cells[1].Value = mydatatabel.Rows[i]["ДАТА ЗАЯВКИ"];
dgvmonitor.Rows[i].Cells[2].Value = mydatatabel.Rows[i]["ЗАКАЗЧИК"];
dgvmonitor.Rows[i].Cells[3].Value = mydatatabel.Rows[i]["ПРИНЯЛ ЗАКАЗ"];
dgvmonitor.Rows[i].Cells[4].Value = mydatatabel.Rows[i]["№ СЧЕТА"];
dgvmonitor.Rows[i].Cells[5].Value = mydatatabel.Rows[i]["ДАТА СЧЕТА"];
dgvmonitor.Rows[i].Cells[6].Value = mydatatabel.Rows[i]["СУММА СЧЕТА"];
dgvmonitor.Rows[i].Cells[7].Value = mydatatabel.Rows[i]["№ ПЛАТЕЖКИ"];
dgvmonitor.Rows[i].Cells[8].Value = mydatatabel.Rows[i]["ДАТА ПЛАТЕЖКИ"];
dgvmonitor.Rows[i].Cells[9].Value = mydatatabel.Rows[i]["СУММА ПЛАТЕЖКИ"];
dgvmonitor.Rows[i].Cells[10].Value = mydatatabel.Rows[i]["ДАТА ТРАНСПОРТИРОВКИ"];
dgvmonitor.Rows[i].Cells[11].Value = mydatatabel.Rows[i]["ТРАНСПОРТНАЯ ФИРМА"];
dgvmonitor.Rows[i].Cells[12].Value = mydatatabel.Rows[i]["ДАТА ПОЛУЧЕНИЕ (СКЛАД)"];
dgvmonitor.Rows[i].Cells[13].Value = mydatatabel.Rows[i]["№ СЧЕТ ФАТУРЫ"];
dgvmonitor.Rows[i].Cells[14].Value = mydatatabel.Rows[i]["[КТО ПРИНЯЛ (СКЛАД)"];
dgvmonitor.Rows[i].Cells[15].Value = mydatatabel.Rows[i]["КОМУ ПЕРЕДАНО (СКЛАД)"];
}
}
kullandigim sqlbaglanti sinifida su sekilde
public static string veriyolu = "data source=192.168.0.*;initial catalog=SIP2012;user id=sa;password=1******";
public static DataTable verigetir(string cumle, out int recount)
{
recount = 0;
DataTable dt = null;
using (SqlConnection baglanti = new SqlConnection(veriyolu))
{
SqlCommand komut = baglanti.CreateCommand();
komut.CommandText = cumle;
komut.CommandType = System.Data.CommandType.Text;
try
{
baglanti.Open();
SqlDataReader dr = komut.ExecuteReader();
dt = new DataTable("cumle");
dt.Load(dr);
if (dt != null)
{
recount = dt.Rows.Count;
}
}
catch (Exception ex)
{
MessageBox.Show("VERI TABANI HATASI" + ex.Message, "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (baglanti.State == ConnectionState.Open)
{
baglanti.Close();
}
}
}
return dt;
}
public static DataTable verigetir(string cumle, SqlParameter[] param, out int recount)
{
recount = 0;
DataTable dt = null;
using (SqlConnection baglanti = new SqlConnection(veriyolu))
{
SqlCommand komut = baglanti.CreateCommand();
komut.CommandText = cumle;
komut.Parameters.AddRange(param);
komut.CommandType = System.Data.CommandType.Text;
try
{
baglanti.Open();
SqlDataReader dr = komut.ExecuteReader();
dt = new DataTable("cumle");
dt.Load(dr);
if (dt != null)
{
recount = dt.Rows.Count;
}
}
catch (Exception ex)
{
MessageBox.Show("VERI TABANI HATASI" + ex.Message, "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (baglanti.State == ConnectionState.Open)
{
baglanti.Close();
}
}
}
return dt;
}
bu sorunu viewle nasil cozerim tam anlayamadim...aciklarsaniz cok sevinirim...