Example #1
0
        public DAL.DICH_VU DichVuDetail_GetItem([QueryString("MaDV")] int id)
        {
            DICH_VU dv = new DICH_VU();

            dv = dvDAL.GetDVByMa(id);
            return(dv);
        }
        public void loadDV()
        {
            List <LOAI_DICHVU> listdv = loaidv.GetList();

            ListItem[] items = new ListItem[listdv.Count()];
            int        i     = 0;

            foreach (LOAI_DICHVU fv in listdv)
            {
                items[i] = new ListItem(fv.TEN_LOAI, fv.MAlLOAI.ToString());
                i++;
            }

            DropDownList1.Items.AddRange(items);
            DropDownList1.DataBind();


            var     idSP = Request.QueryString["MaDV"];
            DICH_VU dv   = dvdal.GetDVByMa(Int32.Parse(idSP));



            if (dv == null)
            {
                string strBuilder = "<script language='javascript'>alert('loi load du lieu')</script>";
                Response.Write(strBuilder);
            }
            else
            {
                txt_tenDV1.Text   = dv.TEN_DICH_VU.ToString();
                txt_image1.Text   = dv.IMAGE;
                txt_gia1.Text     = dv.GIA.ToString();
                txt_soluong1.Text = dv.SOLUONG_DUNG.ToString();
                if (dv.CHI_TIET == null)
                {
                }
                else
                {
                    txt_ChiTiet1.Text = dv.CHI_TIET.ToString();
                }
            }
        }