public DetailsPage(Mode mode) { InitializeComponent(); // setAreaCodeToComboBox(); this.mode = mode; if (mode.Equals(Mode.EDIT)) { if (Session.SelectedCustomer != null) { _customer = Session.SelectedCustomer; GridCustomerInfo.DataContext = _customer; } } if (mode.Equals(Mode.VIEW)) { List<Control> ControlList = HandleControllers.GetLogicalChildCollection<Control>(this); HandleControllers.enableContent(ControlList, false, false, false, false, false); CustomerPage.ViewMode = Mode.VIEW; if (Session.SelectedCustomer != null) { _customer = Session.SelectedCustomer; GridCustomerInfo.DataContext = _customer; } } if (mode.Equals(Mode.NEW)) { this.mode = mode; _customer = new customer(); GridCustomerInfo.DataContext = _customer; } this.DataContext = this; _instance = this; }
public void SetCustomerDetails(customer _customer) { try { GridCustomerInfo.DataContext = _customer; AreaCodeComboBox.SelectedItem = AreaService.GetAreaByID(_customer.FK_AREA_ID); CusCodeTextBox.Text = _customer.CUSTOMER_ID.ToString(); CusFNameTextBox.Text=_customer.FIRST_NAME; CusLNameTextBox.Text=_customer.LAST_NAME; IDTypeComboBox.SelectedIndex = setID_Type(_customer.ID_TYPE); CusIDTextBox.Text=_customer.ID_NUM; CusBirthDayPicker.SelectedDate = _customer.DOB; setGender(_customer.GENDER); CusAddressTextBox.Text=_customer.ADDRESS; CusMobile1TextBox.Text=_customer.PHONE_HP1; CusMobile2TextBox.Text=_customer.PHONE_HP2; CusResidencePhoneTextBox.Text=_customer.PHONE_RECIDENCE; CusReligionTextBox.Text =_customer.RELIGION; CusCivilStatus.Text=_customer.CIVIL_STATUS; CusNationalityTextBox.Text=_customer.NATIONALITY ; _customer.ISACTIVE = true; _customer.STATUS = true; _customer.INSERT_DATETIME = DateTime.Now; _customer.INSERT_USER_ID = Session.LoggedEmployee.ID; _customer.UPDATE_DATETIME = DateTime.Now; _customer.UPDATE_USER_ID = Session.LoggedEmployee.ID; this.UpdateLayout(); } catch (Exception e) { MessageBox.Show(e.Message); } }
public void clearDetailsPage() { if (mode.Equals(Mode.NEW)) { _customer = new customer(); GridCustomerInfo.DataContext = _customer; } else if (mode.Equals(Mode.EDIT)) { _customer = CustomerService.RefreshCustomerByID(Session.SelectedCustomer); GridCustomerInfo.DataContext = new customer(); GridCustomerInfo.DataContext = _customer; } else if (mode.Equals(Mode.VIEW)) { _customer = CustomerService.RefreshCustomerByID(Session.SelectedCustomer); GridCustomerInfo.DataContext = _customer; } }
private void clearData() { _selectedCustomer = null; _selectedEmployee = null; _selectedLoanType = null; _selectedLoan = null; }