Exemple #1
0
        protected override void AddDomainObject(object domainObject)
        {
            if (_iqcfacade == null)
            {
                _iqcfacade = new BenQGuru.eMES.IQC.IQCFacade(base.DataProvider);
            }
            //新增前唯一性检查

            int count = this._iqcfacade.GetINVReceiptRepeateCount(FormatHelper.CleanString(this.txtReceiveNoEdit.Text.Trim()), OrgId);

            if (count > 0)
            {
                WebInfoPublish.Publish(this, "$BS_ALREADY_INVReceipt", this.languageComponent1);
                return;
            }
            DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);

            ((Domain.IQC.InvReceipt)domainObject).Recstatus      = "NEW";
            ((Domain.IQC.InvReceipt)domainObject).Createdate     = dbDateTime.DBDate;
            ((Domain.IQC.InvReceipt)domainObject).Createtime     = dbDateTime.DBTime;
            ((Domain.IQC.InvReceipt)domainObject).Createuser     = this.GetUserCode();
            ((Domain.IQC.InvReceipt)domainObject).Mdate          = dbDateTime.DBDate;
            ((Domain.IQC.InvReceipt)domainObject).Mtime          = dbDateTime.DBTime;
            ((Domain.IQC.InvReceipt)domainObject).Muser          = this.GetUserCode();
            ((Domain.IQC.InvReceipt)domainObject).IsAllInStorage = "N";
            this._iqcfacade.AddInvReceipt((Domain.IQC.InvReceipt)domainObject);
        }
Exemple #2
0
        protected override bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(lblFeederCodeEdit, txtFeederCodeEdit, 40, true));
            manager.Add(new DecimalCheck(lblMaxCountEdit, txtMaxCountEdit, 0, decimal.MaxValue, true));
            manager.Add(new DecimalCheck(lblAlertCountEdit, txtAlertCountEdit, 0, decimal.MaxValue, true));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return(false);
            }
            if (Convert.ToDecimal(this.txtAlertCountEdit.Text) > Convert.ToDecimal(this.txtMaxCountEdit.Text))
            {
                WebInfoPublish.Publish(this, "$Feeder_AlertCount_Greater_Than_MaxCount", this.languageComponent1);
                return(false);
            }


            //Add by terry 2010-11-03
            if (Convert.ToDecimal(this.TxtAlterMDAYEdit.Text) > Convert.ToDecimal(this.TxtMaxMDayEdit.Text))
            {
                WebInfoPublish.Publish(this, "$Feeder_AlterMDay_Greater_Than_MaxMDay", this.languageComponent1);
                return(false);
            }

            return(true);
        }
        protected override void UpdateDomainObject(object domainObject)
        {
            if (facade == null)
            {
                facade = new InventoryFacade(base.DataProvider);
            }
            var pickDetail = (PickDetail)domainObject;

            try
            {
                this.DataProvider.BeginTransaction();
                ItemFacade itemFacade            = new ItemFacade();
                Domain.MOModel.Material material = (Domain.MOModel.Material)itemFacade.GetMaterial(pickDetail.MCode);
                if (material != null)
                {
                    material.MchlongDesc = this.txtMDescEdit.Text;
                    itemFacade.UpdateMaterial(material);
                }
                this.facade.UpdatePickDetail(pickDetail);
                this.DataProvider.CommitTransaction();
                WebInfoPublish.Publish(this, "更新成功", this.languageComponent1);
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                WebInfoPublish.PublishInfo(this, ex.Message, this.languageComponent1);
            }
        }
        protected object GetObject(string list)
        {
            if (facade == null)
            {
                facade = new TSModelFacade(this.DataProvider);
            }

            object obj = this.facade.GetErrorCode2OPRework(this.txtOPCodeQuery.Text, list, GlobalVariables.CurrentOrganizations.First().OrganizationID);

            if (obj != null)
            {
                WebInfoPublish.Publish(this, list + "$Error_Primary_Key_Overlap", this.languageComponent1);
                return(null);
            }

            ErrorCode2OPRework errorCode2OPRework = facade.CreateNewErrorCode2OPRework();

            errorCode2OPRework.OPCode         = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtOPCodeQuery.Text));
            errorCode2OPRework.ErrorCode      = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(list));
            errorCode2OPRework.RouteCode      = FormatHelper.CleanString(this.txtReworkRoute.Text);
            errorCode2OPRework.ToOPCode       = FormatHelper.CleanString(this.txtReworkOPCode.Text);
            errorCode2OPRework.MaintainUser   = this.GetUserCode();
            errorCode2OPRework.OrganizationID = GlobalVariables.CurrentOrganizations.First().OrganizationID;

            return(errorCode2OPRework);
        }
Exemple #5
0
        //将用户手动加的Mail加到地址里
        protected void cmdAdd_Click(object sender, System.EventArgs e)
        {
            if (this.txtUser.Text.Trim() == string.Empty)
            {
                WebInfoPublish.Publish(this, lblUserSN.Text + BenQGuru.eMES.Web.Helper.MessageCenter.ParserMessage("$Error_Input_Empty", this.languageComponent1),
                                       this.languageComponent1);
                return;
            }

            if (this.txtEMail.Text.Trim() == string.Empty)
            {
                WebInfoPublish.Publish(this, lblEMail.Text + BenQGuru.eMES.Web.Helper.MessageCenter.ParserMessage("$Error_Input_Empty", this.languageComponent1),
                                       this.languageComponent1);
                return;
            }

            if (this.txtEMail.Text.IndexOf("@") == -1)
            {
                WebInfoPublish.Publish(this, "$Error_Email_Format", this.languageComponent1);
                return;
            }

            //检查用户代码是否已经存在
            if (this.lstUser.Items.FindByValue(this.txtUser.Text.Trim()) != null)
            {
                WebInfoPublish.Publish(this, "$Error_User_Exist", this.languageComponent1);
                return;
            }
            ListItem li = new ListItem(this.txtUser.Text.Trim() + "(" + this.txtEMail.Text.Trim() + ")", this.txtUser.Text.Trim());

            this.lstUser.Items.Add(li);
            this.txtUser.Text  = string.Empty;
            this.txtEMail.Text = string.Empty;
        }
        protected override bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();
//			manager.Add( new LengthCheck(lblItem2CartonCFGCodeEdit, txtItem2CartonCFGCodeEdit, 40, true) );
//			manager.Add( new DateCheck(lblPlanShipDateEdit, txtPlanShipDateEdit.Text, true) );
            object objItem = null;

            object[] objItems = null;
            try
            {
                if (itemFacade == null)
                {
                    itemFacade = new FacadeFactory(base.DataProvider).CreateItemFacade();
                }
                objItems = itemFacade.QueryItem(null, txtItemName.Text.Trim().ToUpper(), null, null, null);
            }
            catch
            {}
            if (objItems == null || (objItems != null && objItems.Length < 1))
            {
                WebInfoPublish.Publish(this, "$Error_ItemCode_NotExist", languageComponent1);
                return(false);
            }
            if (txtItemName.Text.Trim() == String.Empty)
            {
                WebInfoPublish.Publish(this, "$PageControl_ItemName $Error_Input_Empty", languageComponent1);
                return(false);
            }
            if (txtMPlate.Text.Trim() == String.Empty)
            {
                WebInfoPublish.Publish(this, "$PageControl_Mplate $Error_Input_Empty", languageComponent1);
                return(false);
            }
            if (txtCartonItemCode.Text.Trim() == String.Empty)
            {
                WebInfoPublish.Publish(this, "$PageControl_CartonItemCode $Error_Input_Empty", languageComponent1);
                return(false);
            }

            if (drpPCSType.SelectedIndex == 1)
            {
                if (txtSPlate.Text.Trim() == String.Empty)
                {
                    WebInfoPublish.Publish(this, "$PageControl_Splate $Error_Input_Empty", languageComponent1);
                    return(false);
                }
            }

            manager.Add(new NumberCheck(lblCartonCodeLen, txtCartonCodeLen, true));
            manager.Add(new NumberCheck(lblStartPosition, txtStartPosition, true));
            manager.Add(new NumberCheck(lblEndPosition, txtEndPosition, true));
            manager.Add(new DecimalRangeCheck(lblStartPosition, txtStartPosition.Text, lblEndPosition, txtEndPosition.Text, false));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, languageComponent1);
                return(false);
            }
            return(true);
        }
        private bool ValidInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new NumberCheck(this.lblConfirmCompleteQtyEdit, this.txtConfirmQtyEdit, 1,
                                        Convert.ToInt32(decimal.Parse(this.txtCompleteQtyQuery.Text) - decimal.Parse(this.txtCompleteQtyConfirmedQuery.Text)), true));
            manager.Add(new NumberCheck(this.lblConfirmScrapQtyEdit, this.txtConfirmScrapQtyEdit, 0,
                                        Convert.ToInt32(decimal.Parse(this.txtScrapQtyQuery.Text) - decimal.Parse(this.txtScrapQtyConfirmedQuery.Text)), true));

            if (this.txtManHourEdit.Text.Trim().Length > 0)
            {
                manager.Add(new NumberCheck(this.lblManHourEdit, this.txtManHourEdit, false));
            }
            if (this.txtMachineHourEdit.Text.Trim().Length > 0)
            {
                manager.Add(new NumberCheck(this.lblMachineHourEdit, this.txtMachineHourEdit, false));
            }

            manager.Add(new DateCheck(this.lblConfirmDateEdit, this.dateConfirmDateEdit.Text, false));

            manager.Add(new LengthCheck(this.lblMOLocationEdit, this.txtMOLocationEdit, 40, true));
            manager.Add(new LengthCheck(this.lblGradeEdit, this.txtGradeEdit, 10, false));


            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, languageComponent1);
                return(false);
            }
            return(true);
        }
        protected void cmdStorageCheckClose_ServerClick(object sender, EventArgs e)
        {
            if (_WarehouseFacade == null)
            {
                _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }
            BenQGuru.eMES.Material.StockCheckDetailOp[] ops = this._WarehouseFacade.GetPortionStockCheckOpsNoPager(txtStockCheckCodeQuery.Text);

            foreach (BenQGuru.eMES.Material.StockCheckDetailOp op in ops)
            {
                if (op.STORAGEQTY != op.Qty)
                {
                    if (string.IsNullOrEmpty(op.DiffDesc))
                    {
                        WebInfoPublish.Publish(this, "存在数量不一致请填写盘点差异原因!", this.languageComponent1); return;
                    }
                }
            }
            BenQGuru.eMES.Domain.Warehouse.StockCheck s = (BenQGuru.eMES.Domain.Warehouse.StockCheck)_WarehouseFacade.GetStockCheck(txtStockCheckCodeQuery.Text);
            s.STATUS = "Close";
            _WarehouseFacade.UpdateStockCheck(s);
            WebInfoPublish.Publish(this, "盘点关闭成功!", this.languageComponent1); return;

            this.txtStockCheckCodeEdit.Text = string.Empty;
            txtDQMCODEEdit.Text             = string.Empty;
            txtStorageCodeEdit.Text         = string.Empty;
            txtLocationCodeEdit.Text        = string.Empty;
            txtLocationCodeEdit.Text        = string.Empty;
            txtCARTONNOEdit.Text            = string.Empty;
            txtCheckQtyEdit.Text            = string.Empty;
            txtDiffDescEdit.Text            = string.Empty;
        }
        protected void cmdAdd_ServerClick(object sender, EventArgs e)
        {
            if (_WarehouseFacade == null)
            {
                _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }
            string message = string.Empty;

            ShareLib.ShareKit kit = new ShareLib.ShareKit();
            bool result           = kit.SubmitPortionCheck(txtStockCheckCodeQuery.Text,
                                                           txtCARTONNOEdit.Text,
                                                           txtCheckQtyEdit.Text,
                                                           txtLocationCodeEdit.Text,
                                                           txtDiffDescEdit.Text,
                                                           txtDQMCODEEdit.Text,
                                                           base.DataProvider, GetUserCode(), out message);


            if (!result)
            {
                WebInfoPublish.Publish(this, message, this.languageComponent1);
                return;
            }
            this.txtStockCheckCodeEdit.Text = string.Empty;
            txtDQMCODEEdit.Text             = string.Empty;
            txtStorageCodeEdit.Text         = string.Empty;
            txtsLocationCodeEdit.Text       = string.Empty;
            txtLocationCodeEdit.Text        = string.Empty;
            txtCARTONNOEdit.Text            = string.Empty;
            txtCheckQtyEdit.Text            = string.Empty;
            txtDiffDescEdit.Text            = string.Empty;

            WebInfoPublish.Publish(this, "提交成功!", this.languageComponent1);
            this.cmdQuery_Click(null, null);
        }
Exemple #10
0
        protected void cmdSave_ServerClick(object sender, System.EventArgs e)
        {
            if (_itemFacade == null)
            {
                _itemFacade = new FacadeFactory(base.DataProvider).CreateItemFacade();
            }
            object material = this.GetEditObject();

            if (material != null)
            {
                if (!string.IsNullOrEmpty(((Domain.MOModel.Material)material).VendorCode))
                {
                    ItemFacade itemfacade = new ItemFacade(this.DataProvider);
                    object     objvendor  = itemfacade.GetVender((((Domain.MOModel.Material)material).VendorCode.Trim().ToUpper()));
                    if (objvendor == null)
                    {
                        WebInfoPublish.Publish(this, "$Vendor_isnot_exit", this.languageComponent1);
                        return;
                    }
                }
                this._itemFacade.UpdateMaterial((Domain.MOModel.Material)material);
                this.RequestData();

                this.buttonHelper.PageActionStatusHandle(PageActionType.Save);
            }
        }
Exemple #11
0
        private bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            if (chkSNLength.Checked)
            {
                manager.Add(new NumberCheck(this.lblSNLength, this.txtSNLength, 1, 99999999, false));
            }

            manager.Add(new LengthCheck(this.lblControlTypeEdit, this.ddlControlTypeEdit, 40, true));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, languageComponent1);
                return(false);
            }

            if (this.chkCompareItem.Checked == true)
            {
                if (!this.chkParseBarcode.Checked && !this.chkParsePrepare.Checked && !this.chkParseProduct.Checked)
                {
                    WebInfoPublish.Publish(this, "$CheckCompareItem_Must_CheckOneParse", languageComponent1);
                    return(false);
                }
            }

            return(true);
        }
Exemple #12
0
        protected bool ValidateInput()
        {
            string ie = BenQGuru.eMES.Web.Helper.MessageCenter.ParserMessage("$Error_Input_Empty", this.languageComponent1);

            if (this.chbMailNotify.Checked && this.lstUser.Items.Count == 0)
            {
                WebInfoPublish.Publish(this, this.lblReceiver.Text + " " + ie, this.languageComponent1);
                return(false);
            }
            PageCheckManager manager = new PageCheckManager();

            if (this._alerttype != BenQGuru.eMES.AlertModel.AlertType_Old.First && this._alerttype != BenQGuru.eMES.AlertModel.AlertType_Old.ResourceNG) //如果不是首件上线
            {
                manager.Add(new NumberCheck(this.lblStartNum, this.txtStartNum, 1, int.MaxValue, true));
            }

            if (this.drpOperator.SelectedValue == "BW")
            {
                manager.Add(new DecimalRangeCheck(this.lblAlertCondition, this.txtLow.Text, this.lblAlertCondition, this.txtUp.Text, true));
            }
            else
            {
                manager.Add(new DecimalCheck(this.lblAlertCondition, this.txtLow, true));
            }

            manager.Add(new LengthCheck(this.lblAlertMsg, this.txtAlertMsg, 1000, true));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return(false);
            }

            return(true);
        }
        private bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(lblSupplierCodeEdit, txtSupplierCodeEdit, 40, true));
            manager.Add(new LengthCheck(lblSupplierItemEdit, txtSupplierItemEdit, 40, true));
            manager.Add(new LengthCheck(lblPCBAVersionDescriptionEdit, txtPCBAVersionEdit, 40, true));
            manager.Add(new LengthCheck(lblBIOSVersionDescriptionEdit, txtBIOSVersionEdit, 40, true));
            manager.Add(new LengthCheck(lblCardStartEdit, txtCardStartEdit, 40, true));
            manager.Add(new LengthCheck(lblCardEndEdit, txtCardEndEdit, 40, true));
            manager.Add(new LengthCheck(lblDataCodeStartEdit, txtDataCodeStartEdit, 40, true));
            manager.Add(new LengthCheck(lblDateCodeEndEdit, txtDateCodeEndEdit, 40, true));
            manager.Add(new LengthCheck(lblItemVersion, txtItemVersion, 40, true));
            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, languageComponent1);
                return(false);
            }
            return(true);
            //manager.Add( new LengthCheck(lblItemVersion, txtItemVersion, 40, true) );

            //			if((this.txtCardStartEdit.Text.Trim().Length != this.txtCardEndEdit.Text.Trim().Length))
            //			{
            //				throw new Exception(ErrorCenter.GetErrorUserDescription( GetType().BaseType, string.Format(ErrorCenter.ERROR_WITHOUTINPUT, "流程卡范围起始和结束必须等长!") ) );
            //			}
            //			if((this.txtDataCodeStartEdit.Text.Trim().Length != this.txtDateCodeEndEdit.Text.Trim().Length))
            //			{
            //				throw new Exception(ErrorCenter.GetErrorUserDescription( GetType().BaseType, string.Format(ErrorCenter.ERROR_WITHOUTINPUT, "生产日期范围起始和结束必须等长!") ) );
            //			}
        }
Exemple #14
0
        protected override void DeleteDomainObjects(ArrayList domainObjects)
        {
            if (_iqcfacade == null)
            {
                _iqcfacade = new BenQGuru.eMES.IQC.IQCFacade(base.DataProvider);
            }
            foreach (Domain.IQC.InvReceipt invreceipt in (Domain.IQC.InvReceipt[])domainObjects.ToArray(typeof(Domain.IQC.InvReceipt)))
            {
                if (invreceipt.Recstatus.ToUpper() != "NEW")
                {
                    WebInfoPublish.Publish(this, "$BS_TicketStatus_Error", this.languageComponent1);
                    return;
                }

                object obj = _iqcfacade.GetASN(invreceipt.Receiptno);
                if (obj != null)
                {
                    WebInfoPublish.Publish(this, "$BS_ReNo_Create_ANSNO $InvReceiptNO:" + invreceipt.Receiptno, this.languageComponent1);
                    return;
                }

                //删除字表
                object[] objs = this._iqcfacade.QueryINVReceiptDetail2ReceiptNo(invreceipt.Receiptno);
                if (objs != null)
                {
                    foreach (Domain.IQC.InvReceiptDetail invreceiptdetail in objs)
                    {
                        this._iqcfacade.DeleteInvReceiptDetail(invreceiptdetail);
                    }
                }
            }

            this._iqcfacade.DeleteInvReceipt((Domain.IQC.InvReceipt[])domainObjects.ToArray(typeof(Domain.IQC.InvReceipt)));
        }
Exemple #15
0
        private bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(lblAPIDEdit, txtAPIDEdit, 40, true));
            manager.Add(new LengthCheck(lblBPCodeEdit, txtBPCodeEdit, 40, true));
            manager.Add(new LengthCheck(lblVersionEdit, txtVersionEdit, 40, true));
            manager.Add(new LengthCheck(lblItemCodeEdit, txtItemEdit, int.MaxValue, true));
            manager.Add(new DecimalCheck(lblThicknessEdit, txtThicknessEdit, 0.00001M, decimal.MaxValue, true));
            manager.Add(new LengthCheck(lblManSNEdit, txtManSNEdit, 40, false));

            manager.Add(new NumberCheck(lblLBRateEdit, txtLBRateEdit, 1, int.MaxValue, true));

            //			manager.Add( new NumberCheck(lblInFacDate, txtInFacDate, 1, int.MaxValue, true) );
            //			manager.Add( new NumberCheck(lblInFacTime, txtInFaTime, 1, int.MaxValue, true) );

            manager.Add(new DecimalCheck(lblTenAEdit, txtTenAEdit, 0.00001M, decimal.MaxValue, true));
            manager.Add(new DecimalCheck(lblTenBEdit, txtTenBEdit, 0.00001M, decimal.MaxValue, true));
            manager.Add(new DecimalCheck(lblTenCEdit, txtTenCEdit, 0.00001M, decimal.MaxValue, true));
            manager.Add(new DecimalCheck(lblTenDEdit, txtTenDEdit, 0.00001M, decimal.MaxValue, true));
            manager.Add(new DecimalCheck(lblTenEEdit, txtTenEEdit, 0.00001M, decimal.MaxValue, true));

            manager.Add(new LengthCheck(lblMemoEdit, txtMemoEdit, 100, false));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, languageComponent1);
                return(false);
            }
            return(true);
        }
Exemple #16
0
        protected void cmdDelete_ServerClick(object sender, System.EventArgs e)
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.MOModel.RMAFacade(base.DataProvider);
            }
            //已经关闭或结案的RMA不能新增行项目

            ArrayList array = this.gridHelper.GetCheckedRows();

            if (array.Count > 0)
            {
                ArrayList items = new ArrayList(array.Count);

                foreach (GridRecord row in array)
                {
                    RMABill rmaBill = (RMABill)this.GetEditObject(row);
                    if (rmaBill != null)
                    {
                        if (rmaBill.Status != RMABillStatus.Initial)
                        {
                            WebInfoPublish.Publish(this, "$BS_RMABillStatus_CannotDelete", this.languageComponent1);
                            this.RequestData();
                            return;
                        }
                        items.Add(rmaBill);
                    }
                }
                _facade.DeleteRMABill((RMABill[])items.ToArray(typeof(RMABill)));
            }

            this.buttonHelper.PageActionStatusHandle(PageActionType.Delete);
            this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
            this.RequestData();
        }
        private void _helper_LoadGridDataSource(object sender, EventArgs e)
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new DateRangeCheck(this.lblStockDateFromQuery, this.dateStockDateFromQuery.Text, this.dateStockDateToQuery.Text, true));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return;
            }

            FacadeFactory facadeFactory = new FacadeFactory(base.DataProvider);

            object[] dataSource = facadeFactory.CreateQueryStockFacade().QueryStockContrast(
                this.rdbStockStatusQuery.SelectedIndex,
                FormatHelper.TODateInt(this.dateStockDateFromQuery.Text),
                FormatHelper.TODateInt(this.dateStockDateToQuery.Text),
                (e as WebQueryEventArgs).StartRow,
                (e as WebQueryEventArgs).EndRow);

            (e as WebQueryEventArgs).GridDataSource = dataSource;

            (e as WebQueryEventArgs).RowCount =
                facadeFactory.CreateQueryStockFacade().QueryStockContrastCount(
                    this.rdbStockStatusQuery.SelectedIndex,
                    FormatHelper.TODateInt(this.dateStockDateFromQuery.Text),
                    FormatHelper.TODateInt(this.dateStockDateToQuery.Text));
        }
Exemple #18
0
        private bool _checkRequireFields()
        {
            PageCheckManager manager = new PageCheckManager();

            //manager.Add(new DateRangeCheck(this.lblStartDateQuery,this.dateStartDateQuery.Text,this.lblEndDateQuery,this.dateEndDateQuery.Text,true));
            //manager.Add(new DateRangeCheck(this.lblReceveBegindate,this.txtReceiveBeginDate.Text,this.lblReceveEnddate,this.txtReceiveEndDate.Text,true));
            //manager.Add(new DateRangeCheck(this.lblTSBegindate,this.txtTSBeginDate.Text,this.lblTSEnddate,this.txtTSEndDate.Text,true));


            if (this.rdbErrorDate.Checked)
            {
                manager.Add(new DateRangeCheck(this.lblNGStartDateQuery, this.dateStartDateQuery.Text, this.lblNGEndDateQuery, this.dateEndDateQuery.Text, true));
            }
            if (this.rdbReceivedDate.Checked)
            {
                manager.Add(new DateRangeCheck(this.lblReceiveBeginDate, this.txtReceiveBeginDate.Text, this.lblReceiveEndDate, this.txtReceiveEndDate.Text, true));
            }
            if (this.rdbTSDate.Checked)
            {
                manager.Add(new DateRangeCheck(this.lblRepairStartDateQuery, this.txtTSBeginDate.Text, this.lblRepairEndDateQuery, this.txtTSEndDate.Text, true));
            }

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return(false);
            }
            return(true);
        }
Exemple #19
0
        protected override bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(lblShiftCodeEdit, txtShiftCodeEdit, 40, true));
            manager.Add(new NumberCheck(lblShiftSequenceEdit, txtShiftSequenceEdit, true));
            manager.Add(new LengthCheck(lblShiftTypeCodeEdit, drpShiftTypeCodeEdit, 40, true));
            manager.Add(new LengthCheck(lblShiftDescriptionEdit, txtShiftDescriptionEdit, 100, false));

            //			if ( !this.chbIsOverDateEdit.Checked )
            //			{
            //				manager.Add( new TimeRangeCheck(this.lblShiftBeginTimeEdit, this.timeShiftBeginTimeEdit.Text, this.lblShiftEndTimeEdit, this.timeShiftEndTimeEdit.Text, true) );
            //			}
            //			else
            //			{
            //				manager.Add( new TimeRangeCheck(this.lblShiftEndTimeEdit, this.timeShiftEndTimeEdit.Text, this.lblShiftBeginTimeEdit, this.timeShiftBeginTimeEdit.Text, true) );
            //			}

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return(false);
            }
            return(true);
        }
Exemple #20
0
        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            if (commandName == "Edit")
            {
                object obj = this.GetEditObject(row);

                if (obj != null)
                {
                    if (((InvTransfer)obj).TransferStatus != RecordStatus.RecordStatus_NEW)
                    {
                        WebInfoPublish.Publish(this, "$Error_OnlyNEWCanEdit", this.languageComponent1);
                        return;
                    }

                    this.cmdSave.Disabled          = false;
                    this.cmdAdd.Disabled           = true;
                    this.txtTransferNoEdit.Enabled = false;
                    this.SetEditObject(obj);
                }
            }

            if (commandName == "TransferDetail")
            {
                Response.Redirect(this.MakeRedirectUrl("FInvTransferDetailMP.aspx", new string[] { "TransferNO", "RECType", "TransferStatus" }, new string[] { row.Items.FindItemByKey("TransferNO").Value.ToString(), row.Items.FindItemByKey("RECType").Value.ToString(), row.Items.FindItemByKey("RECTypeDesc").Value.ToString() }));
            }
        }
Exemple #21
0
 protected void cmdSave_ServerClick(object sender, System.EventArgs e)
 {
     if (_equipmentFacade == null)
     {
         _equipmentFacade = new BenQGuru.eMES.Material.EquipmentFacade(this.DataProvider);
     }
     if (ValidateInput())
     {
         if (_equipmentFacade.CheckEQPTSLogExists(this.EqpId, EquipmentTSLogStatus.EquipmentTSLogStatus_New) > 0)
         {
             WebInfoPublish.Publish(this, "$EQPTSLog_Exists", this.languageComponent1);
         }
         else
         {
             DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider);
             EQPTSLog   eqptsLog   = new EQPTSLog();
             eqptsLog.Eqpid        = this.EqpId;
             eqptsLog.FindUser     = this.GetUserCode();
             eqptsLog.TsInfo       = FormatHelper.CleanString(this.txtTsinfo.Text, 400);
             eqptsLog.FindMdate    = dbDateTime.DBDate;
             eqptsLog.FindMtime    = dbDateTime.DBTime;
             eqptsLog.Status       = EquipmentTSLogStatus.EquipmentTSLogStatus_New;
             eqptsLog.Duration     = 0;
             eqptsLog.MaintainUser = this.GetUserCode();
             eqptsLog.Mdate        = dbDateTime.DBDate;
             eqptsLog.Mtime        = dbDateTime.DBTime;
             _equipmentFacade.AddEQPTSLog(eqptsLog);
             WebInfoPublish.Publish(this, "$AddEQPTSLog_Success", this.languageComponent1);
         }
         this.ClientScript.RegisterStartupScript(base.GetType(), "CloseThis", "window.close();", true);
     }
 }
Exemple #22
0
        protected override bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(this.lblPEQPIDEdit, this.txtEQPIDEdit, 40, true));
            manager.Add(new LengthCheck(this.lblResourceCodeEdit, this.txtOpCodeEdit, 40, true));
            manager.Add(new LengthCheck(this.lblSSQuery, this.drpStepSequenceCodeEdit, 40, true));
            manager.Add(new LengthCheck(this.lblEQPWorkingTimeEdit, this.txtEQPWorkingTimeEdit, 8, true));


            try
            {
                if (this.txtEQPWorkingTimeEdit.Text.Trim() != string.Empty)
                {
                    int.Parse(this.txtEQPWorkingTimeEdit.Text.Trim());
                }
            }
            catch
            {
                manager.Add(new NumberCheck(this.lblEQPWorkingTimeEdit, this.txtEQPWorkingTimeEdit, 0, 99999999, true));
            }
            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return(false);
            }

            return(true);
        }
        protected override bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(this.lblNGCodeEdit, this.txtErrorCode, 65535, true));
            manager.Add(new LengthCheck(this.lblReworkOPCodeEdit, this.txtReworkOPCode, 40, true));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return(false);
            }

            if (this.txtReworkRoute.Text.Trim().Length != 0)
            {
                BenQGuru.eMES.BaseSetting.BaseModelFacade baseModelFacade = new BenQGuru.eMES.BaseSetting.BaseModelFacade(this.DataProvider);
                object route2op = baseModelFacade.GetRoute2Operation(this.txtReworkRoute.Text.ToUpper(), this.txtReworkOPCode.Text.ToUpper());
                if (route2op == null)
                {
                    WebInfoPublish.Publish(this, "$Error_RouteHasNoOperations", this.languageComponent1);
                    return(false);
                }
            }

            return(true);
        }
Exemple #24
0
        protected override void UpdateDomainObject(object domainObject)
        {
            if (_facade == null)
            {
                _facade = new ReportViewFacade(base.DataProvider);
            }
            ((RptViewDataSource)domainObject).DataSourceID = Convert.ToDecimal(this.datasourceid.Value);
            base.DataProvider.BeginTransaction();
            try
            {
                this._facade.UpdateRptViewDataSource((RptViewDataSource)domainObject);
                this._facade.SetColumn(Server.MapPath("").ToString().Substring(0, Server.MapPath("").ToString().LastIndexOf("\\")), ((RptViewDataSource)domainObject).DllFileName, ((RptViewDataSource)domainObject).DataSourceID, this.GetUserCode());
                base.DataProvider.CommitTransaction();
            }
            catch (Exception ex)
            {
                base.DataProvider.RollbackTransaction();
                string msg = this.languageComponent1.GetString(ex.Message);
                if (ex.Message == "$Error_Command_Execute")
                {
                    msg = "$DataSource_IS_Wrong";
                }

                if (msg == "" || msg == null)
                {
                    msg = ex.Message;
                }

                WebInfoPublish.Publish(this, msg, this.languageComponent1);
            }
        }
        private bool PageValidate()
        {
            if (txtUserCode.Text.Trim() == "")
            {
                WebInfoPublish.Publish(this, "$Error_User_Code_Empty", this.languageComponent1);
                return(false);
            }

            if (!chbForgetPassword.Checked)
            {
                if (txtOriginPassword.Value == "")
                {
                    WebInfoPublish.Publish(this, "$Error_User_Origin_PassWord_Empty", this.languageComponent1);
                    return(false);
                }
            }

            if (txtNewPassword.Value == "")
            {
                WebInfoPublish.Publish(this, "$Error_User_New_PassWord_Empty", this.languageComponent1);
                return(false);
            }

            if ((txtConfrimPassword.Value != txtNewPassword.Value) || (txtConfrimPassword.Value == ""))
            {
                WebInfoPublish.Publish(this, "$Error_User_ConfirmPassWord_Error", this.languageComponent1);
                return(false);
            }
            return(true);
        }
Exemple #26
0
        private bool _checkRequireFields()
        {
            //查询条件-时间范围,是否输入完整
            //  bool isDateComplete = (this.dateStartDateQuery.Text.Trim() == string.Empty) || (this.dateEndDateQuery.Text.Trim() == string.Empty);

            //查询条件-生产工单范围,是否输入完整
            //  bool isMoComplete = (this.txtStartMoQuery.Text.Trim() == string.Empty) || (this.txtEndMoQuery.Text.Trim() == string.Empty);

            //查询条件-销售订单范围,是否输入完整
            //bool isSoComplete = (this.txtStartSoQuery.Text.Trim() == string.Empty) || (this.txtEndSoQuery.Text.Trim() == string.Empty);

            //if (isDateComplete && isMoComplete)
            //{
            //    //时间、生产工单、销售订单,都不完整(至少有一组要是完整的)
            //    WebInfoPublish.PublishInfo(this, "$At_Least_OneGroup_Condition", this.languageComponent1);
            //    return false;
            //}
            PageCheckManager manager = new PageCheckManager();

            //  manager.Add(new DateRangeCheck(this.lblStartDateQuery, this.dateStartDateQuery.Text, this.lblEndDateQuery, this.dateEndDateQuery.Text, true));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return(true);
            }
            return(true);
        }
Exemple #27
0
        private bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(lblItemCodeEdit, txtItemCodeEdit, 40, true));
            manager.Add(new LengthCheck(this.lblItemUOMEdit, txtItemUOMEdit, 40, true));
            manager.Add(new LengthCheck(lblItemTypeEdit, drpItemTypeEdit, 40, true));
            manager.Add(new LengthCheck(this.lblItemModelCodeEdit, this.drpModelEdit, 40, true));
            //manager.Add( new NumberCheck (this.lblVolumnNumEdit, this.txtVolumnEdit, 0, int.MaxValue, false) );
            manager.Add(new NumberCheck(this.lblItemCartonQty, this.txtCartonQty, 0, int.MaxValue, false));
            manager.Add(new NumberCheck(this.lblLotSizeEdit, this.txtLotSizeEdit, 0, int.MaxValue, false));
            manager.Add(new LengthCheck(this.lblOrgEdit, this.DropDownListOrg, 8, true));
            manager.Add(new LengthCheck(this.lblItemProductCodeEdit, this.TextboxItemProductCodeEdit, 100, false));
            manager.Add(new NumberCheck(this.lblBurnUseMinutesEdit, this.txtBurnUseMinutesEdit, 0, int.MaxValue, false));

            //manager.Add( new DecimalCheck(this.lblMaxElectricCurrent, this.txtMaxElectricCurrent, decimal.MinValue, decimal.MaxValue, false) );
            //manager.Add( new DecimalCheck (this.lblMinElectricCurrent, this.txtMinElectricCurrent, decimal.MinValue, decimal.MaxValue, false) );

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, languageComponent1);
                return(false);
            }
            return(true);
        }
        protected override void AddDomainObject(object domainObject)
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider);
            }

            object objEqp = this._facade.GetEquipment(((Domain.Equipment.EQPMaintenance)domainObject).Eqpid);

            if (objEqp == null)
            {
                WebInfoPublish.Publish(this, "$Error_EQPID_IS_NOT_EXIST", languageComponent1);
                return;
            }

            object obj = this._facade.GetEQPMaintenance(((Domain.Equipment.EQPMaintenance)domainObject).Eqpid, ((Domain.Equipment.EQPMaintenance)domainObject).MaintainITEM, ((Domain.Equipment.EQPMaintenance)domainObject).MaintainType);

            if (obj == null)
            {
                this._facade.AddEQPMaintenance((Domain.Equipment.EQPMaintenance)domainObject);
            }
            else
            {
                WebInfoPublish.Publish(this, "$Error_PK_is_Repeat", languageComponent1);
            }
        }
        protected bool ValidateSaveInput()
        {
            if (facade == null)
            {
                facade = new InventoryFacade(base.DataProvider);
            }
            string pickno   = FormatHelper.CleanString(this.txtPickNoQuery.Text, 40);
            string pickline = FormatHelper.CleanString(this.txtPickLineEdit.Text, 40);
            //string dqmcode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtDQMCodeEdit.Text, 40));
            PickDetail pickdetail = (PickDetail)facade.GetPickDetail(pickno, pickline);

            if (pickdetail == null)
            {
                WebInfoPublish.Publish(this, "拣货任务令行明细不存在", this.languageComponent1);
                return(false);
            }
            if (txtIsScrapEdit.Text != "Y")
            {
                decimal        decqty         = decimal.Parse(FormatHelper.CleanString(txtQtyEdit.Text));
                int            invline        = Convert.ToInt32(this.txtInvLineEidt.Text);
                string         invno          = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtInvNoEidt.Text, 40));
                InvoicesDetail invoicesDetail = (InvoicesDetail)facade.GetInvoicesDetail(invno, invline);
                if (invoicesDetail != null)
                {
                    decimal pickqty = facade.GetPickDetailQty(invno, invline);
                    if (invoicesDetail.OutQty + decqty + pickqty - pickdetail.QTY > invoicesDetail.PlanQty)
                    {
                        WebInfoPublish.Publish(this, "超出可领数量", this.languageComponent1);
                        return(false);
                    }
                }
            }
            return(true);
        }
Exemple #30
0
        protected override bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(this.lblItemCodeEdit, this.txtItemCodeEdit, 40, true));
            manager.Add(new LengthCheck(this.lblOrderNoEdit, this.txtOrderNoEdit, 40, false));
            //manager.Add(new LengthCheck(this.lblItemGradeEdit, this.drpItemGradeEdit, 40, false));
            manager.Add(new LengthCheck(this.lblStorageTypeEdit, this.drpStorageCodeEdit, 40, true));
            manager.Add(new LengthCheck(this.lblDNQuantityEdit, this.txtDNQuantityEdit, 13, true));
            manager.Add(new LengthCheck(this.lblMOCodeEdit, this.txtMOCodeEdit, 40, false));
            manager.Add(new LengthCheck(this.lblReworkMOEdit, this.txtReworkMOEdit, 40, false));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return(false);
            }

            int dnQuantity = int.Parse(this.txtDNQuantityEdit.Text);

            if (this.txtRealQuantity.Text != null && this.txtRealQuantity.Text.Length > 0)
            {
                int dnRealQuantity = int.Parse(this.txtRealQuantity.Text);

                if (dnQuantity < dnRealQuantity)
                {
                    WebInfoPublish.Publish(this, "$Plan_Must_Length_Than_Real", this.languageComponent1);
                    return(false);
                }
            }

            return(true);
        }