Пример #1
0
        private void bEditInfo_Click(object sender, EventArgs e)
        {
            PersianDateFormatter pdf              = new PersianDateFormatter();
            CustomerRepository   repository       = new CustomerRepository();
            Customer             customer         = repository.getCustomer(customerId);
            EditCustomerForm     editCustomerForm = new EditCustomerForm(customer);
            var result = editCustomerForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                CustomerRepository cr = new CustomerRepository();
                customer          = cr.getCustomer(customerId);
                lName.Text        = customer.FirstName + " " + customer.LastName;
                lPhoneNumber.Text = "شماره تماس:" + "   " + customer.PhoneNumber;
                lCreatedDate.Text = "تاریخ ایجاد:" + "   " + pdf.convert(customer.CreatedDate.Value);
                if (String.IsNullOrWhiteSpace(customer.Description))
                {
                    lDescription.Text = "توضیحات:" + "   " + "-";
                }
                else
                {
                    lDescription.Text = "توضیحات:" + "   " + customer.Description;
                }
            }
        }
        private void bEditInfo_Click(object sender, EventArgs e)
        {
            PersianDateFormatter pdf = new PersianDateFormatter();
            CustomerRepository repository = new CustomerRepository();
            Customer customer = repository.getCustomer(customerId);
            EditCustomerForm editCustomerForm = new EditCustomerForm(customer);
            var result = editCustomerForm.ShowDialog();
            if (result == DialogResult.OK)
            {
                CustomerRepository cr = new CustomerRepository();
                customer = cr.getCustomer(customerId);
                lName.Text = customer.FirstName + " " + customer.LastName;
                lPhoneNumber.Text = "شماره تماس:" + "   " + customer.PhoneNumber;
                lCreatedDate.Text = "تاریخ ایجاد:" + "   " + pdf.convert(customer.CreatedDate.Value);
                if (String.IsNullOrWhiteSpace(customer.Description))
                {
                    lDescription.Text = "توضیحات:" + "   " + "-";
                }
                else
                {
                    lDescription.Text = "توضیحات:" + "   " + customer.Description;
                }

            }
        }