Exemplo n.º 1
0
        private void BtnProductNcmDetail_Click(object sender, EventArgs e)
        {
            if (DgvFpy.Rows.GetRowCount(DataGridViewElementStates.Selected) == 0)
            {
                MessageBox.Show("Please select a row");
                return;
            }
            // To get a selected row number, below code is not working perfectly
            // int selectedRow = DgvFpy.SelectedRows[0].Index;
            // Because if the datagridview is resorted after click on column name, the index will be different
            // Use below 2 lines to get the correct index
            // line 1: to get the whole row data from the datagridview
            // line 2: search the line in original datatable to get the correct index
            int year;
            int month;

            try
            {
                year  = int.Parse(TbYear.Text);
                month = int.Parse(TbMonth.Text);
            }
            catch (Exception ex)
            {
                throw (ex);
            }

            DataRowView drv         = DgvFpy.SelectedRows[0].DataBoundItem as DataRowView;
            int         selectedRow = TableFpy.Rows.IndexOf(drv.Row);

            TableProductNcmDetail = Ncm.GetProductNcmDetail(TableFpy.Rows[selectedRow][Ncm.ExHdSystemUnionName].ToString(),
                                                            year, month).Copy();
            DgvProductNcmDetail.DataSource = TableProductNcmDetail;
            DgvProductNcmDetail.AutoResizeColumns();
            TabControlMain.SelectTab(2);
        }
Exemplo n.º 2
0
        private void navBar_musteritanim_Click(object sender, EventArgs e)
        {
            ExceptionCatcher.ExceptionFinder(() =>
            {
                RibbonPageGroup_Home.IsEnabled = true;
                CusUC             = new CustomerUserControl();
                DXTabItem tabItem = new DXTabItem()
                {
                    Header     = navBar_musteritanim.Content,
                    Content    = CusUC,
                    AllowHide  = DevExpress.Utils.DefaultBoolean.True,
                    IsSelected = true
                };

                foreach (DXTabItem item in TabControlMain.Items)
                {
                    if (item.Header == navBar_musteritanim.Content)
                    {
                        TabControlMain.RemoveTabItem(item);
                        break;
                    }
                }
                TabControlMain.Items.Add(tabItem);
            });
        }
Exemplo n.º 3
0
        private void BtnCalculateFPY_Click(object sender, EventArgs e)
        {
            DataTable dt = null;

            try
            {
                if (!Ncm.MatchProductName())
                {
                    MessageBox.Show("Table is still not initialized, Maybe there is some System has no Union Name.");
                    return;
                }
                int year  = int.Parse(TbYear.Text);
                int month = int.Parse(TbMonth.Text);
                //ShowFpyChart(Ncm.AnalyzeFPY4SingleMonth(year, month));
                dt       = Ncm.AnalyzeFPY4SingleMonth(year, month);
                TableFpy = dt.Copy();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " For Year and Month");
            }


            DgvFpy.DataSource = TableFpy;
            DgvFpy.AutoResizeColumns();

            ChartFpy.BackColor = Color.Azure;
            ChartFpy.Series[HeaderChartFPy].Points.DataBindXY(GetFpyData().Item1, GetFpyData().Item2);
            ChartFpy.Series[HeaderChartFPy].ChartType = SeriesChartType.Bar;
            TabControlMain.SelectTab(1);
        }
Exemplo n.º 4
0
        private void basketAdd_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            ExceptionCatcher.ExceptionFinder(() =>
            {
                UCSepet           = new UCSepet();
                DXTabItem tabItem = new DXTabItem()
                {
                    Header     = basketAdd.Content,
                    Content    = UCSepet,
                    AllowHide  = DevExpress.Utils.DefaultBoolean.True,
                    IsSelected = true
                };

                foreach (DXTabItem item in TabControlMain.Items)
                {
                    if (item.Header == basketAdd.Content)
                    {
                        TabControlMain.RemoveTabItem(item);
                        break;
                    }
                }

                TabControlMain.Items.Add(tabItem);
                AcceptBasket.IsEnabled = true;
                CancelBasket.IsEnabled = true;
            });
        }
Exemplo n.º 5
0
        private void navBar_raporList_Click(object sender, EventArgs e)
        {
            ExceptionCatcher.ExceptionFinder(() =>
            {
                RibbonPageGroup_Home.IsEnabled = false;
                UCReport          = new UCReport();
                DXTabItem tabItem = new DXTabItem()
                {
                    Header     = navBar_raporList.Content,
                    Content    = UCReport,
                    AllowHide  = DevExpress.Utils.DefaultBoolean.True,
                    IsSelected = true
                };

                foreach (DXTabItem item in TabControlMain.Items)
                {
                    if (item.Header == navBar_raporList.Content)
                    {
                        TabControlMain.RemoveTabItem(item);
                        break;
                    }
                }
                TabControlMain.Items.Add(tabItem);
            });
        }
Exemplo n.º 6
0
 private void BtnCheckWeeklyNcm_Click(object sender, EventArgs e)
 {
     try
     {
         Ncm.MatchProductName();
         DateTime timeSpliter = DtpWeeklyNcm.Value.Date;
         Ncm.RecaclulateWeekSpliter(timeSpliter);
         TableNcmWeeklyGeneral          = Ncm.GetWeeklyNcmGeneral();
         DgvNcmWeeklyGeneral.DataSource = TableNcmWeeklyGeneral;
         DgvNcmWeeklyGeneral.AutoResizeColumns();
         TabControlMain.SelectTab(4);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + " For Year and Month");
     }
 }
Exemplo n.º 7
0
        public virtual void BtnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (FGridStatu == GridStatu.gsEdit || FGridStatu == GridStatu.gsAdd)
            {
                //CheckMainField();
                if (!CheckRequiredField())
                {
                    return;
                }
                DateTimeToStr();
                GV_Main.PostEditor();
                if (DBUpdate(GCNum.GCN_Main))
                {
                    if (FGridStatu == GridStatu.gsAdd)
                    {
                        GV_Main.FocusedRowHandle = GV_Main.RowCount - 1;
                    }

                    FGridStatu = GridStatu.gsBrowse;

                    for (int i = 0; i < MainControls.Count; i++)
                    {
                        MainControls[i].Enabled             = true;
                        MainControls[i].Properties.ReadOnly = true;
                    }

                    BtnNew.Enabled       = true;
                    BtnQuery.Enabled     = true;
                    BtnEdit.Enabled      = true;
                    BtnDel.Enabled       = true;
                    BtnFirst.Enabled     = true;
                    BtnPrior.Enabled     = true;
                    BtnNext.Enabled      = true;
                    BtnLast.Enabled      = true;
                    BtnSave.Enabled      = false;
                    BtnCancel.Enabled    = false;
                    btnAutoWidth.Enabled = true;
                    IsCheckRequired      = true;
                    TabControlMain.Focus();
                }
            }
        }
Exemplo n.º 8
0
        private void BtnCheckMaterial_Click(object sender, EventArgs e)
        {
            if (DgvProductNcmDetail.Rows.GetRowCount(DataGridViewElementStates.Selected) == 0)
            {
                MessageBox.Show("Please select a row");
                return;
            }
            // To get a selected row number, below code is not working perfectly
            // int selectedRow = DgvProductNcmDetail.SelectedRows[0].Index;
            // Because if the datagridview is resorted after click on column name, the index will be different
            // Use below 2 lines to get the correct index
            // line 1: to get the whole row data from the datagridview
            // line 2: search the line in original datatable to get the correct index
            DataRowView drv         = DgvProductNcmDetail.SelectedRows[0].DataBoundItem as DataRowView;
            int         selectedRow = TableProductNcmDetail.Rows.IndexOf(drv.Row);

            TableMaterialDetail          = Ncm.GetMaterialDetail(TableProductNcmDetail.Rows[selectedRow][Ncm.RawExcelHeader.DefectivePartDescription].ToString()).Copy();
            DgvMaterialDetail.DataSource = TableMaterialDetail;
            DgvMaterialDetail.AutoResizeColumns();
            TabControlMain.SelectTab(3);
        }
Exemplo n.º 9
0
 private void toolStripMenuItemEmployees_Click(object sender, EventArgs e)
 {
     TabControlMain.SelectTab(TabPageEmployees);
 }
Exemplo n.º 10
0
 private void toolStripMenuItemSearchRecord_Click(object sender, EventArgs e)
 {
     TabControlMain.SelectTab(TabPagePatientsRecordSearch);
 }
Exemplo n.º 11
0
 private void toolStripMenuItemShedule_Click(object sender, EventArgs e)
 {
     TabControlMain.SelectTab(TabPageCreateShedule);
 }
Exemplo n.º 12
0
 //открытие вкладок в контекстном меню
 private void toolStripMenuItemPage1_Click(object sender, EventArgs e)
 {
     TabControlMain.SelectTab(TabPagePatients);
 }