protected void Page_Load(object sender, EventArgs e) { Button findButton = new Button(); findButton.ID = string.Format("btFind{0}", this.UniqueID); findButton.Text = "Tìm"; var panelSearchId = panelCustomerSearch.ClientID; findButton.Attributes.Add("onclick", "displayOrHidePanelSearch(" + panelSearchId + "); return false"); panelFind.Controls.Add(findButton); var displayOrHidePanelSearch = "<script type=\"text/javascript\">" + "\n" + "function displayOrHidePanelSearch(panelSearchId){" + "\n" + "var panelId = panelSearchId" + "\n" + "var displayStatus = $(panelId).css(\"display\")" + "\n" + "if (displayStatus == \"none\") {" + "\n" + " $(panelId).css(\"display\", \"block\");" + "\n" + "}" + "\n" + "else {" + "\n" + " $(panelId).css(\"display\", \"none\");" + "\n" + "}" + "\n" + "}" + "\n" + "</script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "displayOrHidePanelSearch", displayOrHidePanelSearch); if (!Page.IsPostBack) { CustomerTypeBO custType = this.CustomerService.GetCustomerTypeById(this.CustomerTypeId); lbCustomerIdHeader.Text = string.Format("Mã {0}", custType.Name); } }
private void BindData() { CustomerBO customer = this.CustomerService.GetCustomerById(this.CustomerId); if (customer != null) { lbCustomerIDTitle.Text = string.Format("Mã số {0} :", customer.CustomerType.Name); lbCustomerID.Text = customer.CustomerId.ToString(); lbCustomerNameTitle.Text = string.Format("Tên {0} :", customer.CustomerType.Name); txtCustomerName.Text = customer.Name; txtTelephone.Text = customer.Telephone; txtAddress.Text = customer.Address; ctrlEmailTextBox.Text = customer.Email; txtNote.Text = customer.Note; txtCompanyName.Text = customer.Company; txtPhoneNumber.Text = customer.PhoneNumber; txtFaxNumber.Text = customer.FaxNumber; txtTaxCode.Text = customer.TaxCode; } else { panelCustomerId.Visible = false; CustomerTypeBO custType = this.CustomerService.GetCustomerTypeById(this.CustomerTypeId); if (custType == null) { throw new Exception("Bạn hãy liên hệ với Admin"); } lbCustomerNameTitle.Text = string.Format("Tên {0} :", custType.Name); } }
private void BindData() { CustomerSelect custSelect = this.Parent.Parent.Parent.Parent as CustomerSelect; int customerTypeId = custSelect.CustomerTypeId; btAddNew.Attributes.Add("onclick", string.Format("OpenWindow('CustomerAdd.aspx?{0}={1}')", Constant.Customer.QUERY_STRING_CUSTOMER_TYPE, customerTypeId)); CustomerTypeBO custType = this.CustomerService.GetCustomerTypeById(customerTypeId); btAddNew.Value = string.Format("Thêm {0}", custType.Name); }
private void BindData() { CustomerTypeBO custType = this.CustomerService.GetCustomerTypeById(this.CustomerTypeId); lbCustomerEditHeader.Text = string.Format("Sửa {0} ", custType.Name); }
private void BindData() { CustomerTypeBO custType = this.CustomerService.GetCustomerTypeById(this.CustomerTypeId); lbCustomerAddHeader.Text = string.Format("Thêm {0} mới", custType.Name); }