private void wizardControl1_SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
 {
     if (wizardControl1.SelectedPage == wpginsertar)
     {
         backgroundWorker1.RunWorkerAsync();
     }
 }
Exemplo n.º 2
0
        private void wizardControl1_SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
        {
            try
            {
                if (e.Page != this.wizardPage_Complete)
                {
                    return;
                }

                int index = int.Parse(this.gridView2.GetRowCellValue(this.gridView2.FocusedRowHandle, "INDEX").ToString().Trim());

                if (ds.Tables[index.ToString()].Columns.Count <= 0 ||
                    ds.Tables[index.ToString()].Rows.Count <= 0)
                {
                    Basic.ShowMessage(2, "데이터가 없습니다.");
                    this.wizardControl1.SelectedPage = this.wizardPage_Step;
                    return;
                }
                else if (cboName.SelectedIndex <= 0)
                {
                    Basic.ShowMessage(2, "이름은 필수 사항입니다.");
                    this.wizardControl1.SelectedPage = this.wizardPage_Step;
                    return;
                }
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
        }
Exemplo n.º 3
0
 private void wizardControl1_SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
 {
     if (e.Page == wizardPage1 && dbconn != true)
     {
         page             = e.Page;
         e.Page.AllowNext = false;
     }
 }
Exemplo n.º 4
0
 private void wizardControl1_SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
 {
     if (wizardControl1.SelectedPage == importPage)
     {
         wartImportProcess();
     }
     if (wizardControl1.SelectedPage == TypeItemPage)
     {
         //开始获取并解析京东商品分类
         GetJDTypesData();
     }
 }
Exemplo n.º 5
0
        private void wizardControl1_SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
        {
            if (e.Page == wizardPage4)
            {
                if (System.DateTime.Now.ToLongDateString() != TextDetect.Properties.Settings.Default.date_record)
                {
                    TextDetect.Properties.Settings.Default.used_cnt = 0;
                    TextDetect.Properties.Settings.Default.Save();
                }
                labelControl4.Text = "当前软件版权:" + (licence_helper.licenced ? "正式版" : "试用版");
                labelControl6.Text = "(日最大识别次数10次,已使用" + TextDetect.Properties.Settings.Default.used_cnt + "次)";

                labelControl6.Visible = simpleButton12.Visible = !licence_helper.licenced;
            }
        }
Exemplo n.º 6
0
        private void wizardControl_SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
        {
            LayoutControl     currentlc   = null;
            LayoutControlItem currentItem = null;

            try
            {
                if (e.Page.Controls.Count.Equals(0))
                {
                    return;
                }
                if (!(e.Page.Controls[0] is LayoutControl))
                {
                    return;
                }
                currentlc = e.Page.Controls[0] as LayoutControl;
                foreach (var entry in ((System.Collections.CollectionBase)(currentlc.Items)))
                {
                    if (entry is LayoutControlItem)
                    {
                        currentItem = entry as LayoutControlItem;
                        if (currentItem.Control == null)
                        {
                            continue;
                        }
                        currentItem.Control.Focus();
                        return;
                    }
                }
            }
            catch (MofException ex)
            {
                System.Diagnostics.Debug.WriteLine("Бүртгэлийг хадгалахад алдаа гарлаа: " + ex.InnerException.Message);
                Tool.ShowError(ex.Message, ex.InnerException.Message);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Бүртгэлийг хадгалахад алдаа гарлаа: " + ex.Message);
                Tool.ShowError("Бүртгэлийг хадгалахад алдаа гарлаа!", ex.Message);
            }
            finally { currentlc = null; currentItem = null; }
        }
Exemplo n.º 7
0
 private void WizardControl1SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
 {
     if (e.PrevPage == null && e.Page.Name == wizP1.Name)
     {
         if (Page1Activated != null)
         {
             Page1Activated(this, EventArgs.Empty);
         }
     }
     else if (e.Page.Name == wizP2.Name)
     {
         if (Page2Activated != null)
         {
             Page2Activated(this, EventArgs.Empty);
         }
     }
     else if (e.Page.Name == wizP3.Name)
     {
         if (Page3Activated != null)
         {
             Page3Activated(this, EventArgs.Empty);
         }
     }
     else if (e.Page.Name == wizP4.Name)
     {
         if (Page4Activated != null)
         {
             Page4Activated(this, EventArgs.Empty);
         }
     }
     else if (e.Page.Name == wizP5.Name)
     {
         if (Page5Activated != null)
         {
             Page5Activated(this, EventArgs.Empty);
         }
     }
 }
Exemplo n.º 8
0
        private void wizardControlActualizar_Archivo_SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
        {
            try
            {
                switch (e.Page.Name)
                {
                case "wpArchivo_Seleccionado":
                    Setear_Archivo();
                    break;

                case "wpArchivos_actuales":
                    LlenarGridViewArchivo_Plano();
                    Leer_y_Cargar_Excel();
                    break;

                case "wpArchivo_Actualizado":
                    Cargar_Grilla_Actualizacion_academico();
                    progressBarActualizacion.ResetText();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
            }
        }
Exemplo n.º 9
0
        private void wizStockTake_SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
        {
            if (AllowSave)
            {
                SaveSuccessful();
                OpenRecord(((DB.ITM_StockTake)BindingSource.DataSource).Id);
            }
            DB.ITM_StockTake stockTake = (DB.ITM_StockTake)BindingSource.DataSource;

            if (wizStockTake.SelectedPage == wizStockTakeWelcome)
            {
                AllowExport = false;
            }
            else if (wizStockTake.SelectedPage == wizStockTakeStart)
            {
                stockTake.StatusId = (byte)BL.ITM.ITM_StockTakeStatus.New;
                AllowExport        = true;
            }
            else if (wizStockTake.SelectedPage == wizStockTakeQuantities)
            {
                if (!itmStockTake.Description.Contains("Filter : "))
                {
                    itmStockTake.Description += " Filter : " + grvStockTakeItems.ActiveFilterString;
                }

                if (itmStockTake.ITM_StockTakeItem.Count == 0)
                {
                    //using (new CDS.Client.Desktop.Essential.UTL.WaitCursor())
                    {
                        List <DB.ITM_StockTakeItem> stockTakeItems = new List <DB.ITM_StockTakeItem>();
                        int dataRowCount = grvStockTakeItems.DataRowCount;

                        for (int i = 0; i < dataRowCount; i++)
                        {
                            while (grvStockTakeItems.GetRow(i) is DevExpress.Data.NotLoadedObject)
                            {
                                Application.DoEvents();
                            }

                            DB.VW_Inventory VW_Inventory = (DB.VW_Inventory)((DevExpress.Data.Async.Helpers.ReadonlyThreadSafeProxyForObjectFromAnotherThread)(grvStockTakeItems.GetRow(i))).OriginalRow;// grvStockTakeItems.GetRow(i);

                            if (VW_Inventory != null)
                            {
                                DB.ITM_StockTakeItem item = BL.ITM.ITM_StockTakeItem.New;
                                item.InventoryId = VW_Inventory.EntityId;
                                item.LineNumber  = i;
                                item.OnHand      = VW_Inventory.OnHand;
                                item.UnitAverage = VW_Inventory.UnitAverage;
                                item.UnitPrice   = VW_Inventory.UnitPrice;
                                item.UnitCost    = VW_Inventory.UnitCost;
                                stockTakeItems.Add(item);
                            }
                            else
                            {
                            }
                        }
                        foreach (DB.ITM_StockTakeItem item in stockTakeItems.OrderBy(o => o.LineNumber))
                        {
                            itmStockTake.ITM_StockTakeItem.Add(item);
                        }

                        SaveSuccessful();
                        OpenRecord(((DB.ITM_StockTake)BindingSource.DataSource).Id);
                    }
                }
                BindingSourceStockTakeItem.DataSource = itmStockTake.ITM_StockTakeItem;
                grvStockTakeQuantity.RefreshData();
                wizStockTakeQuantities.AllowBack = false;
                stockTake.StatusId            = (byte)BL.ITM.ITM_StockTakeStatus.StocktakeCount;
                btnPrintCountSheet.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                AllowExport = true;
            }
            else if (wizStockTake.SelectedPage == wizStockTakeVariance)
            {
                ServerModeSourceVariance.QueryableSource = DataContext.ReadonlyContext.VW_StockTakeVariance.Where(n => n.StockTakeId == itmStockTake.Id);
                stockTake.StatusId = (byte)BL.ITM.ITM_StockTakeStatus.StocktakeCountVariance;

                wizStockTake.SelectedPage.AllowNext = SECL.SecurityLibrary.AccessGranted(SECL.AccessCodes.INSKRE02);

                if (!wizStockTake.SelectedPage.AllowNext)
                {
                    wizStockTakeVariance.DescriptionText = "Below shows you a detail stock variance" + Environment.NewLine +
                                                           "You do not have access to complete the stock take. \nPlease log in with a user that has access to finalize stock takes (INST07)." + Environment.NewLine +
                                                           "Close tab to save stock take at its current status";
                }
                btnPrintCountSheet.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
                AllowExport = true;
            }
            else if (wizStockTake.SelectedPage == wizStockTakeSummary)
            {
                AllowExport = false;
            }
            else if (wizStockTake.SelectedPage == wizStockTakeCompleted)
            {
                AllowExport = false;
            }
            if (AllowSave)
            {
                SaveSuccessful();
                OpenRecord(((DB.ITM_StockTake)BindingSource.DataSource).Id);
            }

            if (ReadOnly)
            {
                e.Page.AllowCancel            = false;
                e.Page.AllowNext              = false;
                e.Page.AllowBack              = false;
                btnPrintCountSheet.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            }
        }
        private void wizardControlActualizar_Archivo_SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
        {
            try
            {
                switch (e.Page.Name)
                {
                case "wpArchivo_Seleccionado":
                    Setear_Archivo();
                    break;

                case "wpArchivos_actuales":
                    LlenarGridViewArchivo_Plano();
                    switch (info_Archivo.CodigoLegal)
                    {
                    case "10" /*Pichincha*/:
                        Leer_y_Cargar_Excel();
                        Reg_inCorrecto = ValidarRegistros_Pichincha();
                        break;

                    case "17" /*Guayaquil*/:
                        Leer_y_Cargar_Excel();
                        Reg_inCorrecto = ValidarRegistros_Guayaquil();
                        break;

                    default:
                        break;
                    }

                    lblError.Visible = !Reg_inCorrecto;
                    Bandera_pagina   = Reg_inCorrecto;
                    break;

                case "wpArchivo_Actualizado":
                    switch (info_Archivo.CodigoLegal)
                    {
                    case "10" /*Pichincha*/:
                        //Cargar_Grilla_Actualizacion_Pichincha();
                        Cargar_Grilla_Actualizacion_Guayaquil();
                        break;

                    case "17" /*Guayaquil*/:
                        switch (info_Archivo.IdProceso_bancario)
                        {
                        case "ROL_ELECTRONICO_BG":
                            Cargar_Grilla_Transferencia_Actualizacion_Guayaquil();
                            break;

                        default:
                            Cargar_Grilla_Actualizacion_Guayaquil();
                            break;
                        }

                        break;

                    default:
                        break;
                    }
                    progressBarActualizacion.ResetText();

                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
            }
        }
Exemplo n.º 11
0
        private void wizardControl_SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
        {
            //装载原始数据
            if (e.Page.Name == "calculateSHPage")
            {
                if (txtJx1.Text == "" || btnFileSz1.Text == "" || btnFileJx2.Text == "" || btnFileSz2.Text == "" || txtJj1.Text == "" || txtJj2.Text == "")
                {
                    XtraMessageBox.Show("请填写完整信息再执行下一步", "提示");
                    return;
                }
                else
                {
                    jj1 = double.Parse(txtJj1.Text) * Math.PI / 180; //转化为弧度值
                    jj2 = double.Parse(txtJj2.Text) * Math.PI / 180; //转化为弧度值
                    NpoiCreator npcreator = new NpoiCreator();

                    jx1Dt_orgn = npcreator.ExportToDataTable(txtJx1.Text);
                    sz1Dt_orgn = npcreator.ExportToDataTable(txtSz1.Text);
                    jx2Dt_orgn = npcreator.ExportToDataTable(txtJx2.Text);
                    sz2Dt_orgn = npcreator.ExportToDataTable(txtSz2.Text);

                    //计算基准年数据
                    jx1Dt_jzn = GetJznDataTable(jx1Dt_orgn);
                    sz1Dt_jzn = GetJznDataTable(sz1Dt_orgn);
                    jx2Dt_jzn = GetJznDataTable(jx2Dt_orgn);
                    sz2Dt_jzn = GetJznDataTable(sz2Dt_orgn);

                    //计算基准值
                    //计算ΔS1、ΔS2、ΔH1、ΔH2(基线1变化量用ΔS1表示,基线2变化量用ΔS2表示,水准1变化量用ΔH1表示,水准2变化量用ΔH2表示)
                    jx1Dt_bhl = GetBhlDataTable(jx1Dt_orgn, jx1Dt_jzn);
                    sz1Dt_bhl = GetBhlDataTable(sz1Dt_orgn, sz1Dt_jzn);
                    jx2Dt_bhl = GetBhlDataTable(jx2Dt_orgn, jx2Dt_jzn);
                    sz2Dt_bhl = GetBhlDataTable(sz2Dt_orgn, sz2Dt_jzn);


                    gridControlS1.DataSource = jx1Dt_bhl;
                    gridControlS2.DataSource = jx2Dt_bhl;
                    gridControlH1.DataSource = sz1Dt_bhl;
                    gridControlH2.DataSource = sz2Dt_bhl;
                }
            }
            else if (e.Page.Name == "calculateBCDPage")
            {
                db = jx1Dt_bhl.Clone();
                dc = jx1Dt_bhl.Clone();
                bc = jx1Dt_bhl.Clone();
                for (int i = 0; i < jx1Dt_bhl.Rows.Count; i++)
                {
                    double s1_v = double.Parse(jx1Dt_bhl.Rows[i][1].ToString());
                    double s2_v = double.Parse(jx2Dt_bhl.Rows[i][1].ToString());

                    double h1_v = double.Parse(sz1Dt_bhl.Rows[i][1].ToString());
                    double h2_v = double.Parse(sz2Dt_bhl.Rows[i][1].ToString());

                    double d_v = (s1_v * Math.Sin(jj2) - s2_v * Math.Sin(jj1)) / (Math.Cos(jj1) * Math.Sin(jj2) - Math.Sin(jj1) * Math.Cos(jj2));
                    double b_v = (s1_v - d_v * Math.Cos(jj1)) / Math.Sin(jj1);
                    double c_v = (h1_v + h2_v) / 2;

                    double db_v = d_v / b_v;
                    double dc_v = d_v / c_v;
                    double bc_v = b_v / c_v;

                    string   date     = jx1Dt_bhl.Rows[i][0].ToString();
                    DateTime datetime = DateTime.ParseExact(date, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture);

                    datetime.AddYears(int.Parse(date.Substring(0, 4)));

                    DataRow db_dr = db.NewRow();
                    db_dr[0] = datetime.ToShortDateString();
                    db_dr[1] = Math.Round(db_v, 4);
                    db.Rows.Add(db_dr);

                    DataRow dc_dr = dc.NewRow();
                    dc_dr[0] = datetime.ToShortDateString();
                    dc_dr[1] = Math.Round(dc_v, 4);
                    dc.Rows.Add(dc_dr);

                    DataRow bc_dr = bc.NewRow();
                    bc_dr[0] = datetime.ToShortDateString();
                    bc_dr[1] = Math.Round(bc_v, 4);
                    bc.Rows.Add(bc_dr);
                }

                gridControldb.DataSource = db;
                gridControldc.DataSource = dc;
                gridControlbc.DataSource = bc;
            }
        }
Exemplo n.º 12
0
 private void wizardControl1_SelectedPageChanged(object sender, DevExpress.XtraWizard.WizardPageChangedEventArgs e)
 {
     cbFormaPagto.ShowPopup();
     cbFormaPagto.Focus();
 }