예제 #1
0
 protected void ddlNhomLSP_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlNhomLSP.SelectedValue.Length != 0)
     {
         ddlLoaiSP.DataSource = ProductTypeBUS.SelectingAllProductTypeByGroup(int.Parse(ddlNhomLSP.SelectedValue));
         ddlLoaiSP.DataBind();
     }
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DropDownList1.DataSource = ProductTypeBUS.SelectingAllProductType();
         DropDownList1.DataBind();
     }
 }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int isLogIn;

            int.TryParse(Session["IsLogin"].ToString(), out isLogIn);
            if (isLogIn == 1)
            {
                string typeUser = Session["LoaiUser"].ToString();
                if (typeUser == "Manager")
                {
                    if (!IsPostBack)
                    {
                        //ddlLoaiSP.DataSource = ProductBUS.SelectingAllProduct();

                        ddlNhomLSP.DataSource = ProductTypeGroupBUS.SelectingAllProductTypeGroup();
                        ddlNhomLSP.DataBind();

                        if (ddlNhomLSP.SelectedValue.Length != 0)
                        {
                            ddlLoaiSP.DataSource = ProductTypeBUS.SelectingAllProductTypeByGroup(int.Parse(ddlNhomLSP.SelectedValue));
                            ddlLoaiSP.DataBind();
                        }

                        /*ddlLoaiSP.DataSource = ProductTypeBUS.SelectingAllProductType();
                         * ddlLoaiSP.DataBind();*/
                    }
                }
                else
                {
                    Response.Redirect("../Shared/Default.aspx");
                }
            }
            else
            {
                Response.Redirect("../Shared/Default.aspx");
            }
        }
예제 #4
0
 public ActionResult Producer()
 {
     return(View(ProductTypeBUS.ListProducer()));
 }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int isLogIn;

            int.TryParse(Session["IsLogin"].ToString(), out isLogIn);
            if (isLogIn == 1)
            {
                string typeUser = Session["LoaiUser"].ToString();
                if (typeUser == "Manager")
                {
                    #region hiển thị thông tin sản phẩm
                    if (!IsPostBack)
                    {
                        //lấy mã sản phẩm
                        string masp = Request.QueryString["masp"];
                        if (masp != "")
                        {
                            SAN_PHAM_DTO sp = ProductBUS.LayThongTinSanPhamTheoMaSP(masp);


                            lbMaSP.Text = sp.MaSanPham;
                            //xử lý mã loại sp
                            //lbMaLSP.Text=sp.MaLoaiSanPham.ToString();
                            LOAISP_DTO lsp = ProductTypeBUS.LayLoaiSanPhamTheoMaLoaiSP(sp.MaLoaiSanPham);
                            lbMaLSP.Text = lsp.TenLoaiSanPham;

                            lbTenSP.Text     = sp.TenSanPham;
                            txtareMota.Value = sp.MoTaSanPham;

                            //xử lý hình ảnh
                            ImageSP.ImageUrl = sp.HinhAnh;

                            txtChatLuong.Text    = sp.ChatLuong;
                            txtGiaBan.Text       = sp.Gia.ToString();
                            txtSoLuong.Text      = sp.SoLuong.ToString();
                            txtDonVi.Text        = sp.DonViTinh;
                            lbSoLuongConLai.Text = sp.SoLuongConLai.ToString();
                            lbNgayDangSP.Text    = sp.NgayDangSanPham.ToString("dd/MM/yyyy");
                            lbNgaySuaDoi.Text    = sp.NgaySuaDoi.ToString("dd/MM/yyyy");

                            //xử lý tình trạng
                            radiobtnTinhTrang.SelectedValue = sp.TinhTrangSanPham;
                            if (radiobtnTinhTrang.SelectedValue == "0")
                            {
                                radiobtnTinhTrang.Items[0].Enabled = true;
                            }
                            else
                            {
                                radiobtnTinhTrang.Items[1].Enabled = true;
                            }

                            //không hiển thị ngày xóa

                            txtSoNguoiMua.Text = sp.SoNguoiMua.ToString();
                        }
                    }
                    #endregion
                }
                else
                {
                    Response.Redirect("../Shared/Default.aspx");
                }
            }
            else
            {
                Response.Redirect("../Shared/Default.aspx");
            }
        }