コード例 #1
0
        /// <summary>
        /// 添加强制下线试验信息
        /// </summary>
        /// <param name="data">要添加的数据</param>
        public void AddForcedOffLineTestInfo(ZPX_ForcedOffLineTest data)
        {
            DepotManagementDataContext ctx = CommentParameter.DepotDataContext;

            data.RecordTime = ServerTime.Time;

            ctx.ZPX_ForcedOffLineTest.InsertOnSubmit(data);

            ctx.SubmitChanges();
        }
コード例 #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (GlobalObject.GeneralFunction.IsNullOrEmpty(txtProductNumber.Text) || GlobalObject.GeneralFunction.IsNullOrEmpty(txtReason.Text))
            {
                MessageDialog.ShowPromptMessage("请录入产品编号及原因后再进行此操作");
                return;
            }

            string error;

            string[] info = txtProductNumber.Text.Split(new char[] { ' ' });

            if (!SCM_Level02_ServerFactory.GetServerModule <IProductCodeServer>().VerifyProductCodesInfo(
                    info[0], info[1], GlobalObject.CE_BarCodeType.内部钢印码, out error))
            {
                MessageDialog.ShowErrorMessage(error);

                txtProductNumber.Focus();

                return;
            }

            ZPX_ForcedOffLineTest data = new ZPX_ForcedOffLineTest();

            data.ProductNumber = txtProductNumber.Text;
            data.Reason        = txtReason.Text;
            data.Recorder      = GlobalObject.BasicInfo.LoginID;

            try
            {
                m_testServer.AddForcedOffLineTestInfo(data);

                RefreshData();

                MessageDialog.ShowPromptMessage("操作成功!");
            }
            catch (Exception exce)
            {
                MessageDialog.ShowErrorMessage(exce.Message);
            }
        }