예제 #1
0
파일: VRFForm.cs 프로젝트: HCMISFE/FE
        private void VRFForm_Load(object sender, EventArgs e)
        {
            var type     = new BLL.Type();
            var alltypes = type.GetAllCategory();

            categorybindingSource.DataSource = alltypes.DefaultView;

            var program  = new Programs();
            var programs = program.GetSubPrograms();

            cboProgram.Properties.DataSource    = programs;
            cboProgram.Properties.DisplayMember = "Name";
            cboProgram.Properties.ValueMember   = "ID";

            PopulateTheMonthCombos(cboFromMonth);
            PopulateTheMonthCombos(cboToMonth);
            PopulateTheYearCombo(cboFromYear);
            PopulateTheYearCombo(cboToYear);
            var stor = new Stores();

            stor.GetActiveStores();
            cboStores.Properties.DataSource = stor.DefaultView;
            PopulateVRFs();

            WindowVisibility(false);

            var prog = new Programs();

            prog.GetSubPrograms();
            cboProgram.Properties.DataSource = prog.DefaultView;
            cboProgram.EditValue             = 1000;
        }
예제 #2
0
파일: GeneralChart.cs 프로젝트: HCMISFE/FE
        private void GeneralReport_Load(object sender, EventArgs e)
        {
            Stores stor = new Stores();

            stor.GetActiveStores();
            DataTable dtStor   = stor.DefaultView.ToTable();
            DataRow   rowStore = dtStor.NewRow();

            rowStore["ID"]        = "0";
            rowStore["StoreName"] = "All Stores";
            dtStor.Rows.InsertAt(rowStore, 0);
            cboStores.Properties.DataSource = dtStor;

            if (stor.RowCount > 1)
            {
                cboStores.ItemIndex = 0;
            }

            var       type     = new BLL.Type();
            DataTable alltypes = type.GetAllCategory();
            DataRow   row      = alltypes.NewRow();

            row["ID"]   = "0";
            row["Name"] = "All Categories";
            alltypes.Rows.InsertAt(row, 0);

            lkCategory.Properties.DataSource    = alltypes;
            lkCategory.Properties.DisplayMember = "Name";
            lkCategory.Properties.ValueMember   = "ID";
            lkCategory.ItemIndex = 0;

            dtDate.Value        = DateTime.Now;
            dtDate.CustomFormat = "MM/dd/yyyy";
            dtCurrent           = ConvertDate.DateConverter(dtDate.Text);
            curMont             = dtCurrent.Month;
            curYear             = dtCurrent.Year;

            //cboYear.Properties.DataSource = Items.AllYears();
            //cboYear.EditValue = dtCurrent.Year;
            DataView dv = Items.AllFiscalYears().DefaultView;

            dv.Sort = "year desc";
            DataTable sortedDT = dv.ToTable();

            cboYear.Properties.DataSource = sortedDT;
            cboYear.ItemIndex             = 0;
            if (cboYear.Properties.Columns.Count > 0)
            {
                cboYear.Properties.Columns[0].Alignment = DevExpress.Utils.HorzAlignment.Near;
            }
        }
예제 #3
0
        /// <summary>
        /// Load the dropdowns and the category tree
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ManageItems_Load(object sender, EventArgs e)
        {
            PopulateCatTree(_selectedType);

            var type     = new BLL.Type();
            var alltypes = type.GetAllCategory();

            DataRow row = alltypes.NewRow();

            row["ID"]   = "0";
            row["Name"] = "All";
            alltypes.Rows.InsertAt(row, 0);

            lkCategory.Properties.DataSource    = alltypes;
            lkCategory.Properties.DisplayMember = "Name";
            lkCategory.Properties.ValueMember   = "ID";
            lkCategory.ItemIndex = 0;

            var stor = new Stores();

            stor.GetActiveStores();
            cboStores.DataSource = stor.DefaultView;
            dtDate.Value         = DateTime.Now;
            dtDate.CustomFormat  = "MM/dd/yyyy";
            _dtCur     = ConvertDate.DateConverter(dtDate.Text);
            dtTo.Value = DateTime.Now;
            // int yearFrom = ((_dtCur.Month == 11 && _dtCur.Month == 12) ? _dtCur.Year : _dtCur.Year - 1 );
            int currYear = (EthiopianDate.EthiopianDate.Now.Month < 11) ? EthiopianDate.EthiopianDate.Now.Year - 1 : EthiopianDate.EthiopianDate.Now.Year;

            dtFrom.Value = EthiopianDate.EthiopianDate.EthiopianToGregorian(String.Format("{0}/{1}/{2}", 1, 11, currYear));

            dtFrom.CustomFormat = "MM/dd/yyyy";
            DateTime dt1 = ConvertDate.DateConverter(dtFrom.Text);

            dtTo.CustomFormat = "MM/dd/yyyy";
            DateTime dt2 = ConvertDate.DateConverter(dtTo.Text);

            //string dRange = "From " + dtFrom.Text + " to " + dtTo.Text;
            //layoutControlGroup3.Text = "Cost Report " + dRange;
            if (dt1 == dt2)
            {
                dt1 = ((dt1.Month == 11 || dt1.Month == 12) ? new DateTime(dt1.Year, 11, 1) : new DateTime(dt1.Year - 1, 11, 1));
                //dRange = "For Year " + dt1.Year.ToString();
            }
            this._isReady    = true;
            txtFromDate.Text = dt1.ToShortDateString();

            PopulateItemList();
        }
        private void GeneralReport_Load(object sender, EventArgs e)
        {
            var       type     = new BLL.Type();
            DataTable alltypes = type.GetAllCategory();
            DataRow   row      = alltypes.NewRow();

            row["ID"]   = "0";
            row["Name"] = "All";
            alltypes.Rows.InsertAt(row, 0);

            lkCategory.Properties.DataSource    = alltypes;
            lkCategory.Properties.DisplayMember = "Name";
            lkCategory.Properties.ValueMember   = "ID";
            lkCategory.ItemIndex = 0;

            Stores stor = new Stores();

            stor.GetActiveStores();
            DataTable dtStor   = stor.DefaultView.ToTable();
            DataRow   rowStore = dtStor.NewRow();

            rowStore["ID"]        = "0";
            rowStore["StoreName"] = "All";
            dtStor.Rows.InsertAt(rowStore, 0);

            cboStores.Properties.DataSource = dtStor;
            cboStores.ItemIndex             = 0;

            dtDate.Value        = DateTime.Now;
            dtDate.CustomFormat = "MM/dd/yyyy";
            dtCurrent           = ConvertDate.DateConverter(dtDate.Text);
            curMont             = dtCurrent.Month;
            curYear             = dtCurrent.Year;

            dtDate.Value        = DateTime.Now;
            dtDate.CustomFormat = "MM/dd/yyyy";
            _dtCur = ConvertDate.DateConverter(dtDate.Text);

            cboYear.Properties.DataSource = Items.AllYears();
            cboYear.EditValue             = curYear;
        }
예제 #5
0
        private void WastageRate_Load(object sender, EventArgs e)
        {
            DataView dv = Items.AllFiscalYears().DefaultView;

            dv.Sort = "year desc";
            DataTable sortedDT = dv.ToTable();

            cboYear.Properties.DataSource   = sortedDT;
            cboYearto.Properties.DataSource = sortedDT;
            cboYearto.ItemIndex             = 0;
            var       type     = new BLL.Type();
            DataTable alltypes = type.GetAllCategory();
            DataRow   row      = alltypes.NewRow();

            row["ID"]   = "0";
            row["Name"] = "All Categories";
            alltypes.Rows.InsertAt(row, 0);

            lkCategory.Properties.DataSource    = alltypes;
            lkCategory.Properties.DisplayMember = "Name";
            lkCategory.Properties.ValueMember   = "ID";
            lkCategory.ItemIndex = 0;

            Stores stor = new Stores();

            stor.GetActiveStores();
            DataTable dtStor   = stor.DefaultView.ToTable();
            DataRow   rowStore = dtStor.NewRow();

            rowStore["ID"]        = "0";
            rowStore["StoreName"] = "All Stores";
            dtStor.Rows.InsertAt(rowStore, 0);

            cboStores.Properties.DataSource = dtStor;
            cboStores.ItemIndex             = 0;
            generateChart();
        }
        private void RRFForm_Load(object sender, EventArgs e)
        {
            btnAutoPushToPFSA.Enabled = false;
            btnSendEmergencyOrder.Enabled = false;
            var unitcolumn = ((GridView) gridItemsChoice.MainView).Columns[2];
            var unitcolumn1 = ((GridView) gridItemsChoice.MainView).Columns[13];
            layoutControlItem18.Visibility =LayoutVisibility.Never;
            switch (VisibilitySetting.HandleUnits)
            {
                case 3:
                    unitcolumn.Visible = false;
                    unitcolumn1.Visible = true;
                    break;
                case 2:
                    unitcolumn.Visible = false;
                    unitcolumn1.Visible = true;
                    break;
                default:
                    unitcolumn.Visible = true;
                    unitcolumn1.Visible = false;
                    break;
            }

            var unit = new ItemUnit();
            var units = unit.GetAllUnits();
            unitsBindingSource.DataSource = units.DefaultView;

            var type = new BLL.Type();
            var alltypes = type.GetAllCategory();
            categorybindingSource.DataSource = alltypes.DefaultView;

            var program = new Programs();
            var programs = program.GetSubPrograms();
            cboProgram.Properties.DataSource = programs;
            cboProgram.Properties.DisplayMember = "Name";
            cboProgram.Properties.ValueMember = "ID";

            var orderstatus = new PharmInventory.HelperClasses.OrderStatus();
            orderbindingSource.DataSource = orderstatus.GetRRFOrders();
            lkorderstatus.Properties.DataSource = orderbindingSource;
            lkorderstatus.Properties.ValueMember = "RecordId";
            lkorderstatus.Properties.DisplayMember = "Name";

            PopulateTheMonthCombos(cboFromMonth);
            PopulateTheMonthCombos(cboToMonth);
            PopulateTheYearCombo(cboFromYear);
            PopulateTheYearCombo(cboToYear);
            var stor = new Stores();
            stor.GetActiveStores();
            cboStores.Properties.DataSource = stor.DefaultView;
            PopulateRRFs();

            WindowVisibility(false);
            EnableDisableStatusCheck();

            var prog = new Programs();
            prog.GetSubPrograms();
            cboProgram.Properties.DataSource = prog.DefaultView;
            cboProgram.EditValue = 1000;
        }
        private void GeneralReport_Load(object sender, EventArgs e)
        {
            var type = new BLL.Type();
            DataTable alltypes = type.GetAllCategory();
            DataRow row = alltypes.NewRow();
            row["ID"] = "0";
            row["Name"] = "All";
            alltypes.Rows.InsertAt(row, 0);

            lkCategory.Properties.DataSource = alltypes;
            lkCategory.Properties.DisplayMember = "Name";
            lkCategory.Properties.ValueMember = "ID";
            lkCategory.ItemIndex = 0;

            Stores stor = new Stores();
            stor.GetActiveStores();
            DataTable dtStor = stor.DefaultView.ToTable();
            DataRow rowStore = dtStor.NewRow();
            rowStore["ID"] = "0";
            rowStore["StoreName"] = "All";
            dtStor.Rows.InsertAt(rowStore, 0);

            cboStores.Properties.DataSource = dtStor;
            cboStores.ItemIndex = 0;

            dtDate.Value = DateTime.Now;
            dtDate.CustomFormat = "MM/dd/yyyy";
            dtCurrent = ConvertDate.DateConverter(dtDate.Text);
            curMont = dtCurrent.Month;
            curYear = dtCurrent.Year;

            dtDate.Value = DateTime.Now;
            dtDate.CustomFormat = "MM/dd/yyyy";
            _dtCur = ConvertDate.DateConverter(dtDate.Text);

            cboYear.Properties.DataSource = Items.AllYears();
            cboYear.EditValue = curYear;
        }
        /// <summary>
        /// Load the dropdowns and the category tree
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ManageItems_Load(object sender, EventArgs e)
        {
            PopulateCatTree(_selectedType);

            var type = new BLL.Type();
            var alltypes = type.GetAllCategory();
            lkCategory.Properties.DataSource = alltypes;
            lkCategory.Properties.DisplayMember = "Name";
            lkCategory.Properties.ValueMember = "ID";
            lkCategory.ItemIndex = 0;

            var stor = new Stores();
            stor.GetActiveStores();
            cboStores.DataSource = stor.DefaultView;
            dtDate.Value = DateTime.Now;
            dtDate.CustomFormat = "MM/dd/yyyy";
            _dtCur = ConvertDate.DateConverter(dtDate.Text);
            dtTo.Value = DateTime.Now;
               // int yearFrom = ((_dtCur.Month == 11 && _dtCur.Month == 12) ? _dtCur.Year : _dtCur.Year - 1 );
            int currYear = (EthiopianDate.EthiopianDate.Now.Month < 11) ? EthiopianDate.EthiopianDate.Now.Year - 1 : EthiopianDate.EthiopianDate.Now.Year;
            dtFrom.Value = EthiopianDate.EthiopianDate.EthiopianToGregorian(String.Format("{0}/{1}/{2}", 1, 11, currYear));

            dtFrom.CustomFormat = "MM/dd/yyyy";
            DateTime dt1 = ConvertDate.DateConverter(dtFrom.Text);
            dtTo.CustomFormat = "MM/dd/yyyy";
            DateTime dt2 = ConvertDate.DateConverter(dtTo.Text);
            //string dRange = "From " + dtFrom.Text + " to " + dtTo.Text;
            //layoutControlGroup3.Text = "Cost Report " + dRange;
            if (dt1 == dt2)
            {
                dt1 = ((dt1.Month == 11 || dt1.Month == 12) ? new DateTime(dt1.Year, 11, 1) : new DateTime(dt1.Year - 1, 11, 1));
                //dRange = "For Year " + dt1.Year.ToString();
            }
            this._isReady = true;

            txtFromDate.Text = dt1.ToShortDateString();

            PopulateItemList();
        }
        private void GeneralReport_Load(object sender, EventArgs e)
        {
            //TabPage z = tabControl1.TabPages[2];
            //tabControl1.TabPages.Remove(tabControl1.TabPages[2]);

            Stores stor = new Stores();
            DataTable dtStor = stor.GetActiveStores();
            DataRow rowStore = dtStor.NewRow();
            rowStore["ID"] = "0";
            rowStore["StoreName"] = "All";
            dtStor.Rows.InsertAt(rowStore, 0);

            cboStores.DataSource = dtStor;

            var type = new BLL.Type();
            DataTable alltypes = type.GetAllCategory();
            DataRow row = alltypes.NewRow();
            row["ID"] = "0";
            row["Name"] = "All";
            alltypes.Rows.InsertAt(row, 0);

            lkCategory.Properties.DataSource = alltypes;
            lkCategory.Properties.DisplayMember = "Name";
            lkCategory.Properties.ValueMember = "ID";
            lkCategory.ItemIndex = 0;

            dtDate.Value = DateTime.Now;
            dtDate.CustomFormat = "MM/dd/yyyy";
            dtCurrent = ConvertDate.DateConverter(dtDate.Text);
            curMont = dtCurrent.Month; // (dtCurrent.Month < 11) ? dtCurrent.Month + 2 : ((dtCurrent.Month == 11) ? 1 : 2);
            curYear = dtCurrent.Year;// (dtCurrent.Month < 11) ? dtCurrent.Year : dtCurrent.Year - 1;

            var dtyears = Items.AllYears();
            cboYear.Properties.DataSource = dtyears;
            cboYear.EditValue = curYear;

            var bw = new BackgroundWorker();
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
            bw.DoWork += new DoWorkEventHandler(bw_DoWork);
            bw.RunWorkerAsync();
        }