Ejemplo n.º 1
0
        private void label7_Click(object sender, EventArgs e)
        {
            PeopleService.PeopleServiceClient a = new PeopleService.PeopleServiceClient();
            bool t = a.GetPerson(dataGridView1.SelectedRows[0].Cells["NatinalCode"].Value.ToString()).IsActive;

            if (t)
            {
                if (MessageBox.Show("آیا از بستن حساب اطمینان دارید؟", "خطا", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    Status.StatusClient SC = new Status.StatusClient();
                    SC.SetActive(dataGridView1.SelectedRows[0].Cells["NatinalCode"].Value.ToString(), false);
                    a = new PeopleService.PeopleServiceClient();
                    dataGridView1.DataSource = a.GetPeople().Select(x => new { x.NationalCode, x.FirstName, x.LastName, x.FathersName, x.Tel, x.Mobile, x.IsActive }).ToList();
                }
            }
            else
            {
                if (MessageBox.Show("آیا از بازکردن حساب اطمینان دارید؟", "خطا", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    Status.StatusClient SC = new Status.StatusClient();
                    SC.SetActive(dataGridView1.SelectedRows[0].Cells["NatinalCode"].Value.ToString(), true);
                    a = new PeopleService.PeopleServiceClient();
                    dataGridView1.DataSource = a.GetPeople().Select(x => new { x.NationalCode, x.FirstName, x.LastName, x.FathersName, x.Tel, x.Mobile, x.IsActive }).ToList();
                }
            }
        }
Ejemplo n.º 2
0
        private void AdminHome_Load(object sender, EventArgs e)
        {
            InstallementsService.InstallementsServiceClient a = new InstallementsService.InstallementsServiceClient();
            dataGridView1.DataSource = a.GetPeopleInstallements().Select(x => new { x.InstallementId, x.Fullname, x.NationalCode, x.Amount, x.PaymentDate, x.InstallementIsPayed }).Where(x => x.InstallementIsPayed == false && x.PaymentDate <= System.DateTime.Now).ToList();

            LoanTransactionsService.LoanTransactionsServiceClient b = new LoanTransactionsService.LoanTransactionsServiceClient();
            dataGridView2.DataSource = b.GetPeopleLoanTransactions().Select(x => new { x.LoanId, x.Fullname, x.NationalCode, x.Amount, x.DateTime, x.AdminPermission }).Where(x => x.AdminPermission == false).ToList();

            DepositTransactionsService.DepositTransactionsServiceClient c = new DepositTransactionsService.DepositTransactionsServiceClient();
            dataGridView3.DataSource = c.GetPeopleDepositTransactions().Select(x => new { x.DepositId, x.Fullname, x.NationalCode, x.Amount, x.BankFollowUpCode, x.DateTime, x.AdminPermission }).Where(x => x.AdminPermission == false).ToList();

            Status.StatusClient d = new Status.StatusClient();
            var bank = d.GetPeopleBank();

            label15.Text = bank.Loan.ToString();
            label14.Text = bank.Deposit.ToString();
            label12.Text = bank.NonPayedInstallements.ToString();
            label13.Text = bank.PayedInstallements.ToString();
            label10.Text = bank.Amount.ToString();
            PeopleService.PeopleServiceClient j = new PeopleService.PeopleServiceClient();
            var q = j.GetPerson(Data.NationalCode);

            label4.Text = "نام : " + q.FirstName;
            label1.Text = "نام خانوادگی : " + q.LastName;
            label3.Text = "کد ملی : " + q.NationalCode;
            label5.Text = "تاریخ افتتاح " + q.CreateDateTime;
        }
        private void AdminCustomerAE_Load(object sender, EventArgs e)
        {
            if (id == 0)//add
            {
                label1.Text = "افزودن مشتری";
            }
            else if (id == 1)
            {
                label1.Text          = "ویرایش مشتری";
                NationalCode.Enabled = false;
                PeopleService.PeopleServiceClient a = new PeopleService.PeopleServiceClient();
                var b = a.GetPerson(NatinalCode);
                NationalCode.Text = b.NationalCode;
                FirstName.Text    = b.FirstName;
                LastName.Text     = b.LastName;
                FathersName.Text  = b.FathersName;
                BirthCity.Text    = b.BirthCity;
                // b.BirthDate
                // Address.Text = b.Address;
                PostalCode.Text = b.PostalCode;
                Tel.Text        = b.Tel;
                Mobile.Text     = b.Mobile;
                sahm.Text       = b.Contribution.ToString();
            }
            else if (id == 2)
            {
                label1.Text         = "مشاهده مشتری";
                FirstName.Enabled   = false;
                LastName.Enabled    = false;
                FathersName.Enabled = false;
                BirthCity.Enabled   = false;

                PostalCode.Enabled    = false;
                Tel.Enabled           = false;
                Mobile.Enabled        = false;
                Password.Enabled      = false;
                PasswordAgain.Enabled = false;
                button1.Enabled       = false;
                sahm.Enabled          = false;
                NationalCode.Enabled  = false;
                PeopleService.PeopleServiceClient a = new PeopleService.PeopleServiceClient();
                var b = a.GetPerson(NatinalCode);
                NationalCode.Text = b.NationalCode;
                FirstName.Text    = b.FirstName;
                LastName.Text     = b.LastName;
                FathersName.Text  = b.FathersName;
                BirthCity.Text    = b.BirthCity;
                // b.BirthDate
                // Address.Text = b.Address;
                PostalCode.Text       = b.PostalCode;
                Tel.Text              = b.Tel;
                sahm.Text             = b.Contribution.ToString();
                Mobile.Text           = b.Mobile;
                Password.Enabled      = false;
                PasswordAgain.Enabled = false;
            }
        }
Ejemplo n.º 4
0
        private void InsertLoan_Load(object sender, EventArgs e)
        {
            PeopleService.PeopleServiceClient a = new PeopleService.PeopleServiceClient();
            var b = a.GetPerson(NationalCode1);

            NationalCode.Text = NationalCode1;
            FirstName.Text    = b.FirstName;
            LastName.Text     = b.LastName;
        }