Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int        id = Convert.ToInt32(Request.QueryString["id"]);
         danhmucBLL bs = new danhmucBLL();
         if (Request.QueryString["id"] != null)
         {
             List <danhmucDAL> ds = bs.getDanhMucbyId(id);
             if (ds.Count == 1)
             {
                 txtTen.Text = ds[0].ten_danhmuc;
             }
             else
             {
                 Response.Redirect("error.aspx");
             }
         }
         else
         {
             Response.Redirect("error.aspx");
         }
         ddlDM.DataSource     = bs.getDanhMuclv(1);
         ddlDM.DataValueField = "groupdanhmuc";
         ddlDM.DataTextField  = "ten_danhmuc";
         ddlDM.DataBind();
         List <danhmucDAL> list = bs.getDanhMucbyId(id);
         ddlDM.SelectedValue = Convert.ToString(list[0].groupdanhmuc - 0.1);
     }
 }
Пример #2
0
    //
    // lay ten danh muc

    private void getTitle()
    {
        danhmucBLL        bs = new danhmucBLL();
        List <danhmucDAL> ds = bs.getDanhMucbyId(id);

        if (ds.Count() == 1)
        {
            lbDanhMuc.Text = ds[0].ten_danhmuc;
            ltite.Text     = ds[0].ten_danhmuc;
            lbtitle.Text   = ds[0].ten_danhmuc;
        }
        else
        {
            Response.Redirect("error.aspx");
        }
    }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != null)
         {
             int               id = Convert.ToInt32(Request.QueryString["id"]);
             danhmucBLL        bs = new danhmucBLL();
             List <danhmucDAL> ds = bs.getDanhMucbyId(id);
             if (ds.Count == 1)
             {
                 txtTen.Text = ds[0].ten_danhmuc;
             }
             else
             {
                 Response.Redirect("error.aspx");
             }
         }
         else
         {
             Response.Redirect("error.aspx");
         }
     }
 }