protected void imbEdit_Click(object sender, ImageClickEventArgs e) { try { var branch = BranchBiz.GetBranch(((ImageButton)sender).CommandArgument); if (branch != null) { cbEdit.Checked = true; txtBranchCodePopup.Text = branch.BranchCode; txtBranchCodePopup.Enabled = false; txtBranchNamePopup.Text = branch.BranchName; cmbChannelPopup.SelectedIndex = cmbChannelPopup.Items.IndexOf(cmbChannelPopup.Items.FindByValue(branch.ChannelId)); txtWorkStartHourPopup.Text = branch.StartTimeHour; txtWorkStartMinPopup.Text = branch.StartTimeMinute; txtWorkEndHourPopup.Text = branch.EndTimeHour; txtWorkEndMinPopup.Text = branch.EndTimeMinute; rbActive.Checked = branch.Status == "Y" ? true : false; rbInActive.Checked = branch.Status == "Y" ? false : true; upPopup.Update(); mpePopup.Show(); } else { throw new Exception("ไม่พบรหัสสาขา " + ((ImageButton)sender).CommandArgument + " ในระบบ"); } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Debug(message); AppUtil.ClientAlert(Page, message); } }
private void SetDAddress() { var brn = BranchBiz.GetBranch(cmbDocBranch.SelectedValue); bool enb = (brn == null); if (brn == null) { brn = new BranchData(); } txtDAddressno.Text = brn.slm_House_No; txtDBuilding.Text = brn.slm_Building; txtDFloor.Text = brn.slm_Village; txtDSoi.Text = brn.slm_Soi; txtDStreet.Text = brn.slm_Street; AppUtil.SetComboValue(cmbDProvince, brn.slm_ProvinceId.ToString()); SetDAmphur(); AppUtil.SetComboValue(cmbDAmphur, brn.slm_AmphurId.ToString()); SetDTambol(); AppUtil.SetComboValue(cmbDTambol, brn.slm_TambolId.ToString()); txtDPostCode.Text = brn.slm_Zipcode; txtDAddressno.ReadOnly = !enb; txtDBuilding.ReadOnly = !enb; txtDFloor.ReadOnly = !enb; txtDSoi.ReadOnly = !enb; txtDStreet.ReadOnly = !enb; cmbDProvince.Enabled = enb; cmbDAmphur.Enabled = enb; cmbDTambol.Enabled = enb; txtDPostCode.ReadOnly = !enb; }