Example #1
0
//		protected override ControlLibrary.Web.Language.LanguageComponent GetLanguageComponent()
//		{
//			return this.languageComponent1;
//		}

        private void InitPageValue()
        {
            this.txtMinDutyRatoMin.Text = string.Empty;
            this.txtMinDutyRatoMax.Text = string.Empty;
            this.txtBurstMdFreMin.Text  = string.Empty;
            this.txtBurstMdFreMax.Text  = string.Empty;
            this.txtElectricCount.Text  = "0";
            this.txtGroupCount.Text     = "0";

            if (_facade == null)
            {
                _facade = new OQCFacadeFactory(base.DataProvider).CreateOQCFacade();
            }
            object objMain = _facade.GetOQCFuncTest(this.txtItemCode.Text);

            if (objMain == null)
            {
                return;
            }
            OQCFuncTest testMain = (OQCFuncTest)objMain;

            this.txtMinDutyRatoMin.Text = testMain.MinDutyRatoMin.ToString("##.##");
            this.txtMinDutyRatoMax.Text = testMain.MinDutyRatoMax.ToString("##.##");
            this.txtBurstMdFreMin.Text  = testMain.BurstMdFreMin.ToString("##.##");;
            this.txtBurstMdFreMax.Text  = testMain.BurstMdFreMax.ToString("##.##");;
            this.txtElectricCount.Text  = Convert.ToInt32(testMain.ElectricTestCount).ToString();
            this.txtGroupCount.Text     = Convert.ToInt32(testMain.FuncTestGroupCount).ToString();

            itemGroupValue = _facade.QueryOQCFuncTestSpec(this.txtItemCode.Text);

            InitGridView();
        }
Example #2
0
        protected void cmdSave_ServerClick(object sender, EventArgs e)
        {
            if (CheckData() == false)
            {
                return;
            }

            try
            {
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)base.DataProvider).PersistBroker.OpenConnection();
                if (_facade == null)
                {
                    _facade = new OQCFacadeFactory(base.DataProvider).CreateOQCFacade();
                }
                OQCFuncTest test   = (OQCFuncTest)_facade.GetOQCFuncTest(this.txtItemCode.Text);
                bool        bIsNew = false;
                if (test == null)
                {
                    bIsNew = true;
                    test   = new OQCFuncTest();
                }
                test.ItemCode           = this.txtItemCode.Text;
                test.FuncTestGroupCount = Convert.ToDecimal(this.txtGroupCount.Text);
//				test.MinDutyRatoMin = 0;
//				test.MinDutyRatoMax = 0;
//				test.BurstMdFreMin = 0;
//				test.BurstMdFreMax = 0;
                test.ElectricTestCount = Convert.ToDecimal(this.txtElectricCount.Text);
                test.MaintainUser      = this.GetUserCode();
                test.MaintainDate      = FormatHelper.TODateInt(DateTime.Today);
                test.MaintainTime      = FormatHelper.TOTimeInt(DateTime.Now);
                if (bIsNew == true)
                {
                    _facade.AddOQCFuncTest(test);
                }
                else
                {
                    _facade.UpdateOQCFuncTest(test);
                }

//				string strSql = "DELETE FROM tblOQCFuncTestSpec WHERE ItemCode='" + this.txtItemCode.Text + "'";
//				this.DataProvider.CustomExecute(new SQLCondition(strSql));
//
//				for (int i = 0; i < this.gridWebGrid.Rows.Count; i++)
//				{
//					OQCFuncTestSpec spec = new OQCFuncTestSpec();
//					spec.ItemCode = this.txtItemCode.Text;
//					spec.GroupSequence = i;
//					spec.FreMin = Convert.ToDecimal(this.gridWebGrid.Rows[i].Cells.FromKey("FreMin").Value);
//					spec.FreMax = Convert.ToDecimal(this.gridWebGrid.Rows[i].Cells.FromKey("FreMax").Value);
//					spec.ElectricMin = Convert.ToDecimal(this.gridWebGrid.Rows[i].Cells.FromKey("ElectricMin").Value);
//					spec.ElectricMax = Convert.ToDecimal(this.gridWebGrid.Rows[i].Cells.FromKey("ElectricMax").Value);
//					spec.MaintainUser = this.GetUserCode();
//					spec.MaintainDate = FormatHelper.TODateInt(DateTime.Today);
//					spec.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);
//					_facade.AddOQCFuncTestSpec(spec);
//				}
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)base.DataProvider).PersistBroker.CommitTransaction();
            }
            catch (Exception ex)
            {
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)base.DataProvider).PersistBroker.RollbackTransaction();
                throw ex;
            }
            finally
            {
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)base.DataProvider).PersistBroker.CloseConnection();
            }
        }