Ejemplo n.º 1
0
        /// <summary>
        /// 表空间扩容
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnTableSpaceAdd_Click(object sender, EventArgs e)
        {
            if (MsgBoxEx.ConfirmYesNo("Are you sure to add the tablespace") == DialogResult.No)
            {
                return;
            }

            ShowLoading(ToopEnum.loading);

            try
            {
                IwrService service = wrService.GetService();
                var        rs      = service.AddTableSpace("");

                if (rs)
                {
                    MsgBoxEx.Info("Please restart the program.");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                CloseLoading();
            }
        }
Ejemplo n.º 2
0
        private void btnDbImp_Click(object sender, EventArgs e)
        {
            if (MsgBoxEx.ConfirmYesNo("Are you sure to import the file") == DialogResult.No)
            {
                return;
            }

            if (string.IsNullOrEmpty(cbxFiles.Text))
            {
                MsgBoxEx.Info("Please select a file to import.");
                return;
            }

            ShowLoading(ToopEnum.loading);

            IwrService service = wrService.GetService();
            var        rs      = service.ImpOrExpDatabase("1", cbxFiles.Text) >= 0;

            if (rs)
            {
                cbxFiles.Items.AddRange(service.GetDBFilesList().ToArray());
            }

            CloseLoading();
        }
Ejemplo n.º 3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (MsgBoxEx.ConfirmYesNo("Are you sure to delete the data") == DialogResult.No)
            {
                return;
            }

            DataOperation(2);
        }
Ejemplo n.º 4
0
        private void btnRecovery_Click(object sender, EventArgs e)
        {
            if (MsgBoxEx.ConfirmYesNo("Are you sure to recovery the data") == DialogResult.No)
            {
                return;
            }

            DataOperation(1);

            DataCache.RefreshCache();
        }
Ejemplo n.º 5
0
        private void btnDbExp_Click(object sender, EventArgs e)
        {
            if (MsgBoxEx.ConfirmYesNo("Are you sure to back up the database") == DialogResult.No)
            {
                return;
            }

            ShowLoading(ToopEnum.loading);

            IwrService service = wrService.GetService();

            service.ImpOrExpDatabase("0");

            CloseLoading();
            //timer1.Enabled = true;
        }
Ejemplo n.º 6
0
        private void picClose_Click(object sender, EventArgs e)
        {
            if (MsgBoxEx.ConfirmYesNo("Are you sure to exit?") == DialogResult.No)
            {
                return;
            }

            if (frm.GetType().Name == "frm_preview")
            {
                var frmP = frm as frm_preview;

                frm.Close();
            }

            this.Close();
        }
Ejemplo n.º 7
0
        private void tlDel_Click(object sender, EventArgs e)
        {
            if (grdData.SelectedRows == null || grdData.SelectedRows.Count < 1)
            {
                return;
            }

            if (MsgBoxEx.ConfirmYesNo("Are you sure to delete the record?") == DialogResult.No)
            {
                return;
            }

            string id = grdData.SelectedRows[0].Cells["ColCode"].Value.ToString();

            IsysService service = sysService.GetService();

            service.DelRole(id);

            tlSearch.PerformClick();
        }
Ejemplo n.º 8
0
        private void btnArchive_Click(object sender, EventArgs e)
        {
            if (MsgBoxEx.ConfirmYesNo("Are you sure to archive the data") == DialogResult.No)
            {
                return;
            }

            DataOperation(0);

            DataCache.RefreshCache();

            IsysService service = sysService.GetService();

            var entity = service.GetCmn("3021").FirstOrDefault(s => s.CODE == "0");

            if (entity != null)
            {
                txtArchiveDate.Text = entity.VALUE;
            }
        }
Ejemplo n.º 9
0
        private void tlDel_Click(object sender, EventArgs e)
        {
            if (grdLibrary.SelectedRows == null || grdLibrary.SelectedRows.Count < 1)
            {
                return;
            }

            if (MsgBoxEx.ConfirmYesNo("Are you sure to delete the record?") == DialogResult.No)
            {
                return;
            }

            string id = grdLibrary.SelectedRows[0].Cells["lid"].Value.ToString();

            IwrService service = wrService.GetService();

            service.DeleteLibray(id, DataCache.UserInfo.ID);

            tlSearch.PerformClick();
        }
Ejemplo n.º 10
0
        private void tlPlanDelete_Click(object sender, EventArgs e)
        {
            if (grdPlan.SelectedRows == null || grdPlan.SelectedRows.Count < 1)
            {
                MsgBoxEx.Info("Please select Delete data");
                return;
            }

            if (MsgBoxEx.ConfirmYesNo("Are you sure to delete the record?") == DialogResult.No)
            {
                return;
            }

            string id = grdPlan.SelectedRows[0].Cells["pid"].Value.ToString();

            IwrService service = wrService.GetService();

            service.DeletePlan(id, DataCache.UserInfo.ID);

            tlPlanRefresh.PerformClick();
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 显示窗体
        /// </summary>
        /// <param name="text"></param>
        private void ShowForm(string text)
        {
            if (pnlContext.Controls.Count > 0)
            {
                foreach (Control item in pnlContext.Controls)
                {
                    if (item is Form && item.Name != "frm_report" && item.Name != "frm_review")
                    {
                        ((Form)item).Close();

                        pnlContext.Controls.Remove(item);
                    }
                    else
                    {
                        item.Hide();
                    }
                }

                //pnlContext.Controls.Clear();
            }

            switch (text)
            {
            case "Wafer Selection":
                string tmpresultid = "";
                if (frm != null && frm.Name == "frm_preview")
                {
                    tmpresultid = ((frm_preview)frm).Resultid;
                }

                if (pnlContext.Controls.ContainsKey("frm_review"))
                {
                    frm = (frm_review)pnlContext.Controls.Find("frm_review", false)[0];
                }
                else
                {
                    frm = new frm_review();
                }
                ((frm_review)frm).selectedResultid = tmpresultid;
                frm.frmMain = this;
                break;

            case "Wafer Review":
                if (DataCache.HasExam)
                {
                    frm = new frm_paper();
                    //((frm_paper)frm).Oparams = Oparams;
                }
                else
                {
                    frm = new frm_preview();
                    ((frm_preview)frm).Oparams = Oparams;
                }
                frm.frmMain = this;
                break;

            case "Defect Report":
                //if (frmReport == null)
                //{
                //    frm = new frm_report();
                //    frmReport = frm;
                //}
                //else
                //{
                //    frm = frmReport;
                //    frm.Visible = true;
                //}
                if (pnlContext.Controls.ContainsKey("frm_report"))
                {
                    var frmReport = (frm_report)pnlContext.Controls.Find("frm_report", false)[0];
                    frmReport.ReportSelected();
                    frm = frmReport;
                }
                else
                {
                    frm = new frm_report();
                }

                ((frm_report)frm).Oparams = Oparams;
                frm.frmMain = this;
                break;

            case "Data Manage":
                frm = new frm_Archive();
                //((frm_Archive)frm).Oparams = Oparams;
                frm.frmMain = this;
                break;

            case "Exam Manage":
                frm         = new frm_exam();
                frm.frmMain = this;
                break;

            case "- Change Password":
                frm         = new frm_changepwd();
                frm.frmMain = this;
                break;

            //case "- Configurations":
            //    frm = new frm_config();
            //    break;
            case "- Options":
                //frm = new frm_options();
                frm = new frm_config();
                break;

            case "- User":
                frm = new frm_user();
                break;

            case "- Role":
                frm = new frm_role();
                break;

            case "Logout":
                _focusedWrMenuItem    = null;
                mnuLogout.ItemBgColor = Color.Transparent;

                if (MsgBoxEx.ConfirmYesNo(MessageConst.frm_main_msg001) != DialogResult.Yes)
                {
                    return;
                }

                pnlLeft.Enabled = false;
                pnlLeft.Width   = 12;
                lblArrow.Image  = global::WR.Client.UI.Properties.Resources.pright;
                ShowForm("");

                return;

            default:
                frm         = new frm_login();
                frm.frmMain = this;
                break;
            }

            frm.TopLevel        = false;
            frm.FormBorderStyle = FormBorderStyle.None;
            frm.Dock            = DockStyle.Fill;
            frm.Parent          = pnlContext;
            frm.Tag             = this;

            frm.Show();
        }