private void button1_Click(object sender, EventArgs e)
        {
            string temp = textBox1.Text;

            for (int i = 0; i < customersNames.Length; i++)
            {
                if (customersNames[i].Equals(temp))
                {
                    selectedCname   = customersNames[i];
                    button2.Enabled = true;
                    break;
                }
            }
            button2.Visible = true;
            using (CustomerMgntRef.CustomerMgntClient client = new CustomerMgntRef.CustomerMgntClient())
            {
                customer = client.GetCustomer(selectedCname);
                cid      = customer.CustomerId;
            }
            textBox12.Text = customer.Gender;
            textBox2.Text  = customer.CustomerName;
            textBox16.Text = customer.CustomerType;
            textBox3.Text  = customer.AadharNo;
            textBox14.Text = customer.RashanCardNo;
            textBox13.Text = customer.Address;
            textBox4.Text  = customer.City;
            textBox15.Text = customer.PinNo.ToString();
            textBox5.Text  = customer.Taluka;
            textBox6.Text  = customer.District;
            textBox7.Text  = customer.State;
            textBox8.Text  = customer.ContactNo;
            textBox9.Text  = customer.Email;
            textBox10.Text = customer.BankIFSC;
            textBox11.Text = customer.BankAccountNo;
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string temp = textBox1.Text;

            for (int i = 0; i < customersNames.Length; i++)
            {
                if (customersNames[i].Equals(temp))
                {
                    selectedCname   = customersNames[i];
                    button2.Enabled = true;
                    break;
                }
            }
            if (selectedCname != null)
            {
                button2.Visible = true;
                using (CustomerMgntRef.CustomerMgntClient client = new CustomerMgntRef.CustomerMgntClient())
                {
                    customer = client.GetCustomer(selectedCname);
                    cid      = customer.CustomerId;
                }
                if (customer != null && customer.CustomerType.Equals("Industrial"))
                {
                    label2.Visible    = true;
                    textBox17.Visible = true;
                }
                textBox2.Text  = customer.CustomerName;
                textBox12.Text = customer.Gender;
                textBox16.Text = customer.CustomerType;
                textBox3.Text  = customer.AadharNo;
                textBox14.Text = customer.RashanCardNo;
                textBox13.Text = customer.Address;
                textBox4.Text  = customer.City;
                textBox15.Text = customer.PinNo.ToString();
                textBox5.Text  = customer.Taluka;
                textBox6.Text  = customer.District;
                textBox7.Text  = customer.State;
                textBox8.Text  = customer.ContactNo;
                textBox9.Text  = customer.Email;
                textBox10.Text = customer.BankIFSC;
                textBox11.Text = customer.BankAccountNo;
                TransactionMgnt.TransactionMgntClient client1 = new TransactionMgnt.TransactionMgntClient();
                List <TransactionMgnt.TxCylinder>     res     = client1.GetLastTxs(customer.CustomerId).ToList();
                dataGridView1.DataSource = res;
                if (res.FirstOrDefault().TxDate.ToShortDateString().Equals(DateTime.Now.ToShortDateString()))
                {
                    button2.Visible = false;
                }
            }
        }