Exemplo n.º 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("CA0004");
            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());
                    Environment_Info info = new Environment_Info(mKey);
                    info.Delete();
                    DataTable nTable = Environments_Data.GetList(nPageSize, nPageNumber, txtSearch.Text);
                    GV_Environments.DataSource = nTable;
                    GV_Environments.DataBind();
                }
                catch
                {
                    Response.Write("<script >alert('Có lỗi gì đó vui lòng thử lại!')</script>");
                }
            }
        }
Exemplo n.º 2
0
        protected void LoadInfo(int Key)
        {
            Environment_Info info = new Environment_Info(Key);

            txtEnvironmentsName.Text = info.EnvironmentsName;
            txtNotice.Text           = info.Notice;
        }
Exemplo n.º 3
0
        protected void SaveInfo()
        {
            Environment_Info info = new Environment_Info(int.Parse(txtKey.Text));

            info.EnvironmentsName = txtEnvironmentsName.Text;
            info.Notice           = txtNotice.Text;
            info.Save();
        }