Пример #1
0
        protected void LoadInfo(int Key)
        {
            Pollution_Info info = new Pollution_Info(Key);

            txtPollutionName.Text = info.PollutionName;
            txtNotice.Text        = info.Notice;
        }
Пример #2
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("CA0005");
            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());
                    Pollution_Info info = new Pollution_Info(mKey);
                    info.Delete();
                    DataTable nTable = Pollution_Data.GetList(nPageSize, nPageNumber, txtSearch.Text);
                    GV_Pollution.DataSource = nTable;
                    GV_Pollution.DataBind();
                    LoadPages();
                }
                catch
                {
                    Response.Write("<script >alert('Có lỗi gì đó vui lòng thử lại!')</script>");
                }
            }
        }
Пример #3
0
        protected void SaveInfo()
        {
            Pollution_Info info = new Pollution_Info(int.Parse(txtKey.Text));

            info.PollutionName = txtPollutionName.Text;
            info.Notice        = txtNotice.Text;
            info.Save();
        }