private void dgv_viewWarty_CellClick(object sender, DataGridViewCellEventArgs e) { if (dgv_viewWarty.CurrentRow.Cells["Warranty_Complete"].Value.ToString() == "InComplete") { pnl_wtyDtail.Controls.Clear(); wty_dtail_inconplete incpte = new wty_dtail_inconplete(); incpte.TopLevel = false; incpte.Visible = true; pnl_wtyDtail.Controls.Add(incpte); } else if (dgv_viewWarty.CurrentRow.Cells["Warranty_Complete"].Value.ToString() == "Complete") { pnl_wtyDtail.Controls.Clear(); wty_dtail_Conplete comte = new wty_dtail_Conplete(); comte.TopLevel = false; comte.Visible = true; pnl_wtyDtail.Controls.Add(comte); } else { } }
private void btn_save_Click(object sender, EventArgs e) { //int di = Warranty_Details.dgvw.CurrentRow.Index; if (cbx_wrycond.Text == "Item Rapaired") { wrty.updt_waty(Warranty_Details.dgvw.CurrentRow.Cells["Warranty_No"].Value.ToString(), cbx_wrycond.Text, "Complete"); //MessageBox.Show("Updte"); wrty.update_item_status(Warranty_Details.dgvw.CurrentRow.Cells["Invoice_No"].Value.ToString(), Warranty_Details.dgvw.CurrentRow.Cells["Item_No"].Value.ToString(), "Ok"); // MessageBox.Show("update oled invo"); if (MessageBox.Show("Warranty Completed ", "Sharp Creation", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK) { ds = wrty.allWarty(); Warranty_Details.dgvw.DataSource = ds.Tables["tbl_Warranty"]; Warranty_Details.ppw.Controls.Clear(); wty_dtail_Conplete comte = new wty_dtail_Conplete(); comte.TopLevel = false; comte.Visible = true; Warranty_Details.ppw.Controls.Add(comte); } } else if (cbx_wrycond.Text == "Another Item") { if (anorItm == true) { wrty.updt_waty(Warranty_Details.dgvw.CurrentRow.Cells["Warranty_No"].Value.ToString(), cbx_wrycond.Text, "Complete"); // MessageBox.Show("Updte"); if (MessageBox.Show("Warranty Completed ", "Sharp Creation", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK) { ds = wrty.allWarty(); Warranty_Details.dgvw.DataSource = ds.Tables["tbl_Warranty"]; Warranty_Details.ppw.Controls.Clear(); wty_dtail_Conplete comte = new wty_dtail_Conplete(); comte.TopLevel = false; comte.Visible = true; Warranty_Details.ppw.Controls.Add(comte); } } else { cbx_wrycond.SelectedItem = null; toolTip_selet.Show("Enter item details \nThat is use to Complete this warranty", cbx_wrycond, 2500); errorProvider_selet.SetError(cbx_wrycond, "Enter item details \nThat is use to Complete this warranty"); } } else if (cbx_wrycond.Text == "New Item") { if (newItm == true) { wrty.updt_waty(Warranty_Details.dgvw.CurrentRow.Cells["Warranty_No"].Value.ToString(), cbx_wrycond.Text, "Complete"); //MessageBox.Show("Updte"); if (MessageBox.Show("Warranty Completed ", "Sharp Creation", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK) { ds = wrty.allWarty(); Warranty_Details.dgvw.DataSource = ds.Tables["tbl_Warranty"]; Warranty_Details.ppw.Controls.Clear(); wty_dtail_Conplete comte = new wty_dtail_Conplete(); comte.TopLevel = false; comte.Visible = true; Warranty_Details.ppw.Controls.Add(comte); } } else { cbx_wrycond.SelectedItem = null; toolTip_selet.Show("Enter item details from stock \nThat is use to Complete this warranty", cbx_wrycond, 2500); errorProvider_selet.SetError(cbx_wrycond, "Enter item details from stock \nThat is use to Complete this warranty"); } } bt_save = false; }