Example #1
0
        protected void GrDelete(object sender, CommandEventArgs e)
        {
            int nPageNumber             = int.Parse(txtPageNumber.Text);
            int nPageSize               = int.Parse(txtPageSize.Text);
            SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"];

            nUserLogin.CheckRole("CA0010");
            if (!nUserLogin.Role.Del)
            {
                Response.Write("<script >alert('Bạn không có quyền xóa danh mục này!')</script>");
            }
            else
            {
                try
                {
                    int mKey = int.Parse(e.CommandArgument.ToString());
                    CertifiedOrganization_Info info = new CertifiedOrganization_Info(mKey);
                    info.Delete();
                    DataTable nTable = CertifiedOrganization_Data.GetList(nPageSize, nPageNumber, txtSearch.Text);
                    GV_CertifiedOrganization.DataSource = nTable;
                    GV_CertifiedOrganization.DataBind();
                    LoadPages();
                }
                catch
                {
                    Response.Write("<script >alert('Có lỗi gì đó vui lòng thử lại!')</script>");
                }
            }
        }
Example #2
0
        private void LoadInfo(int key)
        {
            CertifiedOrganization_Info info = new CertifiedOrganization_Info(key);

            txtCertifiedOrganization_ID.Text   = info.CertifiedOrganization_ID;
            txtCertifiedOrganization_Name.Text = info.CertifiedOrganization_Name;
            DDLCategories.SelectedValue        = info.CertificationType_Key.ToString();
            txtAddress.Text             = info.Address;
            txtPhone.Text               = info.Phone;
            txtFax.Text                 = info.Fax;
            txtEmail.Text               = info.Email;
            txtWebsite.Text             = info.Website;
            txtInfrastructure.Text      = info.Infrastructure;
            txtExamination_Process.Text = info.Examination_Process;
        }
Example #3
0
        private void SaveInfo()
        {
            CertifiedOrganization_Info info = new CertifiedOrganization_Info(int.Parse(txtKey.Text));

            info.CertifiedOrganization_ID   = txtCertifiedOrganization_ID.Text;
            info.CertifiedOrganization_Name = txtCertifiedOrganization_Name.Text;
            info.CertificationType_Key      = int.Parse(DDLCategories.SelectedValue);
            info.Address             = txtAddress.Text;
            info.Phone               = txtPhone.Text;
            info.Fax                 = txtFax.Text;
            info.Email               = txtEmail.Text;
            info.Website             = txtWebsite.Text;
            info.Infrastructure      = txtInfrastructure.Text;
            info.Examination_Process = txtExamination_Process.Text;
            info.Save();
        }