Beispiel #1
0
        private void btnGenrateInvoice_Click(object sender, EventArgs e)
        {
            DataTable PurchaseChallan = new DataTable();

            foreach (DataGridViewColumn col in dgvSaleChallan.Columns)
            {
                PurchaseChallan.Columns.Add(col.Name);
            }

            for (int i = 0; i < dgvSaleChallan.Rows.Count; i++)
            {
                DataRow dRow = PurchaseChallan.NewRow();
                if (Convert.ToBoolean(dgvSaleChallan.Rows[i].Cells[5].Value) == true)
                {
                    dRow[0] = dgvSaleChallan.Rows[i].Cells[0].Value;
                    dRow[1] = dgvSaleChallan.Rows[i].Cells[1].Value;
                    dRow[2] = dgvSaleChallan.Rows[i].Cells[2].Value;
                    dRow[3] = dgvSaleChallan.Rows[i].Cells[3].Value;
                    dRow[4] = dgvSaleChallan.Rows[i].Cells[4].Value;
                    dRow[5] = dgvSaleChallan.Rows[i].Cells[5].Value;
                    PurchaseChallan.Rows.Add(dRow);
                }
            }

            // instance the event args and pass it each value
            IdentityUpdateEventArgs args = new IdentityUpdateEventArgs(PurchaseChallan);

            // raise the event with the updated arguments
            IdentityUpdated(this, args);
            this.Dispose();
        }
        private void btnOkay_Click(object sender, EventArgs e)
        {
            employee user          = ctr.getUser(GV.UserId);
            string   sNewPhone     = PhoneTextBox.Text;
            string   sNewQA        = QAtextBox.Text;
            string   sNewDOB       = DOBtextBox.Text;
            string   sNewAdd       = AddTextBox.Text;
            string   sNewPasswd    = PwdTextBox.Text;
            string   sNewConPasswd = conPwdTextBox.Text;


            if (sNewPhone.Length < 1 || sNewQA.Length < 1 || sNewDOB.Length < 1 || sNewAdd.Length < 1 ||
                sNewPasswd.Length < 6 || sNewPasswd != sNewConPasswd)
            {
                MessageBox.Show("Data is incomplete.", "Error", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
            else
            {
                ctr.updateUserInfo(GV.UserId, sNewDOB, sNewQA, sNewAdd, sNewPasswd);
                IdentityUpdateEventArgs args = new IdentityUpdateEventArgs(sNewDOB, sNewAdd, sNewQA);
                IdentityUpdated(this, args);
                this.Dispose();
            }
        }
Beispiel #3
0
        private void btnGenrateInvoice_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable saleChallan = new DataTable();
                foreach (DataGridViewColumn col in dgvSaleChallan.Columns)
                {
                    saleChallan.Columns.Add(col.Name);
                }
                if (cmbCustomerName.Text == string.Empty)
                {
                    if (Utility.Langn == "English")
                    {
                        MessageBox.Show("Please select customer name", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MessageBox.Show("कृपया ग्राहकाचे नाव निवडा.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    cmbCustomerName.Focus();
                    return;
                }
                for (int i = 0; i < dgvSaleChallan.Rows.Count; i++)
                {
                    DataRow dRow = saleChallan.NewRow();
                    if (Convert.ToBoolean(dgvSaleChallan.Rows[i].Cells["isConvert"].Value) == true)
                    {
                        dRow[0] = dgvSaleChallan.Rows[i].Cells[0].Value;
                        dRow[1] = dgvSaleChallan.Rows[i].Cells[1].Value;
                        dRow[2] = dgvSaleChallan.Rows[i].Cells[2].Value;
                        dRow[3] = dgvSaleChallan.Rows[i].Cells[3].Value;
                        dRow[4] = dgvSaleChallan.Rows[i].Cells[4].Value;
                        dRow[5] = dgvSaleChallan.Rows[i].Cells[5].Value;
                        saleChallan.Rows.Add(dRow);
                    }
                }
                // instance the event args and pass it each value
                IdentityUpdateEventArgs args = new IdentityUpdateEventArgs(saleChallan);

                // raise the event with the updated arguments
                IdentityUpdated(this, args);
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }