private void button1_Click(object sender, EventArgs e)
        {
            PeopleService.PeopleServiceClient a = new PeopleService.PeopleServiceClient();

            if (NationalCode.Text == "" || LastName.Text == "" || Mobile.Text == "" || BirthCity.Text == "" || Password.Text == "" || PasswordAgain.Text == "" || sahm.Text == "")
            {
                MessageBox.Show("لطفا همه فیلد ها را پر کنید");
            }
            else
            {
                if (Password.Text == PasswordAgain.Text)
                {
                    if (id == 0)
                    {
                        a.InsertPeople(NationalCode.Text, FirstName.Text, LastName.Text, FathersName.Text, Tel.Text, Mobile.Text, BirthCity.Text, PostalCode.Text, null, "Customer", DateTime.Now, Password.Text, decimal.Parse(sahm.Text));
                        MessageBox.Show("کاربر با موفقیت ثبت شد");
                        this.Close();
                    }
                    else if (id == 1)
                    {
                        a.UpdatePeople(NationalCode.Text, FirstName.Text, LastName.Text, FathersName.Text, Tel.Text, Mobile.Text, BirthCity.Text, PostalCode.Text, null, DateTime.Now, Password.Text, decimal.Parse(sahm.Text));
                        MessageBox.Show("با موفقیت ویرایش شد");
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("رمز ورود و تکرار رمز ورود یکسان نیست");
                }
            }
        }
Exemple #2
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();
                }
            }
        }
Exemple #3
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 button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == "" || textBox2.Text == "")
     {
         MessageBox.Show("همه فیلد ها باید پر شود");
     }
     else
     {
         if (textBox1.Text == textBox2.Text)
         {
             Form1 f = new Form1();
             f.Username.Text     = Data.NationalCode;
             f.Username.ReadOnly = true;
             if (f.ShowDialog() == DialogResult.OK)
             {
                 PeopleService.PeopleServiceClient a = new PeopleService.PeopleServiceClient();
                 a.ChangePass(Data.NationalCode, textBox1.Text);
                 MessageBox.Show("رمز با موفقیت تغییر کرد");
                 this.Close();
             }
         }
         else
         {
             MessageBox.Show("رمز ورود با تکرار رمز ورود یکسان نیست");
         }
     }
 }
Exemple #5
0
 public void button1_Click(object sender, EventArgs e)
 {
     if (Username.Text != "" || Password.Text != "")
     {
         PeopleService.PeopleServiceClient a = new PeopleService.PeopleServiceClient();
         var myLogin = a.Login(Username.Text, Password.Text);
         if (myLogin.Success)
         {
             if (myLogin.Role == "Admin")
             {
                 Data.IsAdmin = true;
                 this.Hide();
                 DialogResult = DialogResult.OK;
                 if (!Username.ReadOnly)
                 {
                     Data.NationalCode = Username.Text;
                     AdminHome f = new AdminHome();
                     f.ShowDialog();
                 }
                 this.Close();
             }
         }
         else
         {
             MessageBox.Show("کاربری با این مشخصات وجود ندراد و یا حساب مسدود است");
         }
     }
     else
     {
         MessageBox.Show("لطفا همه فیلد ها رو پر کنید");
     }
 }
        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;
            }
        }
Exemple #7
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;
        }
Exemple #8
0
        private void label14_Click(object sender, EventArgs e)
        {
            ReceivedLoan f = new ReceivedLoan();

            f.NationalCode = dataGridView1.SelectedRows[0].Cells["NatinalCode"].Value.ToString();
            f.ShowDialog();
            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();
        }
Exemple #9
0
        private void label9_Click(object sender, EventArgs e)
        {
            AdminCustomerAE f = new AdminCustomerAE();

            f.id = 0;//add
            f.ShowDialog();
            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();
        }
Exemple #10
0
        private void label10_Click(object sender, EventArgs e)
        {
            AdminCustomerAE f = new AdminCustomerAE();

            f.id          = 1;//edit
            f.NatinalCode = dataGridView1.SelectedRows[0].Cells["NatinalCode"].Value.ToString();
            f.ShowDialog();
            a = new PeopleService.PeopleServiceClient();
            var c = a.GetPeople().Select(x => new { x.NationalCode, x.FirstName, x.LastName, x.FathersName, x.Tel, x.Mobile, x.IsActive }).ToList();

            dataGridView1.DataSource = c;
        }
Exemple #11
0
 private void button2_Click(object sender, EventArgs e)
 {
     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();
 }
Exemple #12
0
 private void button1_Click(object sender, EventArgs e)
 {
     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 }).Where(x => x.FirstName.Contains(FirstName.Text) && x.LastName.Contains(LastName.Text) && x.NationalCode.Contains(NationalCode.Text) /*&& x.BirthCity=BirthDate.Value*/).ToList();
 }