Exemplo n.º 1
0
        /// <summary>
        /// Receive COA
        /// </summary>
        public void ReceiveCOA(string begNO, string endNO, string editor)
        {
            logger.Debug("(_COAStatusChange)ReceiveCOA start, begin NO:" + begNO + " end NO:" + endNO);
            try
            {
                string pno = "";
                IList<COAStatus> coaList = currentRepository.GetCOAStatusRange(begNO, endNO);
                foreach (COAStatus tmp in coaList)
                {
                    string station = "";
                    station = currentRepository.GetStationOfNewestCOALog(tmp.COASN);

                    if (null == editor)
                    {
                        editor = "";
                    }
                    if (null == station || "" == station)
                    {
                        station = "16";
                    }
                    if ("" == pno)
                    {
                        pno = tmp.IECPN;
                    }
                    COALog newItem = new COALog();
                    newItem.Cdt = DateTime.Now;
                    newItem.COASN = tmp.COASN;
                    newItem.Editor = editor;
                    newItem.Tp="COA";
                    newItem.LineID = "RCV";
                    newItem.StationID = station;
                    currentRepository.InsertCOALog(newItem);
                    tmp.Status = station;
                    tmp.Editor = editor;
                    tmp.Udt = DateTime.Now;
                    currentRepository.UpdateCOAStatus(tmp);
                }
                COATransLog newLog = new COATransLog();
                newLog.begNo = begNO;
                newLog.endNo = endNO;
                newLog.cdt = DateTime.Now;
                newLog.status = "01";
                newLog.editor = editor;
                newLog.pno = pno;
                newLog.preStatus = "RE";
                currentRepository.InsertCOATransLog(newLog);
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg, e);
                throw new Exception(e.mErrmsg);
            }
            catch (Exception e)
            {
                logger.Error(e.Message, e);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(_COAStatusChange)ReceiveCOA end, begin NO:" + begNO + " end NO:" + endNO);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Update COA
        /// </summary>
        public void UpdateCOA(string begNO, string endNO, string editor, string status, string pdLine, string station)
        {
            logger.Debug("(_COAStatusChange)UpdateCOA start, begin NO:" + begNO + " end NO:" + endNO);
            try
            {
                string pno = "";
                string preStatus = "";
                IList<COAStatus> coaList = currentRepository.GetCOAStatusRange(begNO, endNO);
                foreach (COAStatus tmp in coaList)
                {
                    string preLine = "";
                    if ("" == pno)
                    {
                        pno = tmp.IECPN;
                    }
                    if ("" == preStatus)
                    {
                        preStatus = tmp.Status;
                    }


                    if (status != null && status != "")
                    {
                        tmp.Status = status.Substring(0,2);
                        if (status.Length > 3)
                        {
                            pdLine = status.Substring(3, 1);
                        }
                    }
                    if (editor != null && editor != "")
                    {
                        tmp.Editor = editor;
                    }
                    
                    tmp.Udt = DateTime.Now;

                    preLine = tmp.LineID;
                    if (pdLine!= null && pdLine != "")
                    {
                        tmp.LineID = pdLine;
                    }

                    currentRepository.UpdateCOAStatus(tmp);
                    COALog newItem = new COALog();
                    newItem.Cdt = DateTime.Now;
                    newItem.Tp = "COA";
                    newItem.COASN = tmp.COASN;
                    newItem.Editor = editor;
                    newItem.LineID = preLine;
                    if (preStatus == "")
                    {
                        newItem.StationID = "16";
                    }
                    else
                    {
                        newItem.StationID = preStatus;
                    }
                    
                    currentRepository.InsertCOALog(newItem);
                }
                COATransLog newLog = new COATransLog();
                newLog.begNo = begNO;
                newLog.endNo = endNO;
                newLog.cdt = DateTime.Now;
                newLog.status = status.Substring(0, 2);
                newLog.editor = editor;
                newLog.pno = pno;
                newLog.preStatus = preStatus;
                currentRepository.InsertCOATransLog(newLog);
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg, e);
                throw new Exception(e.mErrmsg);
            }
            catch (Exception e)
            {
                logger.Error(e.Message, e);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(_COAStatusChange)UpdateCOA end, begin NO:" + begNO + " end NO:" + endNO);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Update CSNMas
        /// </summary>
        public void UpdateCSN(string begNO, string endNO, string editor, string udt, string status, string pdLine)
        {
            logger.Debug("(_CNCardStatusChange)UpdateCSN start, begin NO:" + begNO + " end NO:" + endNO);
            try
            {
                string pno = "";
                string preStatus = "";
                IList<CSNMasInfo> csnMasList = currentRepository.GetCSNMasRange(begNO, endNO);
                foreach (CSNMasInfo tmp in csnMasList)
                {
                    if ("" == pno)
                    {
                        pno = tmp.pno;
                    }
                    if ("" == preStatus)
                    {
                        preStatus = tmp.status;
                    }

                    if (status != "")
                    {
                        tmp.status = status.Substring(0, 2);
                        if (status.Length > 3)
                        {
                            pdLine = status.Substring(3, 1);
                        }
                    }
                    if (editor != "")
                    {
                        tmp.editor = editor;
                    }
                    if (udt != "")
                    {
                        tmp.udt = DateTime.Parse(udt);
                    }
                    if (pdLine != "" && pdLine != null)
                    {
                        tmp.pdLine = pdLine;
                    }
                    else
                    {
                        tmp.pdLine = "";
                    }
                    currentRepository.UpdateCSNMas(tmp);
                     
                    
                    
                    COALog newItem = new COALog();
                    newItem.Cdt = DateTime.Now;
                    newItem.Tp = "CNCard";
                    newItem.COASN = tmp.csn2;
               
                    newItem.Editor = editor;
                    newItem.StationID = "";
                    if (pdLine != "" && pdLine != null)
                    {
                        newItem.LineID = pdLine;
                    }
                    else if (tmp.pdLine != null && tmp.pdLine != "")
                    {
                        newItem.LineID = tmp.pdLine;
                    }
                    else
                    {
                        newItem.LineID = "";
                    }
                    
                    currentRepository.InsertCOALog(newItem);
                }
                COATransLog newLog = new COATransLog();
                newLog.begNo = begNO;
                newLog.endNo = endNO;
                newLog.cdt = DateTime.Now;
                newLog.status = status.Substring(0, 2);
                newLog.editor = editor;
                newLog.pno = pno;
                newLog.preStatus = preStatus;
                currentRepository.InsertCOATransLog(newLog);
                
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg, e);
                throw new Exception(e.mErrmsg);
            }
            catch (Exception e)
            {
                logger.Error(e.Message, e);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(_CNCardStatusChange)UpdateCSN end, begin NO:" + begNO + " end NO:" + endNO);
            }
        }