Пример #1
0
        public void GetInfByLotNum(string lotNumber)
        {
            HighOfSFinishedProductsEngine highOfFinished = new HighOfSFinishedProductsEngine();
            DataSet dtGetHighInfByLotNum = highOfFinished.GetHighInfByLotNum(lotNumber);

            if (dtGetHighInfByLotNum.Tables[0].Rows.Count > 0)
            {
                version = Convert.ToInt32(dtGetHighInfByLotNum.Tables[0].Rows[0]["GWJ_VERSION"].ToString());
            }
            this.gcItems.DataSource = dtGetHighInfByLotNum.Tables[0];

            this.txtLotNumber.Properties.ReadOnly = true;
        }
Пример #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (gridView1.DataSource == null)
            {
                MessageService.ShowMessage("没有要保存的数据!", "${res:Global.SystemInfo}");
                return;
            }
            string lotNumber = this.txtLotNumber.Text.ToString().Trim();

            try
            {
                if (MessageBox.Show(StringParser.Parse("是否保存当前高位检的信息?"),
                                    StringParser.Parse("${res:Global.SystemInfo}"), MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    if (this.gridView1.State == GridState.Editing && this.gridView1.IsEditorFocused && this.gridView1.EditingValueModified)
                    {
                        this.gridView1.SetFocusedRowCellValue(this.gridView1.FocusedColumn, this.gridView1.EditingValue);
                    }
                    this.gridView1.UpdateCurrentRow();
                    string name = PropertyService.Get(PROPERTY_FIELDS.USER_NAME_MZ);
                    HighOfSFinishedProductsEngine highOfFinished = new HighOfSFinishedProductsEngine();
                    DataTable dtGvlist = ((DataView)gridView1.DataSource).Table;

                    bool dsreturn = highOfFinished.InsertIntoGWJ(dtGvlist, lotNumber);

                    if (dsreturn == true)
                    {
                        this.txtLotNumber.Properties.ReadOnly = false;
                        this.txtLotNumber.Focus();
                        this.txtLotNumber.SelectAll();
                        this.gcItems.DataSource = null;

                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowMessage(ex.Message, "${res:Global.SystemInfo}");
                return;
            }
        }