Example #1
0
        public void TestSMTCopy()
        {
            persistBroker = new OLEDBPersistBroker("Provider=OraOLEDB.Oracle.1;Password=emes;Persist Security Info=True;User ID=emes;Data Source=sqcdemo");

            // clear data

            // insert info of MO UT_MOCODE1
            string sql = "INSERT INTO TBLSMTRESBOM (MOCODE,ROUTECODE,OPCODE,RESCODE,STATIONCODE,ITEMCODE,OPBOMCODE,OPBOMVER,LOTNO,PCBA,BIOS,VERSION,VENDERITEMCODE,VENDORCODE,DATECODE,FEEDERCODE,MUSER,MDATE,MTIME,EATTRIBUTE1,OBITEMCODE) VALUES ('UT_MOCODE1','UT_ROUTECODE1','UT_OPERATIONCODE1','UT_RESOURCE1','{0}','UT_ITEMCODE1','UT_ROUTECODE1','OPBOMVER1','LOTNO','PCBA','BIOS','VERSION','VENDERITEMCODE','VENDORCODE','DATECODE','FEEDER1','vizo UnitTest',20050509,0,NULL,'P007-10594-03')";

            persistBroker.Execute(string.Format(sql, "UT_STATION1"));
            persistBroker.Execute(string.Format(sql, "UT_STATION2"));
            persistBroker.Execute(string.Format(sql, "UT_STATION3"));



            // copy from UT_MOCODE1 to UT_MOCODE2
            BenQGuru.eMES.SMT.SMTFacade facade = new BenQGuru.eMES.SMT.SMTFacade();
            facade.CopySMTResourceBOM("UT_MOCODE1", "UT_MOCODE2", "UT_ROUTECODE1", "UT_OPERATIONCODE1", "UT_RESOURCE1");

            // check smtbom count of  UT_MOCODE2
            int cnt1 = facade.QuerySMTResourceBOMCount(string.Empty, "UT_MOCODE1", string.Empty, string.Empty, string.Empty, string.Empty);
            int cnt2 = facade.QuerySMTResourceBOMCount(string.Empty, "UT_MOCODE2", string.Empty, string.Empty, string.Empty, string.Empty);

            // clear data
            sql = "delete from tblsmtresbom where mocode like 'UT_%'";
            persistBroker.Execute(sql);

            Console.WriteLine("cnt1={0} , cnt2={1}", cnt1, cnt2);
            Assert.AreEqual(cnt1, cnt2);
            Assert.AreEqual(3, cnt1);
        }
Example #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            this.txtMaxCountEdit.Attributes.Add("onkeyup", "CalAlertCount()");
            if (!this.IsPostBack)
            {
                // 初始化页面语言
                this.InitPageLanguage(this.languageComponent1, false);

                if (_facade == null)
                {
                    _facade = new SMTFacadeFactory(base.DataProvider).Create();
                }
                object[] objSpec = _facade.GetAllFeederSpec();
                if (objSpec != null)
                {
                    this.ddlFeederSpecCodeQuery.Items.Add(string.Empty);
                    for (int i = 0; i < objSpec.Length; i++)
                    {
                        FeederSpec spec = (FeederSpec)objSpec[i];
                        this.ddlFeederSpecCodeQuery.Items.Add(new ListItem(spec.FeederSpecCode, spec.FeederSpecCode));
                        this.ddlFeederSpecCodeEdit.Items.Add(new ListItem(spec.FeederSpecCode, spec.FeederSpecCode));
                    }
                }

                SystemParameterListBuilder _builder = new SystemParameterListBuilder("FEEDERTYPE", base.DataProvider);
                //_builder.Build(this.ddlFeederTypeEdit);
                this.ddlFeederTypeEdit.Items.Add(new ListItem("CP", "CP"));
                _builder = new SystemParameterListBuilder("FEEDERSTATUS", base.DataProvider);
                _builder.Build(this.ddlStatusQuery);
                _builder.AddAllItem(this.languageComponent1);
            }
        }
Example #3
0
        protected override object GetEditObject()
        {
            if (_facade == null)
            {
                _facade = new SMTFacadeFactory(base.DataProvider).Create();
            }
            Reel reel = this._facade.CreateNewReel();

            reel.ReelNo = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtReelNoEdit.Text, 40));
            Reel reelTmp = (Reel)_facade.GetReel(reel.ReelNo);

            if (reelTmp != null)
            {
                reel = reelTmp;
            }
            reel.PartNo       = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPartNoEdit.Text, 40));
            reel.Qty          = Convert.ToDecimal(this.txtQtyEdit.Text);
            reel.LotNo        = this.txtLotNoEdit.Text.Trim().ToUpper();
            reel.DateCode     = this.txtDateCodeEdit.Text.Trim().ToUpper();
            reel.MaintainUser = this.GetUserCode();
            reel.MaintainDate = FormatHelper.TODateInt(DateTime.Today);
            reel.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);

            return(reel);
        }
Example #4
0
 protected override void AddDomainObject(object domainObject)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     this._facade.AddReel((Reel)domainObject);
 }
 protected override void UpdateDomainObject(object domainObject)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     this._facade.UpdateSMTSensorQtyDifferenceReason(this.txtMOCode.Text, this.txtShiftDay.Text, this.txtTPCode.Text, this.txtDiffReason.Text, this.GetUserCode());
 }
Example #6
0
 protected override void DeleteDomainObjects(ArrayList domainObjects)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     this._facade.DeleteFeeder((Feeder[])domainObjects.ToArray(typeof(Feeder)));
 }
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(_facade.CheckSMTMaterial(this.txtMOCodeQuery.Text.Trim().ToUpper(), this.txtSSCodeQuery.Text.Trim().ToUpper(), this.GetUserCode(), false));
 }
Example #8
0
 protected override void UpdateDomainObject(object domainObject)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     this._facade.UpdateFeeder((Feeder)domainObject);
 }
Example #9
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QueryFeederSpecCount(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtFeederSpecCodeQuery.Text))));
 }
Example #10
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QuerySMTFeederMaterialImportLogDetailCount(
                this.GetRequestParam("logno")));
 }
Example #11
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QueryReelValidityCount(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMaterialPrefixQuery.Text))));
 }
Example #12
0
 protected void cmdSave_ServerClick(object sender, EventArgs e)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     this._facade.UpdateSMTTargetQty(this.drpSegmentCode.SelectedValue, this.drpSSCode.SelectedValue, this.txtMOCode.Text.Trim().ToUpper(), decimal.Parse(this.txtQtyPerHour.Text), this.GetUserCode());
     this.cmdQuery_Click(null, null);
 }
Example #13
0
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QuerySMTFeederMaterialImportLogDetail(
                this.GetRequestParam("logno"),
                inclusive, exclusive));
 }
Example #14
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QueryStationCount(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtStationCodeQuery.Text)),
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.drpResourceCodeQuery.SelectedValue))));
 }
Example #15
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QuerySMTRCardMaterialDetailCount(
                this.txtMOCodeQuery.Text.Trim().ToUpper(),
                this.txtRCardQuery.Text.Trim().ToUpper()));
 }
Example #16
0
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QueryFeederSpec(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtFeederSpecCodeQuery.Text)),
                inclusive, exclusive));
 }
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QueryRptMOTimePeriodActualQtyCount(
                this.txtMOCodeQuery.Text.Trim().ToUpper(),
                this.txtTPCodeQuery.Text.Trim().ToUpper()));
 }
Example #18
0
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QueryStation(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtStationCodeQuery.Text)),
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.drpResourceCodeQuery.SelectedValue)),
                inclusive, exclusive));
 }
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QuerySMTMachineDiscardCount(
                this.txtMOCodeQuery.Text.Trim().ToUpper(),
                this.txtSSCodeQuery.Text.Trim().ToUpper()
                ));
 }
 //protected override void cmdQuery_Click(object sender, EventArgs e)
 //{
 //    base.cmdQuery_Click(sender, e);
 //    foreach (GridRecord row in this.gridWebGrid.Rows)
 //    {
 //        if (qty.ActualQty < qty.CurrentQty && qty.MaintainDate == 0)
 //        {
 //            DateTime dtEnd = Convert.ToDateTime(FormatHelper.ToDateString(qty.Day) + " " + FormatHelper.ToTimeString(qty.TPEndTime));
 //            if (dtEnd < DateTime.Now)
 //            {
 //                row.CssClass = "ForeColorRed";
 //            }
 //        }
 //    }
 //    //base.cmdQuery_Click(sender, e);
 //}
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QueryRptMOTimePeriodActualQty(
                this.txtMOCodeQuery.Text.Trim().ToUpper(),
                this.txtTPCodeQuery.Text.Trim().ToUpper(),
                inclusive, exclusive));
 }
Example #21
0
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QuerySMTRCardMaterialDetail(
                this.txtMOCodeQuery.Text.Trim().ToUpper(),
                this.txtRCardQuery.Text.Trim().ToUpper(),
                inclusive, exclusive));
 }
Example #22
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QueryMOMaterialRptCount(
                this.txtMOCodeQuery.Text.Trim().ToUpper(),
                this.txtLineCodeQuery.Text.Trim().ToUpper(),
                this.txtMaterialCodeQuery.Text.Trim().ToUpper(),
                this.txtMachineStationCodeQuery.Text.Trim().ToUpper()));
 }
Example #23
0
 protected override void UpdateDomainObject(object domainObject)
 {
     if (FormatHelper.StringToBoolean(((Reel)domainObject).UsedFlag) == true)
     {
         throw new Exception("$SMT_Prepare_Reel_Used_Already");
     }
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     this._facade.UpdateReel((Reel)domainObject);
 }
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QuerySMTFeederMaterialImportLogCount(
                this.txtItemCodeQuery.Text.Trim().ToUpper(),
                this.txtSSCodeQuery.Text.Trim().ToUpper(),
                this.txtImportUserQuery.Text.Trim().ToUpper(),
                FormatHelper.TODateInt(this.txtImportDate.Text).ToString()));
 }
Example #25
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QueryFeederStatusLogCount(
                this.txtConditionItem.Text.Trim().ToUpper(),
                this.txtConditionMo.Text.Trim().ToUpper(),
                this.txtSSCode.Text.Trim().ToUpper(),
                this.txtFeederSpecCode.Text.Trim().ToUpper(),
                this.txtFeederCode.Text.Trim().ToUpper()));
 }
Example #26
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QuerySMTFeederMaterialCount(
                this.txtItemCodeQuery.Text.Trim().ToUpper(),
                this.txtSSCodeQuery.Text.Trim().ToUpper(),
                this.txtMachineCodeQuery.Text.Trim().ToUpper(),
                string.Empty,
                string.Empty));
 }
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QuerySMTFeederMaterialImportLog(
                this.txtItemCodeQuery.Text.Trim().ToUpper(),
                this.txtSSCodeQuery.Text.Trim().ToUpper(),
                this.txtImportUserQuery.Text.Trim().ToUpper(),
                FormatHelper.TODateInt(this.txtImportDate.Text).ToString(),
                inclusive, exclusive));
 }
Example #28
0
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QueryMOMaterialRpt(
                this.txtMOCodeQuery.Text.Trim().ToUpper(),
                this.txtLineCodeQuery.Text.Trim().ToUpper(),
                this.txtMaterialCodeQuery.Text.Trim().ToUpper(),
                this.txtMachineStationCodeQuery.Text.Trim().ToUpper(),
                inclusive, exclusive));
 }
Example #29
0
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_facade == null)
     {
         _facade = new SMTFacadeFactory(base.DataProvider).Create();
     }
     return(this._facade.QuerySMTFeederMaterial(
                this.txtItemCodeQuery.Text.Trim().ToUpper(),
                this.txtSSCodeQuery.Text.Trim().ToUpper(),
                this.txtMachineCodeQuery.Text.Trim().ToUpper(),
                string.Empty,
                string.Empty,
                inclusive, exclusive));
 }
Example #30
0
        protected void cmdImport_ServerClick(object sender, System.EventArgs e)
        {
            if (_facade == null)
            {
                _facade = new SMTFacade(base.DataProvider);
            }
            if (items == null)
            {
                items = GetAllItem();
                if (items == null || items.Length == 0)
                {
                    return;
                }
            }
            string strMessage = "";

            ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.OpenConnection();
            this.DataProvider.BeginTransaction();
            try
            {
                int iRet = this._facade.ImportSMTMachineDiscard(items, this.GetUserCode());
                this.DataProvider.CommitTransaction();
                if (iRet > 0)
                {
                    strMessage             = languageComponent1.GetString("$SMTMachineDiscard_Import_Success");
                    this.cmdEnter.Disabled = true;
                }
                else
                {
                    strMessage = languageComponent1.GetString("$SMTMachineDiscard_Import_Error");
                }
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                throw ex;
            }
            finally
            {
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
            }
            string alertInfo =
                string.Format("<script language=javascript>alert('{0}');</script>", strMessage);

            if (!this.IsClientScriptBlockRegistered("ImportAlert"))
            {
                this.RegisterClientScriptBlock("ImportAlert", alertInfo);
            }
            items = null;
        }