Beispiel #1
0
        private void Init()
        {
            QuyenNguoiDung.LayQuyenNguoiDungTheoChucNang("btnNhomHang");
            if (QuyenNguoiDung.Them == false)
            {
                btnThem.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Sua == false)
            {
                btnSua.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Xoa == false)
            {
                btnXoa.Visibility = BarItemVisibility.Never;
            }

            LoadData();

            gvMain.Columns[0].FieldName = "ProductGroup_ID";
            gvMain.Columns[1].FieldName = "ProductGroup_Name";
            gvMain.Columns[2].FieldName = "Description";
            gvMain.Columns[3].FieldName = "Active";

            gvMain.IndicatorWidth          = 35;
            gvMain.CustomDrawRowIndicator += GvMain_CustomDrawRowIndicator;

            btnThem.ItemClick += BtnThem_ItemClick;
            btnSua.ItemClick  += BtnSua_ItemClick;
            btnXoa.ItemClick  += BtnXoa_ItemClick;

            btnLamMoi.ItemClick += BtnLamMoi_ItemClick;
        }
Beispiel #2
0
        private void Init()
        {
            DataTable table = QuyenNguoiDung.LayQuyenNguoiDung();

            DataRow[] dtr = table.Select("Active = 0 ");
            foreach (DataRow dt in dtr)
            {
                foreach (var c in ribbonControl1.Items)
                {
                    if (c is BarButtonItem)
                    {
                        BarButtonItem t = c as BarButtonItem;
                        if (t.Name == dt["Object_ID"].ToString())
                        {
                            t.Visibility = BarItemVisibility.Never;
                        }
                    }
                }
            }

            Load += FMain_Load;
            btnKhuVuc.ItemClick += BtnKhuVuc_ItemClick;
            timer1.Tick         += Timer1_Tick;
            timer1.Start();
            FormClosing          += FMain_FormClosing;
            btnKetThuc.ItemClick += BtnKetThuc_ItemClick;
        }
Beispiel #3
0
        private void Init()
        {
            QuyenNguoiDung.LayQuyenNguoiDungTheoChucNang("btnKhachHang");
            if (QuyenNguoiDung.Them == false)
            {
                btnThem.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Sua == false)
            {
                btnSua.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Xoa == false)
            {
                btnXoa.Visibility = BarItemVisibility.Never;
            }

            LoadData();

            gvMain.Columns[0].FieldName  = "Customer_ID";
            gvMain.Columns[1].FieldName  = "CustomerName";
            gvMain.Columns[2].FieldName  = "Customer_Group_ID";
            gvMain.Columns[3].FieldName  = "Contact";
            gvMain.Columns[4].FieldName  = "CustomerAddress";
            gvMain.Columns[5].FieldName  = "Tel";
            gvMain.Columns[6].FieldName  = "Mobile";
            gvMain.Columns[7].FieldName  = "Fax";
            gvMain.Columns[8].FieldName  = "Email";
            gvMain.Columns[9].FieldName  = "Website";
            gvMain.Columns[10].FieldName = "Tax";
            gvMain.Columns[11].FieldName = "BankAccount";
            gvMain.Columns[12].FieldName = "BankName";
            gvMain.Columns[13].FieldName = "Active";

            gcMain.UseEmbeddedNavigator = true;
            gcMain.EmbeddedNavigator.Buttons.Append.Visible     = false;
            gcMain.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            gcMain.EmbeddedNavigator.Buttons.Edit.Visible       = false;
            gcMain.EmbeddedNavigator.Buttons.EndEdit.Visible    = false;
            gcMain.EmbeddedNavigator.Buttons.Remove.Visible     = false;
            gvMain.Columns[2].SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
            gvMain.OptionsBehavior.AutoExpandAllGroups = true;

            gvMain.IndicatorWidth          = 45;
            gvMain.CustomDrawRowIndicator += GvMain_CustomDrawRowIndicator;

            btnThem.ItemClick += BtnThem_ItemClick;
            btnSua.ItemClick  += BtnSua_ItemClick;
            btnXoa.ItemClick  += BtnXoa_ItemClick;

            btnLamMoi.ItemClick += BtnLamMoi_ItemClick;
        }
Beispiel #4
0
        private void Init()
        {
            QuyenNguoiDung.LayQuyenNguoiDungTheoChucNang("btnHangHoa");
            if (QuyenNguoiDung.Them == false)
            {
                btnThem.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Sua == false)
            {
                btnSua.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Xoa == false)
            {
                btnXoa.Visibility = BarItemVisibility.Never;
            }

            LoadData();

            gvMain.Columns[0].FieldName  = "Product_ID";
            gvMain.Columns[1].FieldName  = "Product_Name";
            gvMain.Columns[2].FieldName  = "ProductGroup_Name";
            gvMain.Columns[3].FieldName  = "Unit";
            gvMain.Columns[4].FieldName  = "Org_Price";
            gvMain.Columns[5].FieldName  = "Sale_Price";
            gvMain.Columns[6].FieldName  = "Retail_Price";
            gvMain.Columns[7].FieldName  = "LimitOrders";
            gvMain.Columns[8].FieldName  = "Product_Type_ID";
            gvMain.Columns[9].FieldName  = "Stock_Name";
            gvMain.Columns[10].FieldName = "Active";

            gcMain.UseEmbeddedNavigator = true;
            gcMain.EmbeddedNavigator.Buttons.Append.Visible     = false;
            gcMain.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            gcMain.EmbeddedNavigator.Buttons.Edit.Visible       = false;
            gcMain.EmbeddedNavigator.Buttons.EndEdit.Visible    = false;
            gcMain.EmbeddedNavigator.Buttons.Remove.Visible     = false;
            gvMain.Columns[2].SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
            gvMain.OptionsBehavior.AutoExpandAllGroups = true;

            gvMain.IndicatorWidth          = 45;
            gvMain.CustomDrawRowIndicator += GvMain_CustomDrawRowIndicator;

            btnLamMoi.ItemClick += BtnLamMoi_ItemClick;

            btnThem.ItemClick += BtnThem_ItemClick;
            btnSua.ItemClick  += BtnSua_ItemClick;
            btnXoa.ItemClick  += BtnXoa_ItemClick;
        }
Beispiel #5
0
        private void Init()
        {
            QuyenNguoiDung.LayQuyenNguoiDungTheoChucNang("btnNhaPhanPhoi");
            if (QuyenNguoiDung.Them == false)
            {
                btnThem.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Sua == false)
            {
                btnSua.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Xoa == false)
            {
                btnXoa.Visibility = BarItemVisibility.Never;
            }

            InitColumns();
            LoadData();

            gcMain.UseEmbeddedNavigator = true;
            gcMain.EmbeddedNavigator.Buttons.Append.Visible     = false;
            gcMain.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            gcMain.EmbeddedNavigator.Buttons.Edit.Visible       = false;
            gcMain.EmbeddedNavigator.Buttons.EndEdit.Visible    = false;
            gcMain.EmbeddedNavigator.Buttons.Remove.Visible     = false;
            gvMain.Columns[2].SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
            gvMain.OptionsBehavior.AutoExpandAllGroups = true;

            gvMain.IndicatorWidth          = 45;
            gvMain.CustomDrawRowIndicator += GvMain_CustomDrawRowIndicator;

            btnThem.ItemClick += BtnThem_ItemClick;
            btnSua.ItemClick  += BtnSua_ItemClick;
            btnXoa.ItemClick  += BtnXoa_ItemClick;

            btnLamMoi.ItemClick += BtnLamMoi_ItemClick;
        }
Beispiel #6
0
        private void Init()
        {
            QuyenNguoiDung.LayQuyenNguoiDungTheoChucNang("btnKho");
            if (QuyenNguoiDung.Them == false)
            {
                btnThem.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Sua == false)
            {
                btnSua.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Xoa == false)
            {
                btnXoa.Visibility = BarItemVisibility.Never;
            }

            LoadData();

            gvMain.Columns[0].FieldName = "Stock_ID";
            gvMain.Columns[1].FieldName = "Stock_Name";
            gvMain.Columns[2].FieldName = "Contact";
            gvMain.Columns[3].FieldName = "Address";
            gvMain.Columns[4].FieldName = "Telephone";
            gvMain.Columns[5].FieldName = "Manager";
            gvMain.Columns[6].FieldName = "Description";
            gvMain.Columns[7].FieldName = "Active";

            gvMain.IndicatorWidth          = 45;
            gvMain.CustomDrawRowIndicator += GvMain_CustomDrawRowIndicator;

            btnLamMoi.ItemClick += BtnLamMoi_ItemClick;

            btnThem.ItemClick += BtnThem_ItemClick;
            btnSua.ItemClick  += BtnSua_ItemClick;
            btnXoa.ItemClick  += BtnXoa_ItemClick;
        }
Beispiel #7
0
        private void Init()
        {
            QuyenNguoiDung.LayQuyenNguoiDungTheoChucNang("btnKhuVuc");
            if (QuyenNguoiDung.Them == false)
            {
                btnThem.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Sua == false)
            {
                btnSua.Visibility = BarItemVisibility.Never;
            }
            if (QuyenNguoiDung.Xoa == false)
            {
                btnXoa.Visibility = BarItemVisibility.Never;
            }

            Load += FKhuVuc_Load;
            btnLamMoi.ItemClick += FKhuVuc_Load;

            gvMain.IndicatorWidth          = 35;
            gvMain.CustomDrawRowIndicator += GvMain_CustomDrawRowIndicator;

            btnLamMoi.ItemClick += BtnLamMoi_ItemClick;
        }