Exemple #1
0
        //根据是否生产获取大线
        private string GetBigLineListInProduct(bool isInProduct)
        {
            WatchPanelFacade watchPanelFacade = new WatchPanelFacade(this.DataProvider);
            string           returnString     = string.Empty;

            string[] bigLine = _BigLineList.Trim().ToUpper().Split(',');

            DBDateTime now = FormatHelper.GetNowDBDateTime(this.DataProvider);

            for (int i = 0; i < bigLine.Length; i++)
            {
                if (isInProduct && watchPanelFacade.CheckLineIsProduct(bigLine[i].ToString(), now.DBDate, now.DBTime))
                {
                    returnString += "," + bigLine[i].Trim().ToUpper().ToString();
                }

                if (!isInProduct && !watchPanelFacade.CheckLineIsProduct(bigLine[i].ToString(), now.DBDate, now.DBTime))
                {
                    returnString += "," + bigLine[i].Trim().ToUpper().ToString();
                }
            }

            if (returnString.Length > 0)
            {
                returnString = returnString.Substring(1);
            }

            return(returnString);
        }
Exemple #2
0
        private void DoQuery()
        {
            WatchPanelFacade watchPanelFacade = new WatchPanelFacade(this.DataProvider);
            DBDateTime       now = FormatHelper.GetNowDBDateTime(this.DataProvider);

            //Exception
            Label labelException = new Label();

            labelException.Text = string.Empty;

            object[] exceptionArray = watchPanelFacade.QueryExceptionList(string.Empty, now.DBDate);
            if (exceptionArray != null)
            {
                for (int i = 0; i < exceptionArray.Length; i++)
                {
                    ExceptionEventWithDescription exception = (ExceptionEventWithDescription)exceptionArray[i];
                    if (labelException.Text.Trim().Length > 0)
                    {
                        labelException.Text += "<br>";
                    }

                    int seq = i + 1;
                    labelException.Text += seq.ToString() + ": ";
                    labelException.Text += exception.SSCode + " - " + exception.SSDesc + " - " + exception.ItemCode + " - " + exception.Description + " - " + exception.Memo;
                    labelException.Text += "(" + FormatHelper.ToTimeString(exception.BeginTime) + " - " + FormatHelper.ToTimeString(exception.EndTime) + ")";
                }
            }

            this.PanelException.Controls.Add(labelException);
        }
Exemple #3
0
        protected override void UpdateDomainObject(object domainObject)
        {
            if (_RMAFacade == null)
            {
                _RMAFacade = new BenQGuru.eMES.MOModel.RMAFacade(base.DataProvider);
            }

            //已经关闭或结案的RMA不能更新项目

            //string RMABillCode = this.txtRMABillCode.Text.Trim();

            //object obj = _RMAFacade.GetRMABill(RMABillCode);
            //if (((RMABill)obj).Status == RMABillStatus.Closed)
            //{
            //    WebInfoPublish.PublishInfo(this, "$BS_RMABillStatus_IsClose_CannotUpdate", this.languageComponent1);
            //    return;
            //}
            //if (((RMABill)obj).Status == RMABillStatus.Opened)
            //{
            //    WebInfoPublish.PublishInfo(this, "$BS_RMABillStatus_IsOpended_CannotUpdate", this.languageComponent1);
            //    return;
            //}

            DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);

            ((RMADetial)domainObject).Mdate        = dbDateTime.DBDate;
            ((RMADetial)domainObject).Mtime        = dbDateTime.DBTime;
            ((RMADetial)domainObject).MaintainUser = this.GetUserCode();

            this._RMAFacade.UpdateRMADetial((RMADetial)domainObject);
        }
Exemple #4
0
        //生成新的OQC检验单号
        /// <summary>
        /// 生成新的IQC检验单号
        /// </summary>
        /// <param name="oldIqcNo">原IQC检验单号</param>
        /// <returns></returns>
        private string CreateNewIqcNo(string oldOqcNo)
        {
            //规则:原OQC检验单号 +_+ 两位流水号,如:OQCASN00000101_01
            WarehouseFacade warehouseFacade = new WarehouseFacade(this.DataProvider);
            string          SNPrefix        = oldOqcNo + "_";
            object          objSerialBook   = warehouseFacade.GetSerialBook(SNPrefix);

            if (objSerialBook == null)
            {
                DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);
                SERIALBOOK serialBook = new SERIALBOOK();
                serialBook.SNPrefix  = SNPrefix;
                serialBook.MaxSerial = "1";
                serialBook.MUser     = this.GetUserCode();
                serialBook.MDate     = dbDateTime.DBDate;
                serialBook.MTime     = dbDateTime.DBTime;
                warehouseFacade.AddSerialBook(serialBook);

                return(SNPrefix + "01");
            }
            else
            {
                SERIALBOOK serialBook = (SERIALBOOK)objSerialBook;
                if (serialBook.MaxSerial == "99")
                {
                    return("");
                }
                serialBook.MaxSerial = (Convert.ToInt32(serialBook.MaxSerial) + 1).ToString();
                warehouseFacade.UpdateSerialBook(serialBook);

                return(serialBook.SNPrefix + serialBook.MaxSerial.PadLeft(2, '0'));
            }
        }
Exemple #5
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 #6
0
        private void BindGrid()
        {
            BurnFacade burnFacade = new BurnFacade(this.DataProvider);

            object[] objs = burnFacade.GetBurnBySscode(Resource.StepSequenceCode);
            _DataTableLoadedBurn.Clear();

            if (objs != null)
            {
                for (int i = 0; i < objs.Length; i++)
                {
                    DBDateTime now     = FormatHelper.GetNowDBDateTime(this.DataProvider);
                    BurnWip    burnWip = objs[i] as BurnWip;
                    _DataTableLoadedBurn.Rows.Add(new object[] {
                        burnWip.MOCode,
                        burnWip.ItemCode,
                        burnWip.RunningCard,
                        FormatHelper.ToDateString(burnWip.BurnInDate, "-"),
                        FormatHelper.ToTimeString(burnWip.BurnInTime, ":"),
                        FormatHelper.ToDateString(burnWip.ForecastOutDate, "-"),
                        FormatHelper.ToTimeString(burnWip.ForecastOutTime, ":")
                    });
                }
            }
        }
Exemple #7
0
        private void LogPO2Sap(List <BenQGuru.eMES.SAPRFCService.Domain.PO> dns)
        {
            DBDateTime      dbTime           = FormatHelper.GetNowDBDateTime(this.DataProvider);
            InventoryFacade _InventoryFacade = new InventoryFacade(this.DataProvider);

            foreach (BenQGuru.eMES.SAPRFCService.Domain.PO po in dns)
            {
                Po2Sap poLog = new Po2Sap();
                poLog.PONO               = po.PONO;
                poLog.POLine             = po.POLine;
                poLog.SerialNO           = po.SerialNO;
                poLog.Qty                = po.Qty; //
                poLog.Unit               = po.Unit;
                poLog.FacCode            = po.FacCode;
                poLog.InvoiceDate        = po.InvoiceDate; //
                poLog.MCode              = po.MCode;       //SAPMcode
                poLog.SAPMaterialInvoice = po.SAPMaterialInvoice;
                poLog.Operator           = po.Operator;
                poLog.Status             = po.Status;
                poLog.VendorInvoice      = po.VendorInvoice;
                poLog.StorageCode        = po.StorageCode;
                poLog.Remark             = po.Remark;
                poLog.SapDateStamp       = dbTime.DBDate;
                poLog.SapTimeStamp       = dbTime.DBTime;
                //poLog.MaintainDate = FormatHelper.TODateInt(DateTime.Now);
                //poLog.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);
                //poLog.MaintainUser = GetUserCode();
                //poLog.r = "empty";
                //poLog.Message = "empty";
                _InventoryFacade.AddPo2Sap(poLog);
            }
        }
Exemple #8
0
        protected override void UpdateDomainObject(object domainObject)
        {
            if (facade == null)
            {
                facade = new DeliveryFacade(base.DataProvider);
            }

            DBDateTime   dateTime     = FormatHelper.GetNowDBDateTime(this.DataProvider);
            DeliveryNote deliveryNote = domainObject as DeliveryNote;

            try
            {
                string status = deliveryNote.DNStatus;
                if (status == DNStatus.StatusClose)
                {
                    throw new Exception(string.Format("$Disabled_Status_Colse_Update   $Current_DNCode:{0}    $Current_Status: {1}", deliveryNote.DNCode, this.languageComponent1.GetString(status)));
                }
                if (status == DNStatus.StatusUsing)
                {
                    throw new Exception(string.Format("$Disabled_Status_Using_Update   $Current_DNCode:{0}    $Current_Status: {1}", deliveryNote.DNCode, this.languageComponent1.GetString(status)));
                }

                deliveryNote.MaintainUser = this.GetUserCode();
                deliveryNote.MaintainDate = dateTime.DBDate;
                deliveryNote.MaintainTime = dateTime.DBTime;

                this.facade.UpdateDeliveryNote(deliveryNote);
            }
            catch (Exception ex)
            {
                ExceptionManager.Raise(this.GetType().BaseType, "$Error_Update_Domain_Object", ex);
            }
        }
Exemple #9
0
        public void SaveRemoveCarton2RCARDLog(string cartonCode, string rcard, string userCode)
        {
            if (cartonCode.Trim().Length <= 0 || rcard.Trim().Length <= 0)
            {
                return;
            }

            Carton2RCARDLog carton2RCARDLog = (Carton2RCARDLog)this.GetCarton2RCARDLog(cartonCode, rcard);
            DBDateTime      dbDateTime      = FormatHelper.GetNowDBDateTime(this.DataProvider);

            if (carton2RCARDLog != null && string.IsNullOrEmpty(carton2RCARDLog.RemoveUser) && carton2RCARDLog.RemovDate == 0)
            {
                carton2RCARDLog.RemoveUser = userCode;
                carton2RCARDLog.RemovDate  = dbDateTime.DBDate;
                carton2RCARDLog.RemovTime  = dbDateTime.DBTime;

                this.UpdateCarton2RCARDLog(carton2RCARDLog);
            }
            else
            {
                Carton2RCARDLog newCarton2RCARDLog = this.CreateNewCarton2RCARDLog();

                newCarton2RCARDLog.Serial     = 0;
                newCarton2RCARDLog.CartonCode = cartonCode;
                newCarton2RCARDLog.Rcard      = rcard;
                newCarton2RCARDLog.RemoveUser = userCode;
                newCarton2RCARDLog.RemovDate  = dbDateTime.DBDate;
                newCarton2RCARDLog.RemovTime  = dbDateTime.DBTime;

                this.AddCarton2RCARDLog(newCarton2RCARDLog);
            }
        }
        private void btnQuery_Click(object sender, EventArgs e)
        {
            EquipmentFacade equipmentFacade = new EquipmentFacade(this.DataProvider);

            object[] objs = equipmentFacade.QueryEQPMaintenanceAutoRemind(this.drpEQPID.SelectedItemValue.ToString(), this.ucLabelEditMaintainITEM.Value.Trim(), this.drpMaintainTYPE.SelectedItemValue.ToString());
            dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);
            _DataTableLoadedPart.Clear();

            if (objs == null)
            {
                ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Normal, "$CS_No_Data_To_Display"));
                return;
            }

            for (int i = 0; i < objs.Length; i++)
            {
                DBDateTime             now = FormatHelper.GetNowDBDateTime(this.DataProvider);
                EQPMaintenanceForQuery eqpMaintenanceForQuery = objs[i] as EQPMaintenanceForQuery;
                _DataTableLoadedPart.Rows.Add(new object[] {
                    eqpMaintenanceForQuery.Eqpid,
                    eqpMaintenanceForQuery.Eqpname,
                    getMaintainType(eqpMaintenanceForQuery.MaintainType),
                    eqpMaintenanceForQuery.MaintainITEM,
                    getCycleString(eqpMaintenanceForQuery.CycleType),
                    eqpMaintenanceForQuery.Frequency,
                    FormatHelper.ToDateString(eqpMaintenanceForQuery.Mdate, "-"),
                    FormatHelper.ToDateString(eqpMaintenanceForQuery.LastMaintenanceDate, "-"),
                    eqpMaintenanceForQuery.ActDuration,
                    eqpMaintenanceForQuery.LastTime
                });
            }
        }
Exemple #11
0
        public void SaveRemovePallet2RcardLog(string palletCode, string rcard, string userCode)
        {
            if (palletCode.Trim().Length <= 0 || rcard.Trim().Length <= 0)
            {
                return;
            }

            Pallet2RcardLog pallet2RcardLog = (Pallet2RcardLog)this.GetPallet2RcardLog(palletCode, rcard);
            DBDateTime      dbDateTime      = FormatHelper.GetNowDBDateTime(this.DataProvider);

            if (pallet2RcardLog != null && string.IsNullOrEmpty(pallet2RcardLog.RemoveUser) && pallet2RcardLog.RemovDate == 0)
            {
                pallet2RcardLog.RemoveUser = userCode;
                pallet2RcardLog.RemovDate  = dbDateTime.DBDate;
                pallet2RcardLog.RemovTime  = dbDateTime.DBTime;

                this.UpdatePallet2RcardLog(pallet2RcardLog);
            }
            else
            {
                Pallet2RcardLog newPallet2RcardLog = this.CreateNewPallet2RcardLog();

                newPallet2RcardLog.Serial     = 0;
                newPallet2RcardLog.PalletCode = palletCode;
                newPallet2RcardLog.Rcard      = rcard;
                newPallet2RcardLog.RemoveUser = userCode;
                newPallet2RcardLog.RemovDate  = dbDateTime.DBDate;
                newPallet2RcardLog.RemovTime  = dbDateTime.DBTime;

                this.AddPallet2RcardLog(newPallet2RcardLog);
            }
        }
        public bool InitWithoutResAndOP(IDomainDataProvider dataProvider, string ssCode, DBDateTime dbDateTime)
        {
            bool returnValue = false;

            BaseModelFacade  baseModelFacade  = new BaseModelFacade(dataProvider);
            ShiftModelFacade shiftModelFacade = new ShiftModelFacade(dataProvider);

            _DataProvider = dataProvider;
            _DBDateTime   = dbDateTime;

            //获取对应的SS
            _StepSequence = (StepSequence)baseModelFacade.GetStepSequence(ssCode);
            if (_StepSequence == null)
            {
                return(returnValue);
            }

            //获取当前的ShiftDate
            _ShiftDate = shiftModelFacade.GetShiftDayBySS(_StepSequence, _DBDateTime.DateTime);

            //获取当前的Shift
            _Shift = (Shift)shiftModelFacade.GetShift(_StepSequence.ShiftTypeCode, _DBDateTime.DBTime);
            if (_Shift == null)
            {
                return(returnValue);
            }

            returnValue = true;

            return(returnValue);
        }
Exemple #13
0
        protected override object GetEditObject()
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }

            DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);

            Domain.Warehouse.Sapcloseperiod route = this._facade.CreateNewSapcloseperiod();

            route.Serial       = string.IsNullOrEmpty(this.txtserial.Text.Trim()) ? 0: Int32.Parse(this.txtserial.Text.Trim());
            route.StartDate    = FormatHelper.TODateInt(this.txtDateUseEdit.Text.Trim());
            route.StartTime    = FormatHelper.TOTimeInt(this.txtOnTimeEdit.Text.Trim());
            route.EndDate      = FormatHelper.TODateInt(this.txtToDateEdit.Text.Trim());
            route.EndTime      = FormatHelper.TOTimeInt(this.txtOffTimeEdit.Text.Trim());
            route.CDate        = dbDateTime.DBDate;
            route.CTime        = dbDateTime.DBTime;
            route.CUser        = this.GetUserCode();
            route.MaintainUser = this.GetUserCode();
            route.MaintainDate = dbDateTime.DBDate;
            route.MaintainTime = dbDateTime.DBTime;

            return(route);
        }
Exemple #14
0
        protected void cmdAdd_ServerClick(object sender, EventArgs e)
        {
            ArrayList GridCheckList = this.gridHelper.GetCheckedRows();

            if (GridCheckList.Count > 0)
            {
                if (_facade == null)
                {
                    _facade = new Material.EquipmentFacade(base.DataProvider);
                }
                DBDateTime     currentDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);
                EQPMaintainLog _EQPMaintainLog = null;

                foreach (GridRecord row in GridCheckList)
                {
                    _EQPMaintainLog              = new EQPMaintainLog();
                    _EQPMaintainLog.Eqpid        = row.Items.FindItemByKey("EQPID").Text.ToString().Trim();
                    _EQPMaintainLog.MaintainITEM = row.Items.FindItemByKey("MaintenanceItem").Text.ToString().Trim();
                    _EQPMaintainLog.MaintainType = row.Items.FindItemByKey("MaintenanceType").Text.ToString().Trim();
                    _EQPMaintainLog.Result       = row.Items.FindItemByKey("MaintenanceResult").Text == "true" ? "OK" : "NG";
                    _EQPMaintainLog.MEMO         = row.Items.FindItemByKey("MaintenanceMemo").Text == null ? "" : FormatHelper.CleanString(row.Items.FindItemByKey("MaintenanceMemo").Text.ToString().Trim(), 400);
                    _EQPMaintainLog.Muser        = this.GetUserCode();
                    _EQPMaintainLog.Mdate        = currentDateTime.DBDate;
                    _EQPMaintainLog.Mtime        = currentDateTime.DBTime;
                    _facade.AddEQPMaintainLog(_EQPMaintainLog);
                }
            }
            this.RequestData();
        }
Exemple #15
0
        protected void cmdSaveReturn_ServerClick(object sender, System.EventArgs e)
        {
            if (this.txtReasonAnalysis.Text.Trim() == string.Empty && this.txtMeasureMethod.Text.Trim() == string.Empty)
            {
                this.Response.Redirect(this.MakeRedirectUrl("./FAlertNoticeMP.aspx"));
            }
            else
            {
                if (!SaveCheck())
                {
                    return;
                }

                AlertNotice notice = (AlertNotice)this._AlertFacade.GetAlertNotice(int.Parse(Request["SERIAL"]));

                notice.Status = AlertNoticeStatus.AlertNoticeStatus_HasDeal;
                //Modified By Nettie Chen 2009/09/22
                //notice.DealDate = FormatHelper.TODateInt(DateTime.Now.ToShortDateString());
                //notice.DealTime = FormatHelper.TOTimeInt(DateTime.Now);
                DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);
                notice.DealDate = dbDateTime.DBDate;
                notice.DealTime = dbDateTime.DBTime;
                //End Modified
                notice.DealUser = this.GetUserCode();

                notice.AnalysisReason = this.txtReasonAnalysis.Text.Trim();
                notice.DealMethods    = this.txtMeasureMethod.Text.Trim();

                ArrayList noticeArray = new ArrayList();
                noticeArray.Add(notice);

                this._AlertFacade.QuickDealAlertNotice((AlertNotice[])noticeArray.ToArray(typeof(AlertNotice)));
                this.Response.Redirect(this.MakeRedirectUrl("./FAlertNoticeMP.aspx"));
            }
        }
Exemple #16
0
        private void DoQuery()
        {
            WatchPanelFacade watchPanelFacade = new WatchPanelFacade(this.DataProvider);
            DBDateTime       now = FormatHelper.GetNowDBDateTime(this.DataProvider);

            //Alert Notice
            Label labelAlertNotice = new Label();

            labelAlertNotice.Text = string.Empty;

            object[] alertNoticeArray = watchPanelFacade.QueryAlertNoticeList(now.DBDate);
            if (alertNoticeArray != null)
            {
                for (int i = 0; i < alertNoticeArray.Length; i++)
                {
                    AlertNotice alertNotice = (AlertNotice)alertNoticeArray[i];
                    if (labelAlertNotice.Text.Trim().Length > 0)
                    {
                        labelAlertNotice.Text += "<br>";
                    }

                    int seq = i + 1;
                    labelAlertNotice.Text += seq.ToString() + ": ";
                    labelAlertNotice.Text += alertNotice.NoticeContent;
                }
            }

            this.PanelAlertNotice.Controls.Add(labelAlertNotice);
        }
Exemple #17
0
        private void SaveDocmentsNo(string newKzCode, string userCode)
        {
            DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);

            _WarehouseFacade = new WarehouseFacade(DataProvider);

            SERIALBOOK serialbook = new SERIALBOOK();

            serialbook.SNPrefix  = newKzCode.Substring(0, 7);
            serialbook.MaxSerial = newKzCode.Substring(7, 3);
            serialbook.MDate     = dbDateTime.DBDate;                              //当前日期
            serialbook.MTime     = dbDateTime.DBTime;                              //当前时间
            serialbook.MUser     = userCode;                                       //维护人=登录用户

            string oldserial = _WarehouseFacade.GetMaxSerial(serialbook.SNPrefix); //通过前缀获取流水号

            if (oldserial == "")
            {
                _WarehouseFacade.AddSerialBook(serialbook);//新增到serialbook表
            }
            else
            {
                _WarehouseFacade.UpdateSerialBook(serialbook);//更新到serialbook表
            }
        }
        protected override void AddDomainObject(object domainObject)
        {
            if (facade == null)
            {
                facade = new InventoryFacade(base.DataProvider);
            }
            DBDateTime  dateTime    = FormatHelper.GetNowDBDateTime(this.DataProvider);
            InvBusiness invBusiness = domainObject as InvBusiness;

            object obj = this.facade.GetInvBusiness(invBusiness.BusinessCode, GlobalVariables.CurrentOrganizations.First().OrganizationID);

            if (obj != null)
            {
                ExceptionManager.Raise(this.GetType(), "$Error_Primary_Key_Overlap");
            }

            invBusiness.MaintainUser = this.GetUserCode();
            invBusiness.MaintainDate = dateTime.DBDate;
            invBusiness.MaintainTime = dateTime.DBTime;

            this.facade.AddInvBusiness(invBusiness);

            //this.rdoTypeProduce.Enabled = false;
            //this.rdoTypeNoneProduce.Enabled = false;
        }
Exemple #19
0
        public string CreateAutoDocmentsNo()
        {
            //DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);
            DBDateTime      dbTime           = FormatHelper.GetNowDBDateTime(this.DataProvider);
            string          stno             = dbTime.DBDate.ToString().Substring(2, 6);
            WarehouseFacade _WarehouseFacade = new WarehouseFacade(DataProvider);
            string          prefix           = "M" + stno;
            string          maxserial        = _WarehouseFacade.GetMaxSerial(prefix);//通过前缀获取最大流水号

            //如果已是最大值就返回为空
            if (maxserial == "999")
            {
                return("");
            }

            SERIALBOOK serialbook = new SERIALBOOK();

            if (maxserial == "")
            {
                serialbook.SNPrefix  = prefix; /// 序列号前缀 物料代码
                serialbook.MaxSerial = "001";  /// 序列号最大Serial号码

                //序列号(3位)
                return(prefix + string.Format("{0:000}", int.Parse(serialbook.MaxSerial)));
            }
            else
            {
                serialbook.SNPrefix  = prefix;
                serialbook.MaxSerial = (int.Parse(maxserial) + 1).ToString();
                //序列号(3位)
                return(prefix + string.Format("{0:000}", int.Parse(serialbook.MaxSerial)));
            }
        }
        public void GenerateNewTransactionCode(IDomainDataProvider dataProvider)
        {
            DBDateTime currentDateTime = FormatHelper.GetNowDBDateTime(dataProvider);

            this.m_TransactionCode = TransferFacade.MOMaterialTransferJobID + "_"
                                     + currentDateTime.DBDate.ToString() + "_" + currentDateTime.DBTime.ToString() + DateTime.Now.Millisecond.ToString();
        }
Exemple #21
0
        public void CancelPause(string userCode, string cancelSeq, string cancelReason, IList <CancelPauseQuery> cancelPauseList)
        {
            try
            {
                DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider);

                this.DataProvider.BeginTransaction();

                foreach (CancelPauseQuery obj in cancelPauseList)
                {
                    ////解除停发
                    //
                    this.UpdateCancelPause(cancelSeq, cancelReason, obj.StorageCode, obj.StackCode, obj.PauseCode, obj.ItemCode, dbDateTime, userCode, "");
                }

                ////如果rcard都被解除停发,则把header资料解除停发
                //
                this.UpdateCancelPauseHead(cancelPauseList[0].PauseCode, dbDateTime, userCode);

                this.DataProvider.CommitTransaction();
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();

                throw ex;
            }
        }
Exemple #22
0
        private ArrayList CheckItem(object obj)
        {
            DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);
            ArrayList  itemFeeder = new ArrayList();

            try
            {
                SMTFeederMaterial item = (SMTFeederMaterial)obj;
                item.ProductCode        = item.ProductCode.ToUpper();
                item.StepSequenceCode   = item.StepSequenceCode.ToUpper();
                item.MachineCode        = item.MachineCode.ToUpper();
                item.SourceMaterialCode = item.SourceMaterialCode.ToUpper();
                item.MachineStationCode = item.MachineStationCode.ToUpper();
                item.MaterialCode       = item.MaterialCode.ToUpper();
                item.FeederSpecCode     = item.FeederSpecCode.ToUpper();
                item.TableGroup         = item.TableGroup.ToUpper();
                item.MaintainDate       = dbDateTime.DBDate;
                item.MaintainTime       = dbDateTime.DBTime;
                item.MaintainUser       = this.GetUserCode();
                item.EAttribute1        = "True";
                if (item.TableGroup == string.Empty)
                {
                    item.TableGroup = "A";
                }


                itemFeeder.Add(item);
                CheckImportResult(itemFeeder);
            }
            catch (Exception ex)
            {
            }
            return(itemFeeder);
        }
Exemple #23
0
        /// <summary>
        /// 由编辑区的输入获得DomainObject
        /// </summary>
        /// <returns></returns>
        protected override object GetEditObject()
        {
            //			this.ValidateInput();

            if (_facade == null)
            {
                _facade = new DocumentFacade(base.DataProvider);
            }
            DBDateTime     currentDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);
            DocDirForQuery docDir          = new DocDirForQuery();

            docDir.Dirserial           = this.txtDirSerialEdit.Text == "" ? 0 : int.Parse(this.txtDirSerialEdit.Text);
            docDir.Dirseq              = int.Parse(this.txtDirSequenceEdit.Text);
            docDir.Dirname             = FormatHelper.CleanString(this.txtDirNameEdit.Text, 40);
            docDir.Dirdesc             = FormatHelper.CleanString(this.txtMemoEdit.Text, 100);
            docDir.Pdirserial          = String.IsNullOrEmpty(this.drpParentDirCodeEdit.SelectedValue)?0:int.Parse(this.drpParentDirCodeEdit.SelectedValue);
            docDir.UploadUsergroupcode = FormatHelper.CleanString(this.txtUploadUserGroupEdit.Text, 200);
            docDir.QueryUsergroupcode  = FormatHelper.CleanString(this.txtQueryUserGroupEdit.Text, 200);
            docDir.CheckUsergroupcode  = FormatHelper.CleanString(this.txtCheckUserGroupEdit.Text, 200);
            docDir.Mdate        = currentDateTime.DBDate;
            docDir.Mtime        = currentDateTime.DBTime;
            docDir.MaintainUser = this.GetUserCode();


            return(docDir);
        }
Exemple #24
0
        protected void cmdSave_ServerClick(object sender, EventArgs e)
        {
            if (this.ValidateInput())
            {
                DBDateTime DBDateTimeNow   = FormatHelper.GetNowDBDateTime(this.DataProvider);
                object     ObjectIQCDetail = this.GetEditObject();

                object objectIQCDetailGet = this._IQCFacade.GetIQCDetail(((IQCDetail)ObjectIQCDetail).IQCNo, ((IQCDetail)ObjectIQCDetail).STLine);

                if (objectIQCDetailGet != null)
                {
                    ((IQCDetail)objectIQCDetailGet).Attribute    = ((IQCDetail)ObjectIQCDetail).Attribute;
                    ((IQCDetail)objectIQCDetailGet).PurchaseMEMO = ((IQCDetail)ObjectIQCDetail).PurchaseMEMO;
                    object objectASN = this._IQCFacade.GetASN(((IQCDetail)objectIQCDetailGet).STNo);
                    if (objectASN != null)
                    {
                        if (((ASN)objectASN).Flag.Trim() == IQCTicketType.IQCTicketType_PO)
                        {
                            ((IQCDetail)objectIQCDetailGet).ReceiveQty = Math.Round(((IQCDetail)ObjectIQCDetail).ReceiveQty, 2);
                        }
                    }


                    ((IQCDetail)objectIQCDetailGet).MaintainDate = DBDateTimeNow.DBDate;
                    ((IQCDetail)objectIQCDetailGet).MaintainTime = DBDateTimeNow.DBTime;
                    ((IQCDetail)objectIQCDetailGet).MaintainUser = this.GetUserCode();
                    _IQCFacade.UpdateIQCDetail((IQCDetail)objectIQCDetailGet);
                }

                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Save);
            }
        }
        private string CreateStNO()
        {
            WarehouseFacade warehouseFacade = new WarehouseFacade(base.DataProvider);
            DBDateTime      dbDateTime      = FormatHelper.GetNowDBDateTime(base.DataProvider);
            string          preFix          = "IN" + dbDateTime.DBDate.ToString().Substring(2);
            object          objSerialBook   = warehouseFacade.GetSerialBook(preFix);

            if (objSerialBook == null)
            {
                SERIALBOOK serialBook = new SERIALBOOK();
                serialBook.SNPrefix  = preFix;
                serialBook.MaxSerial = "1";
                serialBook.MUser     = this.GetUserCode();
                serialBook.MDate     = dbDateTime.DBDate;
                serialBook.MTime     = dbDateTime.DBTime;

                warehouseFacade.AddSerialBook(serialBook);
                return(preFix + "0001");
            }
            else
            {
                SERIALBOOK serialBook = (SERIALBOOK)objSerialBook;
                if (serialBook.MaxSerial == "9999")
                {
                    throw new Exception("今天的入库指令号已用!");
                }
                serialBook.MaxSerial = (Convert.ToInt32(serialBook.MaxSerial) + 1).ToString();

                warehouseFacade.UpdateSerialBook(serialBook);
                return(serialBook.SNPrefix + serialBook.MaxSerial.PadLeft(4, '0'));
            }
        }
Exemple #26
0
        protected override object GetEditObject()
        {
            if (_facade == null)
            {
                _facade = new PerformanceFacade(base.DataProvider);
            }

            DBDateTime     dbDateTime     = FormatHelper.GetNowDBDateTime(this.DataProvider);
            ExceptionEvent exceptionEvent = this._facade.CreateNewExceptionEvent();

            exceptionEvent.Serial        = this.txtSerial.Text == string.Empty ? 0 : int.Parse(this.txtSerial.Text);
            exceptionEvent.ShiftDate     = FormatHelper.TODateInt(this.DateEdit.Text);
            exceptionEvent.SSCode        = FormatHelper.CleanString(this.txtSSEdit.Text.ToUpper());
            exceptionEvent.ShiftCode     = FormatHelper.CleanString(this.txtShiftCodeEdit.Text.ToUpper());
            exceptionEvent.ItemCode      = FormatHelper.CleanString(this.txtItemCodeEdit.Text.ToUpper());
            exceptionEvent.BeginTime     = FormatHelper.TOTimeInt(this.BeginTimeEdit.TimeString);
            exceptionEvent.EndTime       = FormatHelper.TOTimeInt(this.EndTimeEdit.TimeString);
            exceptionEvent.ExceptionCode = FormatHelper.CleanString(this.txtExceptionCodeEdit.Text.ToUpper());
            exceptionEvent.Memo          = FormatHelper.CleanString(this.txtMemoEdit.Text.ToUpper());
            exceptionEvent.ComfirmMemo   = FormatHelper.CleanString(this.txtComfirmMEMOEdit.Text.ToUpper());
            exceptionEvent.MaintainUser  = this.GetUserCode();
            exceptionEvent.MaintainDate  = dbDateTime.DBDate;
            exceptionEvent.MaintainTime  = dbDateTime.DBTime;

            return(exceptionEvent);
        }
Exemple #27
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);
     }
 }
        private MO2SAP GetMO2SAP(int getCount)
        {
            DBDateTime currentDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);
            MO2SAP     mo2sap          = new MO2SAP();

            mo2sap.EAttribute1    = "";
            mo2sap.ErrorMessage   = "";
            mo2sap.Flag           = "MES";
            mo2sap.MaintainUser   = base.GetUserCode();
            mo2sap.MOCloseDate    = this.dateConfirmDateEdit.Text == "" ? 0 : FormatHelper.TODateInt(this.dateConfirmDateEdit.Date_DateTime);
            mo2sap.MOCode         = this.txtMoCodeQuery.Text.ToUpper();
            mo2sap.MOConfirm      = this.drpConfirmStatusEdit.SelectedValue;
            mo2sap.MOGrade        = this.txtGradeEdit.Text.Trim().Length == 0 ? "" : this.txtGradeEdit.Text.ToUpper().Trim();
            mo2sap.MOLocation     = this.txtMOLocationEdit.Text.Trim();
            mo2sap.MOMachineHour  = this.txtMachineHourEdit.Text.Trim().Length == 0 ? "" : this.txtMachineHourEdit.Text.Trim();
            mo2sap.MOManHour      = this.txtManHourEdit.Text.Trim().Length == 0 ? "" : this.txtManHourEdit.Text.Trim();
            mo2sap.MOOP           = this.txtOPCodeEdit.Text;
            mo2sap.MOProduced     = getCount;
            mo2sap.MOScrap        = decimal.Parse(this.txtConfirmScrapQtyEdit.Text.Trim());
            mo2sap.PostSequence   = (this._MOFacade.GetMO2SAPMaxPostSeq(mo2sap.MOCode) as MO2SAP).PostSequence + 1;
            mo2sap.OrganizationID = GlobalVariables.CurrentOrganizations.First().OrganizationID;
            mo2sap.MaintainDate   = currentDateTime.DBDate;
            mo2sap.MaintainTime   = currentDateTime.DBTime;
            return(mo2sap);
        }
Exemple #29
0
        /// <summary>
        /// 由编辑区的输入获得DomainObject
        /// </summary>
        /// <returns></returns>
        protected override object GetEditObject()
        {
            //			this.ValidateInput();
            DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);

            if (_DocumentFacade == null)
            {
                _DocumentFacade = new DocumentFacade(base.DataProvider);
            }
            Doc doc = this._DocumentFacade.CreateNewDOC();

            if (this.txtDocDirQuery.Text.Trim() != string.Empty)
            {
                doc.Dirserial = int.Parse(this.txtDocDirQuery.Text.Trim());
            }
            else
            {
                doc.Dirserial = 0;
            }
            if (this.txtDocSerialEdit.Text.Trim() == string.Empty)
            {
                doc.Docserial = 0;
            }
            else
            {
                doc.Docserial = int.Parse(this.txtDocSerialEdit.Text.Trim());
            }

            doc.MaintainUser = this.GetUserCode();
            doc.Mdate        = dbDateTime.DBDate;
            doc.Mtime        = dbDateTime.DBTime;


            return(doc);
        }
Exemple #30
0
        protected object GetEditObject()
        {
            if (_TransferFacade == null)
            {
                _TransferFacade = new WarehouseFacade(this.DataProvider);
            }
            DBDateTime  DBDateTimeNow = FormatHelper.GetNowDBDateTime(this.DataProvider);
            InvTransfer transfer      = new InvTransfer();

            if (ViewState["operate"].ToString() == "Edit")
            {
                transfer = (InvTransfer)this._TransferFacade.GetInvTransfer(FormatHelper.CleanString(this.txtTransferNoEdit.Text));
                if (transfer == null)
                {
                    return(null);
                }
            }
            transfer.TransferNO    = FormatHelper.CleanString(this.txtTransferNoEdit.Text.Trim().ToUpper(), 40);
            transfer.Rectype       = FormatHelper.CleanString(this.DrpRECTypeEdit.SelectedValue);
            transfer.FromStorageID = FormatHelper.CleanString(this.txtFromStorageIDQueryEdit.Text.Trim().ToUpper(), 40);
            transfer.ToStorageID   = FormatHelper.CleanString(this.txtToStorageIDQueryEdit.Text.Trim().ToUpper(), 40);
            transfer.Memo          = FormatHelper.CleanString(this.txtRemark.Text, 2000);

            transfer.Mdate = DBDateTimeNow.DBDate;
            transfer.Mtime = DBDateTimeNow.DBTime;
            transfer.Muser = this.GetUserCode();

            return(transfer);
        }
Exemple #31
0
 public static object ToDBObject(DBDateTime aDBType)
 {
     if ((aDBType == null) || !aDBType.HasValue)
     {
         return DBNull.Value;
     }
     return (DateTime) aDBType;
 }