/// <summary> /// Setting init when load page /// </summary> private void Initialize(int ID) { var company = TransportCompanyController.GetAllTransportCompanyByID(ID); if (company == null) { PJUtils.ShowMessageBoxSwAlertError("Không tìm thấy nhà xe " + ID, "e", true, "/danh-sach-nha-xe", Page); } else { this.hdfID.Value = ID.ToString(); this.txtCompanyName.Text = company.CompanyName; this.txtCompanyPhone.Text = company.CompanyPhone; this.txtCompanyAddress.Text = company.CompanyAddress; this.txtNote.Text = company.Note; this.txtPrepay.Text = company.Prepay ? "Trả cước trước" : "Trả cước sau"; this.txtCOD.Text = company.COD ? "Có thu hộ" : "Không thu hộ"; ltrEditButton.Text = "<a href=\"/sua-thong-tin-nha-xe?id=" + ID.ToString() + "\" class=\"btn primary-btn fw-btn not-fullwidth\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i> Chỉnh sửa</a>"; var transprots = TransportCompanyController.GetAllReceivePlace(ID); pagingall(transprots); } }
/// <summary> /// Setting init when load page /// </summary> private void LoadData(int ID) { var company = TransportCompanyController.GetAllTransportCompanyByID(ID); if (company == null) { PJUtils.ShowMessageBoxSwAlertError("Không tìm thấy nhà xe " + ID, "e", true, "/danh-sach-nha-xe", Page); } else { this.hdfID.Value = ID.ToString(); this.txtCompanyName.Text = company.CompanyName; this.txtCompanyPhone.Text = company.CompanyPhone; this.txtCompanyAddress.Text = company.CompanyAddress; this.rdbPrepay.SelectedValue = company.Prepay ? "true" : "false"; this.rdbCOD.SelectedValue = company.COD ? "true" : "false"; this.pNote.Text = company.Note; } }
/// <summary> /// Setting init when load page /// </summary> /// <param name="ID"></param> private void Initialize(int ID) { string username = Request.Cookies["usernameLoginSystem"].Value; var acc = AccountController.GetByUsername(username); // Init value var transportCompany = TransportCompanyController.GetAllTransportCompanyByID(ID); if (transportCompany != null) { this.hdfID.Value = transportCompany.ID.ToString(); this.txtCompanyName.Text = transportCompany.CompanyName; this.txtCompanyPhone.Text = transportCompany.CompanyPhone; this.txtCompanyAddress.Text = transportCompany.CompanyAddress; if (transportCompany.Prepay == true) { this.rdbPrepay.SelectedValue = "true"; this.rdbPrepay.Enabled = false; if (acc.RoleID == 0) { this.rdbPrepay.Enabled = true; } } else { this.rdbPrepay.SelectedValue = "false"; } } else { Response.Redirect("/danh-sach-nha-xe"); } // Setting display this.txtShipTo.Focus(); }