Пример #1
0
        /// <summary>
        /// Load danh sách nhóm hàng
        /// </summary>
        private void LoadGirdLookUpProductGroup()
        {
            var stocks = _productGroupService.GetProductGroups();

            gridLookUpEditProductGroup.Properties.View.OptionsBehavior.AutoPopulateColumns = false;
            gridLookUpEditProductGroup.Properties.DisplayMember = "ProductGroupName";
            gridLookUpEditProductGroup.Properties.ValueMember   = "ProductGroupID";
            gridLookUpEditProductGroup.Properties.View.BestFitColumns();
            gridLookUpEditProductGroup.Properties.PopupFormWidth = 406;
            gridLookUpEditProductGroup.Properties.DataSource     = stocks;
        }
Пример #2
0
        /// <summary>
        /// Tạo ID kế tiếp
        /// </summary>
        /// <returns></returns>
        private string NextId()
        {
            string lastId = _productGroupService.GetProductGroups().Last().ProductGroupID.Remove(0, 3);
            string productGroupId;

            if (!string.IsNullOrEmpty(lastId))
            {
                int nextId = int.Parse(lastId) + 1;
                productGroupId = string.Format("NH{0}", nextId.ToString(CultureInfo.InvariantCulture).PadLeft(5, '0'));
            }
            else
            {
                productGroupId = string.Format("NH0000{0}", 1);
            }
            return(productGroupId);
        }
Пример #3
0
 /// <summary>
 /// Load danh sách nhóm hàng
 /// </summary>
 private void LoadProductGroups()
 {
     gridControl1.DataSource = _productGroupService.GetProductGroups();
 }