예제 #1
0
        private void edtCarton_TxtboxKeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                if (this.edtMoCode.Value.Trim() == string.Empty)
                {
                    ApplicationRun.GetInfoForm().AddEx("$CS_CMPleaseInputMO");
                    this.edtMoCode.TextFocus(true, true);
                    return;
                }

                if (this.edtCarton.Value.Trim() == string.Empty)
                {
                    this.edtCarton.TextFocus(true, true);
                    return;
                }

                Package.PackageFacade packageFacade = new BenQGuru.eMES.Package.PackageFacade(this.DataProvider);

                SKDCartonDetail skdCartonDetail = (SKDCartonDetail)packageFacade.QuerySKDCartobDetailWithCarton(FormatHelper.CleanString(this.edtCarton.Value.Trim().ToUpper()));

                if (skdCartonDetail != null && skdCartonDetail.moCode.Trim().ToUpper() != FormatHelper.CleanString(this.edtMoCode.Value.Trim().ToUpper()))
                {
                    ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_CartonNO_Have_Used $CS_Param_MOCode:" + skdCartonDetail.moCode.Trim().ToUpper()));
                    this.edtCarton.TextFocus(true, true);
                    return;
                }

                this.LoadData();
                this.edtItemCode.TextFocus(true, true);
            }
        }
예제 #2
0
        //初始化打印选择项
        private void LoadPrinter()
        {
            this.ucLabelComboxPrinter.Clear();

            // Check Printers
            if (System.Drawing.Printing.PrinterSettings.InstalledPrinters == null ||
                System.Drawing.Printing.PrinterSettings.InstalledPrinters.Count == 0)
            {
                ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_PleaseInstallPrinter"));
                return;
            }
            // End Added

            int defaultprinter = 0;

            for (int i = 0; i < System.Drawing.Printing.PrinterSettings.InstalledPrinters.Count; i++)
            {
                this.ucLabelComboxPrinter.AddItem(System.Drawing.Printing.PrinterSettings.InstalledPrinters[i], System.Drawing.Printing.PrinterSettings.InstalledPrinters[i]);
                System.Drawing.Printing.PrinterSettings pts = new System.Drawing.Printing.PrinterSettings();
                pts.PrinterName = System.Drawing.Printing.PrinterSettings.InstalledPrinters[i];
                if (pts.IsDefaultPrinter)
                {
                    defaultprinter = i;
                }
            }
            this.ucLabelComboxPrinter.SelectedIndex = defaultprinter;
        }
예제 #3
0
        private void FFirstOnline_Load(object sender, System.EventArgs e)
        {
            _firstMsg = UserControl.MutiLanguages.ParserMessage("$Error_FirstOn_Time");            //{0}{1}产线首件上线时间是:{2};
            this.ucRCard.TextFocus(false, true);
            Messages msg = new Messages();

            _facade = new FirstOnlineFacade(this.DataProvider);

            //取产线
            BenQGuru.eMES.BaseSetting.BaseModelFacade _baseFacade = new BenQGuru.eMES.BaseSetting.BaseModelFacade(this.DataProvider);
            Resource res = (Resource)_baseFacade.GetResource(ApplicationService.Current().ResourceCode);

            if (res != null && res.StepSequenceCode != null)
            {
                this.ucSSName.Value = res.StepSequenceCode;
            }
            else
            {
                msg.Add(new UserControl.Message(MessageType.Error, this.ucSSName.Caption + "$Error_Input_Empty"));
                ApplicationRun.GetInfoForm().Add(msg);
                return;
            }

            int i = this._facade.BindShiftTime(this.cbxShiftTime.ComboBoxData.Items, res);

            if (i >= 0)
            {
                this.cbxShiftTime.ComboBoxData.SelectedIndex = i;
                this.dtpBegin.Text = this.cbxShiftTime.ComboBoxData.SelectedItem.ToString();
            }

            this.ucRCard.InnerTextBox.Multiline = false;

            DoSSCodeChange();
        }
예제 #4
0
        private void UpdateDomainObject(Esoppicsng picNG)
        {
            if (m_EsopPicsNGFacade == null)
            {
                m_EsopPicsNGFacade = new EsopPicsNGFacade(this.DataProvider);
            }
            Messages msg = new Messages();

            this.DataProvider.BeginTransaction();
            try
            {
                if (UpLoadFile(picNG, "UPDATE"))
                {
                    m_EsopPicsNGFacade.UpdateEsoppicsng(picNG);
                    this.DataProvider.CommitTransaction();
                    msg.Add(new UserControl.Message(MessageType.Success, "$CS_Save_Success"));
                    ApplicationRun.GetInfoForm().Add(msg);
                }
                else
                {
                    msg.Add(new UserControl.Message(MessageType.Error, "$CS_Save_Lot_Error"));
                    ApplicationRun.GetInfoForm().Add(msg);
                    this.DataProvider.RollbackTransaction();
                }
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                msg.Add(new UserControl.Message(MessageType.Error, "$CS_Save_Lot_Error"));
                ApplicationRun.GetInfoForm().Add(msg);
            }
        }
예제 #5
0
        private void FFirstOffline_Load(object sender, System.EventArgs e)
        {
            _firstMsg = UserControl.MutiLanguages.ParserMessage("$Error_FirstOn_Time");           //{0}{1}产线首件上线时间是:{2};
            _offMsg   = UserControl.MutiLanguages.ParserMessage("$Error_FirstOff_Time");          //{0}{1}产线首件下线线时间是:{2},总共时间为{3}小时{4}分种

            this.ucRCard.TextFocus(false, true);
            Messages msg = new Messages();

            _facade = new FirstOnlineFacade(this.DataProvider);
            //取产线
            BenQGuru.eMES.BaseSetting.BaseModelFacade _baseFacade = new BenQGuru.eMES.BaseSetting.BaseModelFacade(this.DataProvider);
            Resource res = (Resource)_baseFacade.GetResource(ApplicationService.Current().ResourceCode);

            if (res != null && res.StepSequenceCode != null)
            {
                this.ucSSName.Value = res.StepSequenceCode;
            }
            else
            {
                msg.Add(new UserControl.Message(MessageType.Error, this.ucSSName.Caption + "$Error_Input_Empty"));
                ApplicationRun.GetInfoForm().Add(msg);
                return;
            }
            this.ucRCard.InnerTextBox.Multiline = false;
        }
예제 #6
0
 private void txtRcard_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         Messages msg = new Messages();
         if (!string.IsNullOrEmpty(FormatHelper.CleanString(this.txtRcard.Text.Trim().ToUpper())))
         {
             initDrowdownList();
             if (initFlowPicBox())
             {
                 initGirdData();
             }
         }
         else
         {
             clear();
             this.drownListMoCode.Clear();
             this.drownListRouteCode.Clear();
             msg.Add(new UserControl.Message(MessageType.Error, "$CS_RCARD_EMPTY"));
             ApplicationRun.GetInfoForm().Add(msg);
             return;
         }
         txtRcard.SelectAll();
         txtRcard.Focus();
     }
 }
예제 #7
0
        private bool InputPallet(string palletCode, string companyCode)
        {
            InventoryFacade inventoryFacade = new InventoryFacade(this.DataProvider);

            ////检查此垛位是否存在相关产品
            //
            object[] objRcardToStackPalletList = inventoryFacade.GetRcardToStackPallet("", palletCode, "");

            if (objRcardToStackPalletList == null)
            {
                //Message:栈板不存在相关产品
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Error, "$CS_RCARD_NOT_EXIST_IN_PALLET"));
                return(false);
            }

            ////变更Company
            //
            inventoryFacade.UpdateCompany("", palletCode, "", companyCode, ApplicationService.Current().LoginInfo.UserCode);

            ////Add To Grid
            //
            this.LoadDataSource(objRcardToStackPalletList);

            return(true);
        }
예제 #8
0
        //获取批号, 实际批量/标准批量与备注值
        private void GetLotNo()
        {
            DataCollectFacade dcf   = new DataCollectFacade(this.DataProvider);
            string            rcard = this.ucLabelEditRcard.Value.ToUpper().Trim();

            //根据当前序列号获取产品的原始序列号
            string sourceRCard = dcf.GetSourceCard(rcard, string.Empty);

            if (rcard != String.Empty)
            {
                object obj = dcf.GetSimulation(sourceRCard);
                if (obj != null)
                {
                    Simulation sim = obj as Simulation;

                    string oqcLotNo = sim.LOTNO;
                    ucLabelEditLotNo.Value = oqcLotNo;
                    LabOQCLotKeyPress();
                }
                else
                {
                    ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$NoProductInfo"));
                    this.ucLabelEditRcard.Value       = "";
                    this.ucLabelEditItemCode.Value    = "";
                    this.ucLESeparateMemo.Value       = "";
                    this.labelItemDescription.Text    = "";
                    this.ucLSizeAndCapacityMore.Value = "";
                    this.ucLabelEditLotNo.TextFocus(false, true);
                }
            }
            else
            {
                ucLabelEditRcard.TextFocus(false, true);
            }
        }
예제 #9
0
        //检查业务类型
        private bool CheckRule(string inputNo)
        {
            if (this.cboBusinessType.SelectedItemText.Trim().Length == 0)
            {
                return(true);
            }

            InventoryFacade invFacade = new InventoryFacade(this.DataProvider);

            object[] ruleList = invFacade.GetInvBusiness2Formula(this.cboBusinessType.SelectedItemValue.ToString(), GlobalVariables.CurrentOrganizations.First().OrganizationID);

            if (ruleList == null)
            {
                return(true);
            }

            foreach (InvBusiness2Formula rule in ruleList)
            {
                ////检查产品必须完工
                //
                if (rule.FormulaCode.Equals(OutInvRuleCheck.ProductIsFinished))
                {
                    if (!invFacade.CheckRcardIsFinished(inputNo))
                    {
                        //Message:产品序列号未完工
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_RCARD_IS_NOT_FINISHED $CS_Param_RunSeq=" + inputNo));
                        return(false);
                    }
                }
            }

            return(true);
        }
예제 #10
0
        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
                });
            }
        }
예제 #11
0
        private void opsetPackObject_ValueChanged(object sender, EventArgs e)
        {
            if (packObject.Value == packPallet)
            {
                this.ControlEnabled(true);
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Normal, "$CS_Please_Input_PALLET"));
                this.txtInput.TextFocus(true, true);
            }

            if (packObject.Value == packRcard)
            {
                this.ControlEnabled(true);
                if (this.rdoUseOPallet.Checked)
                {
                    packObject.Value = packPallet;
                    return;
                }

                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Normal, "$CS_Please_Input_RunningCard"));
                this.txtInput.TextFocus(true, true);
            }

            if (packObject.Value == packStack)
            {
                this.ControlEnabled(false);

                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Normal, "$CS_PLEASE_INPUT_STACK"));
                this.txtInput.TextFocus(true, true);
            }
        }
예제 #12
0
        private void txtItemCode_TxtboxKeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                string itemCode = this.txtItemCode.Value.Trim().ToUpper();
                if (itemCode == string.Empty)
                {
                    return;
                }

                if (itemCode.Length > 12)
                {
                    itemCode = itemCode.Substring(0, 12);
                    this.txtItemCode.Value = itemCode;
                }

                ItemFacade objFacade = new ItemFacade(this.DataProvider);
                object     objItem   = objFacade.GetItem(FormatHelper.CleanString(itemCode), GlobalVariables.CurrentOrganizations.First().OrganizationID);

                if (objItem != null)
                {
                    this.txtItemDescV.Value = ((Item)objItem).ItemDescription;
                }
                else
                {
                    this.txtItemDescV.Value = "";
                    ApplicationRun.GetInfoForm().Add(
                        new UserControl.Message(MessageType.Error, "$CS_PRODUCT_CODE_NOT_EXIST"));
                }
            }
        }
예제 #13
0
        private void ucButtonOK_Click(object sender, EventArgs e)
        {
            if (this.ultraGridTry.Rows.Count == 0)
            {
                return;
            }

            string tryCode = string.Empty;

            for (int i = 0; i < ultraGridTry.Rows.Count; i++)
            {
                if (ultraGridTry.Rows[i].Cells[0].Text.ToLower() == "true")
                {
                    if (Convert.ToInt32(ultraGridTry.Rows[i].Cells["PlanQty"].Text.Trim()) <= Convert.ToInt32(ultraGridTry.Rows[i].Cells["ActualQty"].Text.Trim()))
                    {
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$Current_TryCode:" + ultraGridTry.Rows[i].Cells["TryCode"].Text +
                                                                                 "   $CS_PlanQty:" + ultraGridTry.Rows[i].Cells["PlanQty"].Text +
                                                                                 "   $CS_ActualQty:" + ultraGridTry.Rows[i].Cells["ActualQty"].Text));
                        return;
                    }

                    tryCode += "," + ultraGridTry.Rows[i].Cells["TryCode"].Text.Trim().ToUpper();
                }
            }

            if (tryCode.Length > 0)
            {
                tryCode = tryCode.Substring(1);
            }
            ParentChildRelateEventArgs <string> args = new ParentChildRelateEventArgs <string>(tryCode);

            this.OnSoftVersionSelectedEvent(sender, args);
            this.Close();
        }
예제 #14
0
        //检查此Rcard所属栈板下Rcard在同一垛位下
        private bool CheckRcardIsInTheSameStack(string pallet, string stackCode)
        {
            InventoryFacade   inventoryFacade   = new InventoryFacade(this.DataProvider);
            PackageFacade     packageFacade     = new PackageFacade(this.DataProvider);
            DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);

            object[] pallet2RCardList = packageFacade.GetPallet2RCardListByPallet(pallet);
            if (pallet2RCardList == null)
            {
                return(true);
            }

            for (int i = 0; i < pallet2RCardList.Length; i++)
            {
                string           cartonCode       = string.Empty;
                SimulationReport simulationReport = (SimulationReport)dataCollectFacade.GetLastSimulationReport(((Pallet2RCard)pallet2RCardList[i]).RCard);
                if (simulationReport != null)
                {
                    cartonCode = simulationReport.CartonCode;
                }

                object[] stack2RcardList = inventoryFacade.QueryStacktoRcardByRcardAndCarton(((Pallet2RCard)pallet2RCardList[i]).RCard, cartonCode);
                if (stack2RcardList != null && !((StackToRcard)stack2RcardList[0]).StackCode.Equals(stackCode))
                {
                    ApplicationRun.GetInfoForm().Add(
                        new UserControl.Message(MessageType.Error, "$CS_RCARD_IS_NOT_INSAME_STACK:" + ((StackToRcard)stack2RcardList[0]).StackCode));
                    return(false);
                }
            }

            return(true);
        }
예제 #15
0
        private void DoQuery(string itemCode, string itemdesc)
        {
            if (itemCode.Length == 0 && itemdesc.Length == 0)
            {
                //Message:请至少填入一个查询条件
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Error, "$CS_INPUT_QUERY_CONDITION"));
                return;
            }

            ItemFacade objFacade = new ItemFacade(this.DataProvider);

            object[] itemList = objFacade.QueryItem(itemCode, itemdesc);

            this.m_dtProduct.Clear();

            if (itemList != null)
            {
                foreach (Item item in itemList)
                {
                    DataRow dr = this.m_dtProduct.NewRow();
                    dr["itemcode"] = item.ItemCode;
                    dr["itemdesc"] = item.ItemDescription;
                    this.m_dtProduct.Rows.Add(dr);
                }
            }
        }
예제 #16
0
        private void cmdOK_Click(object sender, EventArgs e)
        {
            if (this.gridProduct.Rows.Count == 0)
            {
                //表格中没有数据
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Error, "$CS_GRID_NO_RECORD"));
                return;
            }

            if (this.gridProduct.ActiveRow != null)
            {
                Hashtable ht = new Hashtable();
                ht.Add("itemcode", this.gridProduct.ActiveRow.Cells["itemcode"].Value.ToString());
                ht.Add("itemdesc", this.gridProduct.ActiveRow.Cells["itemdesc"].Value.ToString());
                ParentChildRelateEventArgs <Hashtable> args = new ParentChildRelateEventArgs <Hashtable>(ht);
                this.OnProductInfoEvent(sender, args);
                this.Close();
            }
            else
            {
                //请选择一笔数据
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Error, "$CS_GRID_SELECT_ONE_RECORD"));
            }
        }
예제 #17
0
        private void opsLoadMetrial_ValueChanged(object sender, EventArgs e)
        {
            if (this.opsLoadMetrial.Value == "0")
            {
                this.edtWorkSeat.Value     = string.Empty;
                this.edtIQCNo.Value        = string.Empty;
                this.edtMetrialLotNo.Value = string.Empty;

                this.edtWorkSeat.Enabled     = true;
                this.edtIQCNo.Enabled        = true;
                this.edtMetrialLotNo.Enabled = false;

                ApplicationRun.GetInfoForm().AddEx("$Please_Input_WorkSeat");
                this.edtWorkSeat.TextFocus(false, true);
            }

            if (this.opsLoadMetrial.Value == "1")
            {
                this.edtWorkSeat.Value     = string.Empty;
                this.edtIQCNo.Value        = string.Empty;
                this.edtMetrialLotNo.Value = string.Empty;

                this.edtWorkSeat.Enabled     = false;
                this.edtIQCNo.Enabled        = false;
                this.edtMetrialLotNo.Enabled = true;

                ApplicationRun.GetInfoForm().AddEx("$Please_Input_MaterialLot");
                this.edtMetrialLotNo.TextFocus(true, true);
            }
        }
예제 #18
0
파일: FUp.cs 프로젝트: windygu/.net-wms
        private void QueryByRCard()
        {
            string rcard = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.ucLabelEditRcardQuery.Value));

            if (string.IsNullOrEmpty(rcard))
            {
                ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Normal, "$CS_Please_Input_RunningCard"));
                this.ucLabelEditRcardQuery.TextFocus(false, true);
                return;
            }

            DataCollectFacade dcf = new DataCollectFacade(this.DataProvider);
            //获取当前序列号产品对应的最原始的序列号
            string sourceRCard = dcf.GetSourceCard(rcard.Trim().ToUpper(), string.Empty);

            object[] rcardList = dcf.GetDownRCardListByCode(sourceRCard);
            if (rcardList == null || rcardList.Length == 0)
            {
                ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$Error_RCardErrorOrNotInDown"));
                this.ucLabelEditRcardQuery.TextFocus(false, true);
                return;
            }
            else
            {
                this.BindRCardList(rcardList);
                this.ucLabelEditRCardEdit.TextFocus(true, true);
            }
        }
예제 #19
0
        /// <summary>
        /// Check 从垛位使用状况的页面带过来的垛位和库位
        /// </summary>
        /// <returns>true/false</returns>
        private bool CheckSelecetedStackAndStorage(string selectedStorage, string selectedStack, string originalStorage)
        {
            if (originalStorage.Trim().Length == 0)
            {
                //请输入库位
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Error, "$CS_STORAGE_NOT_INPUT"));
                return(false);
            }

            if (!selectedStorage.Equals(originalStorage))
            {
                InventoryFacade inventoryFacade  = new InventoryFacade(this.DataProvider);
                int             stack2RCardCount = inventoryFacade.GetStack2RCardCount(selectedStack, originalStorage);

                if (stack2RCardCount > 0)
                {
                    //垛位和库别不对应
                    ApplicationRun.GetInfoForm().Add(
                        new UserControl.Message(MessageType.Error, "$CS_STACK_STORAGE_NOT_SAME"));
                    return(false);
                }
                else
                {
                    //垛位和库别不对应,确定使用该垛位?

                    if (MessageBox.Show(UserControl.MutiLanguages.ParserMessage("$CS_STACK_STORAGE_NOT_SAME_CONFIRM"), MutiLanguages.ParserString("$ShowConfirm"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
예제 #20
0
        private bool GridCheckd()
        {
            for (int i = 0; i < ultraGridMaterial.Rows.Count; i++)
            {
                if (ultraGridMaterial.Rows[i].Cells[0].Value.ToString().ToLower() == "true")
                {
                    if (string.IsNullOrEmpty(ultraGridMaterial.Rows[i].Cells["RecevieQTY"].Value.ToString()))
                    {
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_ReceiveQty_Not_Empty"));
                        return(false);
                    }


                    if (int.Parse(ultraGridMaterial.Rows[i].Cells["IssueQTY"].Value.ToString()) < int.Parse(ultraGridMaterial.Rows[i].Cells["RecevieQTY"].Value.ToString()))
                    {
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_ReceiveQty_Must_Smaller_IssueQty"));
                        return(false);
                    }

                    if (int.Parse(ultraGridMaterial.Rows[i].Cells["RecevieQTY"].Value.ToString()) < 1)
                    {
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS__ReceiveQty_Must_Over_Zorre"));
                        return(false);
                    }
                }
            }

            return(true);
        }
예제 #21
0
        private void FInvShipImp_Load(object sender, System.EventArgs e)
        {
            _infoForm = ApplicationRun.GetInfoForm();

            UserControl.UIStyleBuilder.FormUI(this);

            #region 初始化Grid
            UserControl.UIStyleBuilder.GridUI(this.ultraGridContent);
            _tmpTable = new DataTable();
            _tmpTable.Columns.Clear();

            _tmpTable.Columns.Add("ShipNo", typeof(string));
            _tmpTable.Columns.Add("Seq", typeof(string));
            _tmpTable.Columns.Add("ShipType", typeof(string));
            _tmpTable.Columns.Add("PartnerCode", typeof(string));
            _tmpTable.Columns.Add("PartnerDesc", typeof(string));
            _tmpTable.Columns.Add("CustomerOrderNo", typeof(string));
            _tmpTable.Columns.Add("ShipMethod", typeof(string));
            _tmpTable.Columns.Add("ShipDate", typeof(string));
            //_tmpTable.Columns.Add( "产品别", typeof( string ) );
            _tmpTable.Columns.Add("ItemCode", typeof(string));
            _tmpTable.Columns.Add("ShipQty", typeof(string));
            _tmpTable.Columns.Add("PrintDate", typeof(string));

            ultraGridContent.DataSource = _tmpTable;

            //this.ultraGridContent.DisplayLayout.Bands[0].Columns["打单日期"].Hidden = true;
            this.txtFileName.InnerTextBox.Multiline = false;
            #endregion
        }
예제 #22
0
        private void edtMoCode_TxtboxKeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                string moCode = FormatHelper.CleanString(this.edtMoCode.Value.Trim().ToUpper());
                if (moCode == string.Empty)
                {
                    this.edtMoCode.TextFocus(true, true);
                    return;
                }

                MOFacade          moFacade = new MOFacade(this.DataProvider);
                Domain.MOModel.MO mo       = (Domain.MOModel.MO)moFacade.GetMO(moCode);

                if (mo == null)
                {
                    ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_MO_Not_Exist $CS_Param_MOCode:" + moCode));
                    this.edtMoCode.TextFocus(false, true);
                    return;
                }

                this.edtitemDesc.Value  = mo.MaterialDescription.Trim();
                this.edtMoPlanQty.Value = Convert.ToString(Convert.ToInt32(mo.MOPlanQty - mo.MOActualQty));
                this.edtMoPlanQty.TextFocus(false, true);
            }
        }
예제 #23
0
        //检查Grid发货数量
        private bool CheckGridSendNumber()
        {
            for (int i = 0; i < ultraGridMetrialDetial.Rows.Count; i++)
            {
                if (ultraGridMetrialDetial.Rows[i].Cells["Check"].Value.ToString().ToLower() == "true")
                {
                    string itemCode = ultraGridMetrialDetial.Rows[i].Cells["ItemCode"].Value.ToString();
                    int    lotInQty = Convert.ToInt32(ultraGridMetrialDetial.Rows[i].Cells["LotQty"].Value.ToString());
                    int    lotQty   = ultraGridMetrialDetial.Rows[i].Cells["SendQty"].Value.ToString().Trim() == string.Empty ? 0 : int.Parse(ultraGridMetrialDetial.Rows[i].Cells["SendQty"].Value.ToString().Trim());

                    if (lotInQty < lotQty)
                    {
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_LotQty_Smaller_LotInQty $CS_MaterialLot:" + ultraGridMetrialDetial.Rows[i].Cells["MetrialLot"].Value.ToString()));
                        return(false);
                    }

                    if (lotQty <= 0)
                    {
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_LotQty_Over_Zero $CS_MaterialLot:" + ultraGridMetrialDetial.Rows[i].Cells["MetrialLot"].Value.ToString()));
                        return(false);
                    }
                }
            }


            return(true);
        }
예제 #24
0
        private bool CheckFiFo(List <string> lotNoList, string itemCode, string vendorCode, int createDate, string storageId)
        {
            //检查FIFO
            DateTime dateTime   = Convert.ToDateTime(FormatHelper.ToDateString(createDate, "-")).AddDays(-Convert.ToInt32(this.edtBufferDate.Value.Trim()));
            int      bufferDate = FormatHelper.TODateInt(dateTime.Date);

            string lotNoString = string.Empty;

            for (int i = 0; i < lotNoList.Count; i++)
            {
                lotNoString += "'" + lotNoList[i].ToString() + "',";;
            }

            if (lotNoString.Length > 0)
            {
                lotNoString = lotNoString.Substring(0, lotNoString.Length - 1);
            }

            if (this.opsCheckFIFO.Value.ToString() == "0")
            {
                vendorCode = string.Empty;
            }

            object[] queryObjects = this.InvFacade.QueryMaterialLot(itemCode, vendorCode, bufferDate, lotNoString, storageId);
            if (queryObjects != null)
            {
                ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_ItemCode:" + itemCode + "$CS_Have_Ever_MaterialLot:" + ((Domain.Material.MaterialLot)queryObjects[0]).MaterialLotNo));
                return(false);
            }

            return(true);
        }
예제 #25
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            EquipmentFacade equipmentFacade = new EquipmentFacade(this.DataProvider);

            object[] objs = equipmentFacade.QueryEQPMaintenanceEffective(this.drpEQPID.SelectedItemValue.ToString(), this.drpSSCode.SelectedItemValue.ToString(), this.ucLabelEditResCode.Value.Trim());

            _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++)
            {
                EQPMaintenanceForEffective eqpMaintenanceForEffective = objs[i] as EQPMaintenanceForEffective;
                _DataTableLoadedPart.Rows.Add(new object[] {
                    eqpMaintenanceForEffective.Eqpid,
                    eqpMaintenanceForEffective.Eqpname,
                    eqpMaintenanceForEffective.SSCode,
                    //eqpMaintenanceForEffective.OpCode,
                    eqpMaintenanceForEffective.ResCode,
                    eqpMaintenanceForEffective.ActusedRate,
                    eqpMaintenanceForEffective.BXRate,
                    eqpMaintenanceForEffective.GoodRate,
                    eqpMaintenanceForEffective.OEE
                });
            }
        }
예제 #26
0
        private void txtUseNPallet_Leave(object sender, EventArgs e)
        {
            if (this.txtUseNPallet.Value.Trim().Length != 0)
            {
                PackageFacade objFacade = new PackageFacade(this.DataProvider);
                object        pallet    = objFacade.GetPallet(this.txtUseNPallet.Value);

                if (pallet != null)
                {
                    //该栈板已存在
                    ApplicationRun.GetInfoForm().Add(
                        new UserControl.Message(MessageType.Error, "$CS_PALLETNO_IS_EXIT"));
                    txtUseNPallet.TextFocus(true, true);
                }

                InventoryFacade inventoryFacade = new InventoryFacade(this.DataProvider);
                object[]        stackToRcardS   = inventoryFacade.GetRcardToStackPallet(this.ucLabelEditStock.Value.Trim(), this.txtUseNPallet.Value, "");

                if (stackToRcardS != null)
                {
                    //该栈板已经在目标垛位中 垛位=
                    ApplicationRun.GetInfoForm().Add(
                        new UserControl.Message(MessageType.Error, "$CS_PALLETNO_IN_TRA_STACK=" + ((RcardToStackPallet)stackToRcardS[0]).StackCode));
                    txtUseNPallet.TextFocus(true, true);
                }
            }
        }
예제 #27
0
        private bool InputStack(string stackCode)
        {
            InventoryFacade inventoryFacade = new InventoryFacade(this.DataProvider);

            SStack stackObject = (SStack)inventoryFacade.GetSStack(stackCode.Trim().ToUpper());

            if (stackObject == null)
            {
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Error, "$CS_Stack_Is_Not_Exist"));
                return(false);
            }

            object[] rcardToStackPallet = inventoryFacade.GetRcardToStackPallet(stackCode.Trim().ToUpper(), string.Empty, string.Empty);

            //转移垛位物料信息
            object[] rcardToStackObjects = inventoryFacade.GetStackToRcardByStack(stackCode.Trim().ToUpper(), string.Empty);

            if (rcardToStackObjects == null)
            {
                //Message:转移垛位没有物料
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Error, "$CS_STACK_Not_Have_Item"));
                return(false);
            }

            if (inventoryFacade.CheckStackIsOnlyAllowOneItem(ucLabelEditStock.Value.ToString()) &&
                CheckStackItemError(this.ucLabelEditStock.Value.Trim(), this.ucLabelComboxINVType.SelectedItemValue.ToString(),
                                    ((RcardToStackPallet)rcardToStackPallet[0]).ItemCode))
            {
                //Message:目标垛位的物料和当前物料不一致
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Error, "$CS_STACK_ITEM_DIFF"));
                return(false);
            }

            //检查垛位容量是否满
            if (!inventoryFacade.CheckStackCapacity(this.ucLabelComboxINVType.SelectedItemValue.ToString().Trim().ToUpper(),
                                                    this.ucLabelEditStock.Value.Trim().ToUpper(), stackCode.Trim().ToUpper()))
            {
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Error, "$CS_STACK_CAPACITY_FULL"));
                return(false);
            }

            //更新垛位
            inventoryFacade.UpdateStackToRcard(this.ucLabelComboxINVType.SelectedItemValue.ToString().Trim().ToUpper(),
                                               this.ucLabelEditStock.Value.Trim().ToUpper(),
                                               ((StackToRcard)rcardToStackObjects[0]).StorageCode,
                                               stackCode.Trim().ToUpper(), ApplicationService.Current().UserCode);


            //Load Grid
            this.LoadGrid(rcardToStackPallet, this.ucLabelEditStock.Value.Trim(), this.txtUseNPallet.Value.Trim());

            return(true);
        }
예제 #28
0
 public void WriteFile(string str)
 {
     try
     {
         StreamWriter sw = new StreamWriter(fileName, false, Encoding.Default);
         sw.Write(str);
         sw.Close();
     }
     catch { ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_Save_File_Failed")); }
 }
예제 #29
0
        private void listPicsNG_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (listPicsNG.SelectedItems.Count > 0)
                {
                    this.pbEsopIMG.Image   = null;
                    this.txtNGPicMemo.Text = string.Empty;
                    this.listPics.SelectedItems.Clear();


                    int        num         = listPicsNG.Items.IndexOf(listPicsNG.SelectedItems[0]);
                    Esoppicsng selectedPic = (Esoppicsng)this.listPicsNG.SelectedItems[0].Tag;
                    this.txtNGPicMemo.Text = selectedPic.Ngpicmemo;
                    string filaPath = "";

                    if (_facade == null)
                    {
                        _facade = new SystemSettingFacade(this.DataProvider);
                    }
                    object parameter = _facade.GetParameter("PUBLISHESOPPICSDIRPATH", "PUBLISHEOPSPICSDIRPATHGROUP");

                    if (parameter != null)
                    {
                        //服务器目录路径
                        filaPath = ((Domain.BaseSetting.Parameter)parameter).ParameterAlias;
                    }

                    string fileName = filaPath + "TS/" + selectedPic.Picsname + ".jpg";

                    try
                    {
                        WebClient wc = new WebClient();
                        wc.Credentials = CredentialCache.DefaultCredentials;
                        // wc.DownloadData(fileName);
                        Stream fs  = wc.OpenRead(fileName);
                        Image  img = Image.FromStream(fs);
                        this.pbEsopIMG.Size  = img.Size;
                        this.pbEsopIMG.Image = img;
                        fs.Flush();
                        fs.Close();
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
            catch (Exception ex)
            {
                Messages msg = new Messages();
                msg.Add(new UserControl.Message(MessageType.Error, "$Error_NoDataSelected"));
                ApplicationRun.GetInfoForm().Add(msg);
                return;
            }
        }
예제 #30
0
 private void FSendMetrial_Load(object sender, EventArgs e)
 {
     InitializeUltraGrid();
     this.LoadPrinter();
     this.BindStockInStorage();
     this.opsLoadMetrial.Value = "0";
     this.opsCheckFIFO.Value   = "0";
     this.InitDateTime();
     this.chkAll.Checked = true;
     ApplicationRun.GetInfoForm().AddEx("$CS_CMPleaseInputMO");
 }