private void RefreshData(bool bool_JustFill)
 {
     if (this.myEventArgs_WPSQuery == null)
     {
         this.myEventArgs_WPSQuery = new EventArgs_WPSQuery(null);
     }
     this.myEventArgs_WPSQuery.bool_JustFill = bool_JustFill;
     Publisher_WPSQuery.OnEventName(this.myEventArgs_WPSQuery);
 }
 private void UserControl_WPSDataGridView_Load(object sender, EventArgs e)
 {
     Publisher_WPSQuery.EventName += new EventHandler_WPSQuery(InitDataGridView);
     if (this.myEventArgs_WPSQuery == null)
     {
         this.myEventArgs_WPSQuery = new EventArgs_WPSQuery(null);
     }
     Publisher_WPSQuery.OnEventName(this.myEventArgs_WPSQuery);
 }
Beispiel #3
0
        private void button_pWPSQueryAdvance_Click(object sender, EventArgs e)
        {
            Form_QueryFilter myForm = new Form_QueryFilter();
            myForm.InitControl(Enum_DataTable.WPS.ToString());
            if (myForm.ShowDialog() == DialogResult.OK)
            {
                EventArgs_WPSQuery g = new EventArgs_WPSQuery(myForm.str_Filter);
                Publisher_WPSQuery.OnEventName(g);
            }

        }
        private void InitDataGridView(object sender, EventArgs_WPSQuery e)
        {
            Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.WPS.ToString(), false);
            this.dataGridView_Data.Columns["isLocked"].DefaultCellStyle.ForeColor                  = Properties.Settings.Default.WPSLockedColor;
            this.dataGridView_Data.Columns["isLocked"].DefaultCellStyle.Alignment                  = DataGridViewContentAlignment.MiddleCenter;
            this.dataGridView_Data.Columns["WPSMaterialSecond"].DefaultCellStyle.ForeColor         = Properties.Settings.Default.WPSLockedColor;
            this.dataGridView_Data.Columns["WPSWorkPieceTypeSecond"].DefaultCellStyle.ForeColor    = Properties.Settings.Default.WPSLockedColor;
            this.dataGridView_Data.Columns["WPSThicknessSecond"].DefaultCellStyle.ForeColor        = Properties.Settings.Default.WPSLockedColor;
            this.dataGridView_Data.Columns["WPSExternalDiameterSecond"].DefaultCellStyle.ForeColor = Properties.Settings.Default.WPSLockedColor;

            this.myEventArgs_WPSQuery = e;
            Class_Data myClass_Data;

            myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.WPS.ToString()];
            myClass_Data.SetFilter(this.myEventArgs_WPSQuery.str_Filter);
            if (this.myEventArgs_WPSQuery.bool_JustFill)
            {
                if (this.myDataTable.Rows.Count == 0)
                {
                    this.dataGridView_Data.DataSource = null;
                    myClass_Data.RefreshData(this.myEventArgs_WPSQuery.bool_JustFill);
                    this.myDataTable = myClass_Data.myDataTable.Copy();
                    this.myDataView  = new DataView(this.myDataTable);
                    this.dataGridView_Data.DataSource = this.myDataView;
                }
                else
                {
                    myClass_Data.RefreshData(this.myEventArgs_WPSQuery.bool_JustFill, this.myDataTable);
                }
            }
            else
            {
                this.dataGridView_Data.DataSource = null;
                myClass_Data.RefreshData(this.myEventArgs_WPSQuery.bool_JustFill);
                this.myDataTable = myClass_Data.myDataTable.Copy();
                this.myDataView  = new DataView(this.myDataTable);
                this.dataGridView_Data.DataSource = this.myDataView;
            }
            if (string.IsNullOrEmpty(((DataView)this.dataGridView_Data.DataSource).Sort))
            {
                ((DataView)this.dataGridView_Data.DataSource).Sort = myClass_Data.myDataView.Sort;
            }
            this.label_Data.Text = string.Format("焊接工艺基本信息,({0}):", this.dataGridView_Data.RowCount);
            if (this.dataGridView_Data.RowCount == 0)
            {
                //EventArgs_Issue my_e = new EventArgs_Issue(null, this.myEventArgs_ShipClassification.bool_GXTheory);
                //Publisher_Issue.OnEventName(my_e);
            }
        }
Beispiel #5
0
        private void button_pWPSQuery_Click(object sender, EventArgs e)
        {
            string str_Filter = "1=1";
            if (this.checkBox_Mistiness.Checked)
            {
                if (this.textBox_pWPSIDBegin.Text.Length > 0)
                {
                     if (string.IsNullOrEmpty(this.textBox_pWPSIDEnd.Text))
                    {
                        str_Filter = str_Filter + string.Format(" And WPSID like '%{0}%'", this.textBox_pWPSIDBegin.Text);
                    }
                    else
                    {
                        str_Filter = str_Filter + string.Format(" And (WPSID >= '{0}' And WPSID <= '{1}')", this.textBox_pWPSIDBegin.Text, this.textBox_pWPSIDEnd.Text);
                    }
                }
                if (this.textBox_pWPSDenomination.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSDenomination like '%{0}%'", this.textBox_pWPSDenomination.Text);
                }
                if (this.textBox_pWPSWeldingProcessAb.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSWeldingProcessAb like '%{0}%'", this.textBox_pWPSWeldingProcessAb.Text);
                }
                if (this.textBox_pWPSMaterial.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And (WPSMaterial like '%{0}%' Or WPSMaterialSecond like '%{0}%')", this.textBox_pWPSMaterial.Text);
                }
                if (this.textBox_pWPSWeldingConsumable.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSWeldingConsumable like '%{0}%'", this.textBox_pWPSWeldingConsumable.Text);
                }
                if (this.textBox_pWPSWeldingPosition.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSWeldingPosition like '%{0}%'", this.textBox_pWPSWeldingPosition.Text);
                }
                if (this.comboBox_pWPSGrooveType.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSGrooveType like '%{0}%'", this.comboBox_pWPSGrooveType.Text);
                }
                if (this.comboBox_pWPSJointType .Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSJointType like '%{0}%'", this.comboBox_pWPSJointType.Text);
                }
                double dbl_pWPSThickness=0;
                double.TryParse(this.textBox_pWPSThickness.Text, out dbl_pWPSThickness);
                if (dbl_pWPSThickness > 0)
                {
                    str_Filter = str_Filter + string.Format(" And (WPSThickness = {0} or WPSThicknessSecond = {0})", dbl_pWPSThickness);
                }
            }
            else
            {
                if (this.textBox_pWPSIDBegin.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSID = '{0}'", this.textBox_pWPSIDBegin.Text);
                }
                if (this.textBox_pWPSDenomination.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSDenomination = '{0}'", this.textBox_pWPSDenomination.Text);
                }
                if (this.textBox_pWPSWeldingProcessAb.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSWeldingProcessAb = '{0}'", this.textBox_pWPSWeldingProcessAb.Text);
                }
                if (this.textBox_pWPSMaterial.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And (WPSMaterial = '{0}' Or WPSMaterialSecond = '{0}')", this.textBox_pWPSMaterial.Text);
                }
                if (this.textBox_pWPSWeldingConsumable.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSWeldingConsumable = '{0}'", this.textBox_pWPSWeldingConsumable.Text);
                }
                if (this.textBox_pWPSWeldingPosition.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSWeldingPosition = '{0}'", this.textBox_pWPSWeldingPosition.Text);
                }
                if (this.comboBox_pWPSGrooveType.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSGrooveType = '{0}'", this.comboBox_pWPSGrooveType.Text);
                }
                if (this.comboBox_pWPSJointType.Text.Length > 0)
                {
                    str_Filter = str_Filter + string.Format(" And WPSJointType = '{0}'", this.comboBox_pWPSJointType.Text);
                }
                double dbl_pWPSThickness = 0;
                double.TryParse(this.textBox_pWPSThickness.Text, out dbl_pWPSThickness);
                if (dbl_pWPSThickness > 0)
                {
                    str_Filter = str_Filter + string.Format(" And (WPSThickness = {0} or WPSThicknessSecond = {0})", dbl_pWPSThickness);
                }
            }

            EventArgs_WPSQuery g = new EventArgs_WPSQuery(str_Filter);
            Publisher_WPSQuery.OnEventName(g);

        }