Пример #1
0
        private void PopulateItem(int _id)
        {
            T_QuangCao _objqc = new T_QuangCao();

            HPCBusinessLogic.DAL.QuangCaoDAL _QCDAL = new HPCBusinessLogic.DAL.QuangCaoDAL();
            _objqc = _QCDAL.GetOneFromT_QuangCaoByID(_id);
            txt_tenquangcao.Text       = _objqc.Ten_QuangCao;
            ckeNoidung.Text            = _objqc.Noidung;
            cboKhachhang.SelectedIndex = CommonLib.GetIndexControl(cboKhachhang, _objqc.Ma_KhachHang.ToString());
            cbokichthuoc.SelectedIndex = CommonLib.GetIndexControl(cbokichthuoc, _objqc.Kichthuoc.ToString());
            cboAnPham.SelectedIndex    = CommonLib.GetIndexControl(cboAnPham, _objqc.Ma_Loaibao.ToString());

            bintrang(int.Parse(cboAnPham.SelectedValue.ToString()));
            if (_objqc.Trang != 0)
            {
                string _sotrang = _objqc.Trang.ToString();
                cboTrang.SelectedIndex = int.Parse(_sotrang);
            }
            else
            {
                cboTrang.SelectedIndex = 0;
            }

            txtNgaybatdau.Text = _objqc.Ngaydang.ToString("dd/MM/yyyy");
            LoadDataImage();
            ListNgaydangQC();
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            id = int.Parse(Page.Request.QueryString["ID"].ToString());
            btncopycontent1.Attributes.Add("onclick", "javascript:getvalue_exports()");
            btncopycontent2.Attributes.Add("onclick", "javascript:getvalue_exports()");
            if (Page.Request.QueryString["Menu_ID"] != null)
            {
                if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"])))
                {
                    Response.Redirect("~/Errors/AccessDenied.aspx");
                }
                _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
                if (!IsPostBack)
                {
                    T_QuangCao obj = new T_QuangCao();
                    obj = _DalQC.GetOneFromT_QuangCaoByID(id);

                    Tenquangcao = obj.Ten_QuangCao.ToString();
                    Noidung     = obj.Noidung.ToString();
                    Kichthuoc   = UltilFunc.GetKichCoQuangCao(obj.Kichthuoc);
                    Loaibao     = UltilFunc.GetTenAnpham(obj.Ma_Loaibao);
                    Ngaydang    = obj.Ngaydang.ToString("dd/MM/yyyy");

                    if (obj.Trang > 0)
                    {
                        Sotrang = " Trang :" + obj.Trang.ToString();
                    }
                    else
                    {
                        Sotrang = "";
                    }

                    _MaNguoinhap = int.Parse(_ulti.GetColumnValuesDynamic("T_PhienBanQuangCao", " top 1 Nguoitao", "Nguoitao", "Ma_Quangcao=" + id + " order by ID ASC"));
                    if (_MaNguoinhap != 0)
                    {
                        if (_NguoidungDAL.GetUserByUserName_ID(_MaNguoinhap) != null)
                        {
                            Nguoinhap = _NguoidungDAL.GetUserByUserName_ID(_MaNguoinhap).UserFullName;
                        }
                        else
                        {
                            Nguoinhap = "";
                        }
                    }
                    else
                    {
                        Nguoinhap = "";
                    }
                    if (_NguoidungDAL.GetUserByUserName_ID((int)obj.Nguoitao) != null)
                    {
                        nguoisua = _NguoidungDAL.GetUserByUserName_ID((int)obj.Nguoitao).UserFullName;
                    }
                    else
                    {
                        nguoisua = "User does not exist";
                    }

                    _MaPhienbanQC = int.Parse(_ulti.GetColumnValuesDynamic("T_PhienBanQuangCao", " top 1 ID", "ID", "Ma_Quangcao=" + id + " order by ID DESC"));

                    if (_MaPhienbanQC != 0)
                    {
                        ViewState["ver"] = _MaPhienbanQC.ToString();
                    }
                    else
                    {
                        ViewState["ver"] = -1;
                    }
                    LoadDataImageTinBai();
                }
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            id = int.Parse(Page.Request.QueryString["ID"].ToString());
            if (Page.Request.QueryString["Menu_ID"] != null)
            {
                if (!IsPostBack)
                {
                    T_QuangCao obj = new T_QuangCao();
                    obj = _DalQC.GetOneFromT_QuangCaoByID(id);

                    Tenquangcao = obj.Ten_QuangCao.ToString();
                    Noidung     = obj.Noidung.ToString();
                    Kichthuoc   = UltilFunc.GetKichCoQuangCao(obj.Kichthuoc);
                    Loaibao     = UltilFunc.GetTenAnpham(obj.Ma_Loaibao);
                    Ngaydang    = obj.Ngaydang.ToString("dd/MM/yyyy");

                    if (obj.Trang > 0)
                    {
                        Sotrang = " Trang :" + obj.Trang.ToString();
                    }
                    else
                    {
                        Sotrang = "";
                    }

                    _MaNguoinhap = int.Parse(_ulti.GetColumnValuesDynamic("T_PhienBanQuangCao", " top 1 Nguoitao", "Nguoitao", "Ma_Quangcao=" + id + " order by ID ASC"));
                    if (_MaNguoinhap != 0)
                    {
                        if (_NguoidungDAL.GetUserByUserName_ID(_MaNguoinhap) != null)
                        {
                            Nguoinhap = _NguoidungDAL.GetUserByUserName_ID(_MaNguoinhap).UserFullName;
                        }
                        else
                        {
                            Nguoinhap = "";
                        }
                    }
                    else
                    {
                        Nguoinhap = "";
                    }
                    if (_NguoidungDAL.GetUserByUserName_ID((int)obj.Nguoitao) != null)
                    {
                        nguoisua = _NguoidungDAL.GetUserByUserName_ID((int)obj.Nguoitao).UserFullName;
                    }
                    else
                    {
                        nguoisua = "User does not exist";
                    }

                    _MaPhienbanQC = int.Parse(_ulti.GetColumnValuesDynamic("T_PhienBanQuangCao", " top 1 ID", "ID", "Ma_Quangcao=" + id + " order by ID DESC"));

                    if (_MaPhienbanQC != 0)
                    {
                        ViewState["ver"] = _MaPhienbanQC.ToString();
                    }
                    else
                    {
                        ViewState["ver"] = -1;
                    }
                    LoadDataImageTinBai(id.ToString());
                    BindGridNguoiXuly();
                }
            }
        }