Esempio n. 1
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frm_Find_Return f = new frm_Find_Return();

            f.Show();
        }
Esempio n. 2
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (cbo_Created_By.Text == "" || cbo_Store.Text == "")
                {
                    MessageBox.Show("you should complete all fields ");
                }
                else
                {
                    if (existss != "*")
                    {
                        MessageBox.Show("invalid sales invoice no ");
                    }
                    else if (existss == "*")
                    {
                        if (edit_or_add == "add")
                        {
                            insert_Returns_And_Its_Items();
                            frm_Find_Return f = new frm_Find_Return();
                            f.Show();
                            this.Close();
                        }
                        else if (edit_or_add == "edit")
                        {
                            try
                            {
                                update_Returns_Without_Its_Items();

                                // first delete return details (items)
                                Delete_all_Return_Items();
                                //then insertohm mn 2wel w gdeed
                                Insert_fromDGV_toDB();
                                MessageBox.Show("Edited");
                                gbo_Add_Itm.Enabled    = false;
                                btn_Load_items.Enabled = true;
                                txt_Inv_No.Text        = "";
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.Message);
                            }
                        }
                    }
                }
            }

            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }



            //foreach (DataGridViewRow item in dgv_Itm_Returned.Rows)
            //{
            //    string sql = "Insert Into Add_Returns_Details values( " + txt_Return_no.ToString() + " , " + item.Cells[0].ToString() + " , " + item.Cells[6].ToString() + ")";
            //    SqlCommand Cmd = new SqlCommand(sql, Conn);
            //    if (Conn.State != ConnectionState.Open)
            //        Conn.Open();
            //    Cmd.ExecuteNonQuery();
            //    Conn.Close();
            //}
        }
Esempio n. 3
0
        private void button9_Click(object sender, EventArgs e)
        {
            frm_Find_Return f = new frm_Find_Return();

            f.Show();
        }