Beispiel #1
0
 public IList<PilotMoInfo> GetPilotMoList(PilotMoInfo condition, string beginCdt, string endCdt)
 {
     try
     {
         DateTime beginday = DateTime.Parse(beginCdt + " 00:00:00");
         DateTime endday = DateTime.Parse(endCdt + " 23:59:59");
         IList<PilotMoInfo> ret = iMORepository.SearchPilotMo(condition, beginday, endday);
         return ret;
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
    protected void btnAdd_ServerClick(object sender, EventArgs e)
    {
        try
        {
            PilotMoInfo item = new PilotMoInfo();
            item.stage = this.cmbStage.SelectedValue.ToString();
            item.moType = this.cmbMOType.SelectedItem.Text.ToString();
            if (this.cmbStage.SelectedValue.ToString() == "SA")
            {
                item.model = this.cmbModel.SelectedValue.ToString();
            }
            else
            {
                item.model = this.txtModel.Text.Trim();
            }
            item.qty = Convert.ToInt32(this.txtQty.Text.Trim());
            item.planStartTime = Convert.ToDateTime(this.hidPlanTime.Value.ToString());
            item.partNo = this.txtPartNo.Text.Trim();
            item.vendor = this.txtVendor.Text.Trim();
            item.causeDescr = this.txtCauesDescr.Text.Trim();
            item.remark = this.txtRemark.Text.Trim();
            item.editor = this.UserId.ToString();
            string startmotype = this.cmbMOType.SelectedValue.ToString().Trim();
            string endmotype = this.cmbEndMoType.SelectedValue.ToString().Trim();

            iPilotRunMO.GenPilotRunMo(item, startmotype, endmotype, Customer);
        }
        catch (FisException exp)
        {
            this.txtModel.Enabled = false;
            this.cmbModel.Enabled = false;
            writeToAlertMessage(exp.mErrmsg);
        }
        catch (Exception exp)
        {
            this.txtModel.Enabled = false;
            this.cmbModel.Enabled = false;
            writeToAlertMessage(exp.Message.ToString());
        }
        finally
        {
            //ResetPage
            ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "Query", "ResetPage();", true);
        }
    }
Beispiel #3
0
 protected void btnRelease_ServerClick(object sender, EventArgs e)
 {
     try
     {
         PilotMoInfo item = new PilotMoInfo();
         item.mo = this.hidpilotmo.Value.ToString();
         item.moType = this.cmbMOType.SelectedValue.ToString().Trim();
         item.state = "Release";
         iPilotRunMO.ReleasePilotMO(item);
         btnQuery_ServerClick(sender, e);
     }
     catch (FisException fex)
     {
         showErrorMessage(fex.mErrmsg);
         return;
     }
     catch (System.Exception ex)
     {
         showErrorMessage(ex.Message);
         return;
     }
 }
Beispiel #4
0
 protected void btnHole_ServerClick(object sender, EventArgs e)
 {
     try
     {
         PilotMoInfo item = new PilotMoInfo();
         item.mo = this.hidpilotmo.Value.ToString();
         item.state = "Hold";
         iPilotRunMO.UpdatePilotMO(item);
         btnQuery_ServerClick(sender, e);
     }
     catch (FisException fex)
     {
         showErrorMessage(fex.mErrmsg);
         return;
     }
     catch (System.Exception ex)
     {
         showErrorMessage(ex.Message);
         return;
     }
 }
Beispiel #5
0
 protected void btnSave_ServerClick(object sender, EventArgs e)
 {
     try
     {
         string pilotmo = this.hidpilotmo.Value.ToString();
         //string pilotmo = this.lblPilotMOContent.Text.Trim();
         int qty = Convert.ToInt32(this.txtQty.Text.ToString());
         int combineqty = Convert.ToInt32(this.hidcombineqty.Value.ToString());
         if (qty == 0 && combineqty == 0)
         {
             iPilotRunMO.DeletePilotMO(pilotmo);
         }
         else
         { 
             PilotMoInfo item = new PilotMoInfo();
             item.mo = pilotmo;
             item.qty = qty;
             if (qty == combineqty)
             {
                 item.combinedState = PilotMoCombinedStateEnum.Full.ToString();
             }
             else if (combineqty == 0)
             {
                 item.combinedState = PilotMoCombinedStateEnum.Empty.ToString();
             }
             else if (combineqty > 0)
             {
                 item.combinedState = PilotMoCombinedStateEnum.Partial.ToString();
             }
             iPilotRunMO.UpdatePilotMO(item);
         }
        
         btnQuery_ServerClick(sender, e);
     }
     catch (FisException fex)
     {
         showErrorMessage(fex.mErrmsg);
         return;
     }
     catch (System.Exception ex)
     {
         showErrorMessage(ex.Message);
         return;
     }
 }
Beispiel #6
0
 protected void btnQuery_ServerClick(object sender, EventArgs e)
 {
     try
     {
         string beginday = this.hidfromday.Value;
         string endday = this.hidtoday.Value;
         string motype = this.cmbMOType.SelectedValue.ToString().Trim();
         IList<PilotMoInfo> ret = new List<PilotMoInfo>();
         PilotMoInfo condition = new PilotMoInfo();
         condition.moType = motype;
         ret = iPilotRunMO.GetPilotMoList(condition,beginday,endday);
         bindTable(ret);
         this.UpdatePanel1.Update();
         ScriptManager.RegisterStartupScript(this.updatePanel, typeof(System.Object), "Query", "setNewItemValue();", true);
     }
     catch (FisException fex)
     {
         showErrorMessage(fex.mErrmsg);
         return;
     }
     catch (System.Exception ex)
     {
         showErrorMessage(ex.Message);
         return;
     }
 }
        public IList<PilotMoInfo> GetPilotMo(PilotMoInfo condition, IList<string> combinedState)
        {
            logger.Debug("(TravelCardPrintProductPlan)GetPilotMo start, model:" + condition.model);
            try
            {
                IMORepository iMORepository = RepositoryFactory.GetInstance().GetRepository<IMORepository>();
                IList<PilotMoInfo> tempPilotMo = iMORepository.SearchPilotMo(condition, combinedState);

                return tempPilotMo;
            }
            catch (FisException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(TravelCardPrintProductPlan)GetPilotMo end, model:" + condition.model);
            }
        }
Beispiel #8
0
        public ArrayList GenPilotRunMo(PilotMoInfo item, string startmotype, string endmotype, string customer)
        {
            logger.Debug("(PilotRunMO)GenPilotRunMo start, [inputModel]:" + item.model);
            ArrayList retValue = new ArrayList();

            FisException ex;
            List<string> erpara = new List<string>();
            try
            {
                string sessionKey = Guid.NewGuid().ToString();
                Session sessionInfo = SessionManager.GetInstance.GetSession(sessionKey, theType);
                if (sessionInfo == null)
                {
                    sessionInfo = new Session(sessionKey, theType, "", "", "", "");
                    Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                    wfArguments.Add("Key", sessionKey);
                    wfArguments.Add("Station", "");
                    wfArguments.Add("CurrentFlowSession", sessionInfo);
                    wfArguments.Add("Editor", item.editor);
                    wfArguments.Add("Customer", customer);
                    wfArguments.Add("PdLine", "");
                    wfArguments.Add("SessionType", theType);
                    //IList<string> productIDList = new List<string>();

                    sessionInfo.AddValue(Session.SessionKeys.VirtualMOIdentifier, startmotype);
                    sessionInfo.AddValue(Session.SessionKeys.PilotMoSuffix, endmotype);
                    sessionInfo.AddValue(Session.SessionKeys.PilotMo, item);
                    

                    //Remoting开始,调用workflow
                    WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(CreatePilotMOWF, CreatePilotMORule, wfArguments);
                    sessionInfo.SetInstance(instance);
                    //for generate MB no
                    if (!SessionManager.GetInstance.AddSession(sessionInfo))
                    {
                        sessionInfo.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                        erpara.Add(sessionKey);
                        ex = new FisException("CHK020", erpara);
                        throw ex;
                    }
                    sessionInfo.WorkflowInstance.Start();
                    sessionInfo.SetHostWaitOne();
                }
                else
                {
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK020", erpara);
                    throw ex;
                }

                //check workflow exception
                if (sessionInfo.Exception != null)
                {
                    if (sessionInfo.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        sessionInfo.ResumeWorkFlow();
                    }
                    throw sessionInfo.Exception;
                }
                IProductRepository iproductRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IMES.FisObject.FA.Product.IProduct>();
                //取session值.返回
                IList<HoldInfo> retlist = (IList<HoldInfo>)sessionInfo.GetValue(ExtendSession.SessionKeys.ProdHoldInfoList);
                retValue.Add(retlist);
                retValue.Add(sessionKey);
                return retValue;
            }
            catch (FisException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(PilotRunMO)GenPilotRunMo End, [inputModel]:" + item.model);
            }
        }
Beispiel #9
0
        public void ReleasePilotMO(PilotMoInfo item)
        {
            try
            {
                IPartRepository iPartRepository = RepositoryFactory.GetInstance().GetRepository<IPartRepository>();
                ConstValueInfo condition = new ConstValueInfo();
                condition.type = "PilotAllowReleaseStation";
                condition.name = item.moType;
                IList<ConstValueInfo> station = iPartRepository.GetConstValueInfoList(condition);
                if (station.Count == 0)
                {
                    UpdatePilotMO(item);
                }
                else
                {
                    string[] tmpstationlst = station[0].value.Split('~');
                    string errorMsgStationList = station[0].value.Replace("~",",");
                    IList<string> stationlst = new List<string>();
                    for (int i = 0; i < tmpstationlst.Length; i++)
                    {
                        stationlst.Add(tmpstationlst[i]);
                    }
                    if (item.moType == "FA")
                    {
                        IProductRepository iProductRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository>();
                        if (iProductRepository.ExistsProductInfoAndLogStation("PilotMo", item.mo, stationlst, 1))
                        {
                            UpdatePilotMO(item);
                        }
                        else
                        {
                            throw new FisException("CHK1071", new string[] { errorMsgStationList });
                        }
                    }
                    else if (item.moType == "SA")
                    {
                        IMBRepository iMBRepository = RepositoryFactory.GetInstance().GetRepository<IMBRepository>();
                        if (iMBRepository.ExistsPCBInfoAndLogStation("PilotMo", item.mo, stationlst, 1))
                        {
                            UpdatePilotMO(item);
                        }
                        else
                        {
                            throw new FisException("CHK1071", new string[] { errorMsgStationList });
                        }
                    }
                    else
                    {
                        UpdatePilotMO(item);
                    }

                }

                //iMORepository.UpdatePilotMo(item);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #10
0
 public void UpdatePilotMO(PilotMoInfo item)
 {
     try
     {
         iMORepository.UpdatePilotMo(item);
     }
     catch (Exception)
     {
         throw;
     }
 }
    protected void cmbPilotMO_Selected(object sender, System.EventArgs e)
    {
        int remainQty;
        if (this.cmbPilotMo.SelectedValue == "")
        {
            this.lbShowPlanQty.Text = "";
            this.lbShowReQty.Text = "";
            this.lbShowPrintQty.Text = "";
        }
        else
        {
            try
            {
                string mo = this.cmbPilotMo.SelectedValue;
                PilotMoInfo pilotMo = new PilotMoInfo();
                IList<string> stateList = new List<string>();
                pilotMo.mo = mo;
                stateList.Add(PilotMoCombinedStateEnum.Empty.ToString());
                stateList.Add(PilotMoCombinedStateEnum.Partial.ToString());
                IList<PilotMoInfo> pilotmoInfo = iTravelCardPrint.GetPilotMo(pilotMo, stateList);

                this.lblMoTypeContent.Text = pilotmoInfo[0].moType.ToString().Trim();
                this.lblMoQtyContent.Text = pilotmoInfo[0].qty.ToString().Trim();
                int Qty = pilotmoInfo[0].qty - pilotmoInfo[0].combinedQty;
                remainQty = Qty;
                this.lblRemainQtyContent.Text = remainQty.ToString();
            }
            catch (FisException ee)
            {
                writeToAlertMessage(ee.mErrmsg);
            }
            catch (Exception ex)
            {
                writeToAlertMessage(ex.Message);
            }
        }
        this.UpdatePanel15.Update();
        this.UpdatePanel16.Update();
        this.UpdatePanel17.Update();
    }
    private void refreshPilotMOContent()
    {
        string model = this.cmbModel.SelectedItem.Text;

        PilotMoInfo pilotMo = new PilotMoInfo();
        IList<string> stateList = new List<string>();
        pilotMo.model = model;
        pilotMo.stage = "FA";
        stateList.Add(PilotMoCombinedStateEnum.Empty.ToString());
        stateList.Add(PilotMoCombinedStateEnum.Partial.ToString());
        IList<PilotMoInfo> pilotMoList = iTravelCardPrint.GetPilotMo(pilotMo, stateList);
        if (pilotMoList.Count > 0)
        {
            initControlPilotMo(pilotMoList);
        }
        else
        {
            //this.cmbMO.Items.Clear();
            //this.cmbMO.Items.Add(string.Empty);
            //this.UpdatePanel12.Update();
            this.lbShowPlanQty.Text = "";
            this.UpdatePanel1.Update();
            this.lbShowReQty.Text = "";
            this.UpdatePanel2.Update();
            this.lbShowPrintQty.Text = "";
            this.UpdatePanel3.Update();
        }

    }