private void btn_Purchase_Items_Click(object sender, EventArgs e) { Frm_Purchase_Items obj = new Frm_Purchase_Items(); obj.WindowState = FormWindowState.Maximized; obj.MdiParent = this; obj.StartPosition = FormStartPosition.CenterParent; obj.Show(); pnl_Customer_Sub_Panel.Hide(); }
private void btn_Purchase_Items_Click(object sender, EventArgs e) { Frm_Purchase_Items obj = new Frm_Purchase_Items(); obj.MdiParent = this; // obj.WindowState = FormWindowState.Maximized; obj.ControlBox = false; obj.Show(); Hide_Sub_Panels(); }
private void btn_Add_Click(object sender, EventArgs e) { Connection_Open(); if (tb_ID.Text != "" && tb_Name.Text != "" && tb_Mobile_Number.Text != "" && tb_Address.Text != "" && tb_PAN_No.Text != "") { SqlCommand cmd = new SqlCommand("insert into Customer_Details values(" + tb_ID.Text + ",'" + tb_Name.Text + "'," + tb_Mobile_Number.Text + ",'" + tb_Address.Text + "','" + dtp_Date.Text + "','" + tb_PAN_No.Text + "')", Con); cmd.ExecuteNonQuery(); // var Result = MessageBox.Show("Customer Added Successfully !!!", "SAVE SUCCESS", MessageBoxButtons.OK, MessageBoxIcon.Information); string message = "Customer Added Successfully !!!"; string title = "SAVE SUCCESS"; MessageBoxButtons buttons = MessageBoxButtons.OK; DialogResult result = MessageBox.Show(message, title, buttons); if (result == DialogResult.OK) { DialogResult output = MessageBox.Show("Customer Wants To Purchase The Items !!!", "PURCHASE OR NOT ", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (output == DialogResult.Yes) { this.Hide(); Frm_Purchase_Items obj = new Frm_Purchase_Items(); obj.WindowState = FormWindowState.Maximized; obj.MdiParent = Frm_Purchase_Items.ActiveForm; obj.StartPosition = FormStartPosition.CenterParent; obj.Show(); } else { MessageBox.Show("Customer Only Saved !!!!", "SAVED", MessageBoxButtons.OK); } } tb_ID.Text = Convert.ToString(Auto_Incr()); tb_Name.Clear(); tb_Mobile_Number.Text = ""; tb_Address.Clear(); tb_PAN_No.Clear(); } else { MessageBox.Show("First Fill All Records !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } Connection_Close(); }