Ejemplo n.º 1
0
        private void Search_Click(object sender, EventArgs e)
        {
            KreationService.Accounts acc = null;
            try
            {
                acc      = new KreationService.Accounts();
                acc.TrNo = TrNoSr.Text;

                DataSet   set   = new DataSet();
                DataTable table = new DataTable();

                set = client.accDetail(acc);

                table = set.Tables[0];



                TrNo.Text   = table.Rows[0][0].ToString();
                Desc.Text   = table.Rows[0][1].ToString();
                Type.Text   = table.Rows[0][2].ToString();
                Amount.Text = table.Rows[0][3] + table.Rows[0][4].ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void Submit_Click(object sender, EventArgs e)
        {
            try
            {
                KreationService.Accounts acc = null;

                acc = new KreationService.Accounts();


                if
                (Type.SelectedItem.Equals("Debit"))
                {
                    acc.Debit = Amount.Text;
                }

                else if (Type.SelectedItem.Equals("Credit"))
                {
                    acc.Credit = Amount.Text;
                }


                acc.BranchId    = "Wattala";
                acc.TrNo        = TrNo.Text;
                acc.Description = Desc.Text;

                int q = client.up_Acc(acc);
                if (q > 0)
                {
                    MetroMessageBox.Show(this, "Transaction Complete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    MetroMessageBox.Show(this, "Transaction Incomplete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            email();
        }
Ejemplo n.º 3
0
        private void Submit_Click(object sender, EventArgs e)
        {
            KreationService.Accounts acc = null;
            try
            {
                acc = new KreationService.Accounts();

                if
                (Type.SelectedItem.Equals("Debit"))
                {
                    acc.Debit = Amount.Text;
                }

                else if (Type.SelectedItem.Equals("Credit"))
                {
                    acc.Credit = Amount.Text;
                }

                acc.TrNo        = TrNo.Text;
                acc.Description = Desc.Text;
                //acc.Debit = null;
                //acc.Credit = null;

                int q = client.ed_acc(acc);
                if (q > 0)
                {
                    MetroMessageBox.Show(this, "Transaction Complete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    MetroMessageBox.Show(this, "Adding Incomplete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            try
            {
                SmtpClient Client = new SmtpClient("smtp.gmail.com");
                Client.Port                  = 587;
                Client.EnableSsl             = true;
                Client.Timeout               = 100000;
                Client.DeliveryMethod        = SmtpDeliveryMethod.Network;
                Client.UseDefaultCredentials = false;
                Client.Credentials           = new NetworkCredential(
                    "*****@*****.**", "sai19198");
                MailMessage msg = new MailMessage();
                msg.To.Add("*****@*****.**");
                msg.CC.Add("*****@*****.**");
                msg.CC.Add("*****@*****.**");
                msg.From    = new MailAddress("*****@*****.**");
                msg.Subject = "Record";
                msg.Body    = "Reacord Have Been Amended in the Bambalapitya Branch";

                Client.Send(msg);
                MetroMessageBox.Show(this, "Email Sent", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }