/// <summary>
        /// Load the lookups and the tree
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LossesAdjustment_Load(object sender, EventArgs e)
        {
            var UnitColumn  = ((GridView)AdjustmentGrid.MainView).Columns[10];
            var UnitColumn1 = ((GridView)gridItemsChoice.MainView).Columns[4];

            switch (VisibilitySetting.HandleUnits)
            {
            case 2:
                UnitColumn.Visible  = true;
                UnitColumn1.Visible = false;
                break;

            case 1:
                UnitColumn.Visible  = false;
                UnitColumn1.Visible = true;
                break;

            case 3:
                UnitColumn.Visible  = true;
                UnitColumn1.Visible = false;
                break;
            }

            var stor = new Stores();

            stor.GetActiveStores();

            cboStores.Properties.DataSource    = stor.DefaultView;
            lkCategories.Properties.DataSource = BLL.Type.GetAllTypes();

            var unit     = new ItemUnit();
            var allunits = unit.GetAllUnits();

            unitsbindingSource.DataSource = allunits.DefaultView;

            var disRes     = new DisposalReasons();
            var allreasons = disRes.GetAllReasons();

            reasonBindingSource.DataSource = allreasons.DefaultView;

            lkCategories.ItemIndex = 0;
            cboStores.ItemIndex    = 0;
            dtAdjustDate.Value     = DateTime.Now;
            if (ckExpired.Checked)
            {
                gridItemChoiceView.ActiveFilterString = String.Format("[ExpiryDate] < #{0}# and [TypeID]={1} and [QuantityLeft] > 0", DateTime.Now, (int)lkCategories.EditValue);
            }
        }
示例#2
0
        /// <summary>
        /// Load the lookups and the tree
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LossesAdjustment_Load(object sender, EventArgs e)
        {
            var UnitColumn  = ((GridView)AdjustmentGrid.MainView).Columns[10];
            var UnitColumn1 = ((GridView)gridItemsChoice.MainView).Columns[4];

            switch (VisibilitySetting.HandleUnits)
            {
            case 2:
                UnitColumn.Visible  = true;
                UnitColumn1.Visible = false;
                break;

            case 1:
                UnitColumn.Visible  = false;
                UnitColumn1.Visible = true;
                break;

            case 3:
                UnitColumn.Visible  = true;
                UnitColumn1.Visible = false;
                break;
            }

            var stor = new Stores();

            stor.GetActiveStores();
            UserStore ust = new UserStore();
            DataTable dtt = ust.GetUserStore(MainWindow.LoggedinId);

            cboStores.Properties.DataSource = dtt;
            // cboStores.Properties.DataSource = stor.DefaultView;
            //lkCategories.Properties.DataSource = BLL.Type.GetAllTypes();
            UserCommodityType ucs = new UserCommodityType();
            DataTable         dt  = ucs.GetUserCommodityType(MainWindow.LoggedinId);

            lkCategories.Properties.DataSource = dt;

            var unit     = new ItemUnit();
            var allunits = unit.GetAllUnits();

            unitsbindingSource.DataSource = allunits.DefaultView;

            var disRes     = new DisposalReasons();
            var allreasons = disRes.GetAllReasons();

            reasonBindingSource.DataSource = allreasons.DefaultView;
            lkReason.Properties.DataSource = allreasons;


            lkCategories.ItemIndex = 0;
            cboStores.ItemIndex    = 0;
            dtAdjustDate.Value     = DateTime.Now;
            if (ckExpired.Checked)
            {
                gridItemChoiceView.ActiveFilterString = String.Format("[ExpiryDate] < #{0}# and [TypeID]={1} and [QuantityLeft] > 0", DateTime.Now, (int)lkCategories.EditValue);
            }

            if (Common.IsInventoryPeriod())
            {
                btnSave.Enabled = false;
            }
            else
            {
                btnSave.Enabled = true;
            }
            ((GridView)AdjustmentGrid.MainView).Columns[11].Visible = false;
            ((GridView)AdjustmentGrid.MainView).Columns[12].Visible = false;
        }