private void show_previous_lot() { List <object[]> dtlot = new List <object[]>(); MainMenu flot = new MainMenu(); dtlot = flot.get_data_table_string_exclude_id_desc("tbreceiving", "tbretouchingdetails", "intlotcode"); if (dtlot.Count > 0) { dataGridView1.Rows.Clear(); dataGridView1.Rows.Add(dtlot.Count); for (int i = 0; i < dtlot.Count; i++) { cbexistinglot.Items.Add(dtlot[i][1]); dataGridView1.Rows[i].Height = 50; dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString(); dataGridView1.Rows[i].Cells[1].Value = dtlot[i][5].ToString(); DateTime dt = DateTime.Parse(dtlot[i][4].ToString()); dataGridView1.Rows[i].Cells[2].Value = dt.ToString("yyyy-MM-dd"); dataGridView1.Rows[i].Cells[3].Value = dtlot[i][1].ToString(); } } Select_columnbutton(); }
private void show_list_lot(String param, String status) { List <object[]> dtlot = new List <object[]>(); MainMenu flot = new MainMenu(); lblstatus.Text = status; if (param.Equals("CUTTING")) { if (status.Equals("new")) { dtlot = flot.get_data_table_string_exclude_id_desc("tbreceiving", "tbretouchingdetails", "intlotcode"); if (dtlot.Count > 0) { dataGridView1.Rows.Clear(); dataGridView1.Rows.Add(dtlot.Count); for (int i = 0; i < dtlot.Count; i++) { dataGridView1.Rows[i].Height = 50; dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString(); dataGridView1.Rows[i].Cells[1].Value = dtlot[i][5].ToString(); DateTime dt = DateTime.Parse(dtlot[i][4].ToString()); dataGridView1.Rows[i].Cells[2].Value = dt.ToString("yyyy-MM-dd"); dataGridView1.Rows[i].Cells[3].Value = dtlot[i][1].ToString(); } Select_columnbutton(); } } else if (status.Equals("existing")) { dtlot = get_data_cutting_existing(); if (dtlot.Count > 0) { dataGridView1.Rows.Clear(); dataGridView1.Rows.Add(dtlot.Count); for (int i = 0; i < dtlot.Count; i++) { dataGridView1.Rows[i].Height = 50; dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString(); dataGridView1.Rows[i].Cells[1].Value = dtlot[i][0].ToString(); DateTime dt = DateTime.Parse(dtlot[i][1].ToString()); dataGridView1.Rows[i].Cells[2].Value = dt.ToString("yyyy-MM-dd"); dataGridView1.Rows[i].Cells[3].Value = dtlot[i][2].ToString(); } Select_columnbutton(); } } } else if (param.Equals("RETOUCHING")) { if (status.Equals("new")) { dtlot = get_data_cutting_existing(); if (dtlot.Count > 0) { dataGridView1.Rows.Clear(); dataGridView1.Rows.Add(dtlot.Count); for (int i = 0; i < dtlot.Count; i++) { dataGridView1.Rows[i].Height = 50; dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString(); dataGridView1.Rows[i].Cells[1].Value = dtlot[i][0].ToString(); DateTime dt = DateTime.Parse(dtlot[i][1].ToString()); dataGridView1.Rows[i].Cells[2].Value = dt.ToString("yyyy-MM-dd"); dataGridView1.Rows[i].Cells[3].Value = dtlot[i][2].ToString(); } Select_columnbutton(); } } else if (status.Equals("existing")) { dtlot = get_data_retouching_existing(12); if (dtlot.Count > 0) { dataGridView1.Rows.Clear(); dataGridView1.Rows.Add(dtlot.Count); for (int i = 0; i < dtlot.Count; i++) { dataGridView1.Rows[i].Height = 50; dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString(); dataGridView1.Rows[i].Cells[1].Value = dtlot[i][0].ToString(); DateTime dt = DateTime.Parse(dtlot[i][1].ToString()); dataGridView1.Rows[i].Cells[2].Value = dt.ToString("yyyy-MM-dd"); dataGridView1.Rows[i].Cells[3].Value = dtlot[i][2].ToString(); } Select_columnbutton(); } } } }