예제 #1
0
        public static List<ImageInfo> GetBartenderServicePrint(PrintItem currentPrinItem)
        {
            List<ImageInfo> result = null;
            if (!string.IsNullOrEmpty(currentPrinItem.TemplateName) &&
                 !string.IsNullOrEmpty(currentPrinItem.SpName) &&
                 currentPrinItem.PrintMode == 4)
            {

                List<ParamInfo> inputParas = new List<ParamInfo>();
                for (int i = 0; i < currentPrinItem.ParameterKeys.Count; i++)
                {
                    ParamInfo newParam = new ParamInfo();
                    newParam.ParamName = currentPrinItem.ParameterKeys[i];
                    newParam.Values = currentPrinItem.ParameterValues[i];
                    inputParas.Add(newParam);
                }

                inputParas.Add(new ParamInfo
                {
                    ParamName = "@Bartender",
                    Values = new List<string> { currentPrinItem.TemplateName }
                });

                string templateName = currentPrinItem.TemplateName + "~" + currentPrinItem.SpName;
                if (string.IsNullOrEmpty(currentPrinItem.dpi))
                {
                    result = getbartenderManager().getImageListForPrint(templateName, null, inputParas, false);
                }
                else
                {
                    result = getbartenderManager().getImageListForPrint(templateName, null, inputParas, false, currentPrinItem.dpi);
                }

            }
            return result;

        }
예제 #2
0
        public static IList<NameValueDataTypeInfo> GetBartenderNameValueList(PrintItem currentPrinItem, string pCode,out string btwFilePath)
        {
			btwFilePath = System.Configuration.ConfigurationManager.AppSettings["ClientBartenderFilePath"];
            IList<NameValueDataTypeInfo> result = new List<NameValueDataTypeInfo>();
            if (!string.IsNullOrEmpty(currentPrinItem.TemplateName) &&
                 !string.IsNullOrEmpty(currentPrinItem.SpName) &&
                currentPrinItem.PrintMode == 3)
            {

                currentPrinItem.ParameterKeys.Add("@Bartender");
                currentPrinItem.ParameterValues.Add(new List<string> { currentPrinItem.TemplateName });

                result = getPrintService().GetBartenderNameValueList(currentPrinItem.SpName, currentPrinItem.ParameterKeys, currentPrinItem.ParameterValues);

                //Get Remote bartendert path
                string remotePath = getPrintTemplate().GetRemoteBartenderPath(pCode);

                if (!string.IsNullOrEmpty(remotePath))
                {
                    btwFilePath = remotePath;
                }

            }
            return result;
        }
예제 #3
0
        public static string GetBartenderXMLScript(PrintItem currentPrinItem, string pCode)
        {
            string btwFilePath = System.Configuration.ConfigurationManager.AppSettings["ClientBartenderFilePath"];
            string result = "";
            if ( !string.IsNullOrEmpty(currentPrinItem.TemplateName) &&
                 !string.IsNullOrEmpty(currentPrinItem.SpName) && 
                currentPrinItem.PrintMode == 3)
            {
              
                currentPrinItem.ParameterKeys.Add("@Bartender");
                currentPrinItem.ParameterValues.Add(new List<string> {currentPrinItem.TemplateName});

                IList<NameValueDataTypeInfo> valueList = getPrintService().GetBartenderNameValueList(currentPrinItem.SpName, currentPrinItem.ParameterKeys, currentPrinItem.ParameterValues);

                //Get Remote bat path
                string remotePath = getPrintTemplate().GetRemoteBartenderPath(pCode);

                if (string.IsNullOrEmpty(remotePath))
                {
                    remotePath = btwFilePath;
                }

               //產生xml script 
                result = SerializeXMLUtility.GenBtwXMLScript(remotePath,currentPrinItem,valueList);
            }
            return result;
        }
예제 #4
0
        //public static string GetBartenderPrint(PrintItem currentPrinItem, string pCode)
        //{
        //    string batFilePath = System.Configuration.ConfigurationManager.AppSettings["ClientBatFilePath"];
        //    string result = null;
        //    if (!string.IsNullOrEmpty(currentPrinItem.SpName) && currentPrinItem.PrintMode == 3)
        //    {
        //        result = getPrintService().GetMainBat(currentPrinItem.SpName, currentPrinItem.ParameterKeys, currentPrinItem.ParameterValues);
        //    }
        //    return result;

        //}

        public static List<ImageInfo> GetTemplatePrint(PrintItem currentPrinItem, Boolean isPrintRoom)
        {
            List<ImageInfo> result = null;
            if (!string.IsNullOrEmpty(currentPrinItem.TemplateName) && currentPrinItem.PrintMode == 1)
            {

                List<ParamInfo> inputParas = new List<ParamInfo>();
                for (int i = 0; i < currentPrinItem.ParameterKeys.Count; i++)
                {
                    ParamInfo newParam = new ParamInfo();
                    newParam.ParamName = currentPrinItem.ParameterKeys[i];
                    newParam.Values = currentPrinItem.ParameterValues[i];
                    inputParas.Add(newParam);
                }

                if (isPrintRoom)
                {
                    if (string.IsNullOrEmpty(currentPrinItem.dpi))
                    {

                        result = getPrintRoomLlbManager().getImageListForPrint(currentPrinItem.TemplateName, null, inputParas, isPrintRoom);
                    }
                    else
                    {
                        result = getPrintRoomLlbManager().getImageListForPrint(currentPrinItem.TemplateName, null, inputParas, isPrintRoom, currentPrinItem.dpi);
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(currentPrinItem.dpi))
                    {

                        result = getCommonLlbManager().getImageListForPrint(currentPrinItem.TemplateName, null, inputParas, isPrintRoom);
                    }
                    else
                    {
                        result = getCommonLlbManager().getImageListForPrint(currentPrinItem.TemplateName, null, inputParas, isPrintRoom, currentPrinItem.dpi);
                    }
                }

            }
            return result;

        }       
예제 #5
0
        public static string GetBatPrint(PrintItem currentPrinItem, string pCode, string clientBatFilePat)
        {
            string batFilePath = clientBatFilePat;
            string result = "";
            if (!string.IsNullOrEmpty(currentPrinItem.SpName) && currentPrinItem.PrintMode == 0)
            {
                currentPrinItem.ParameterKeys.Add("@x");
                currentPrinItem.ParameterKeys.Add("@y");
                //currentPrinItem.ParameterKeys.Add("@bat");
                List<string> xoffset = new List<string>();
                List<string> yoffset = new List<string>();
                //List<string> bat = new List<string>();
                xoffset.Add(currentPrinItem.OffsetX.ToString());
                yoffset.Add(currentPrinItem.OffsetY.ToString());
                //bat.Add(currentPrinItem.TemplateName);
                currentPrinItem.ParameterValues.Add(xoffset);
                currentPrinItem.ParameterValues.Add(yoffset);
                //currentPrinItem.ParameterValues.Add(bat);
               // result = currentPrintItemService.GetMainBat(currentPrinItem.SpName, currentPrinItem.ParameterKeys, currentPrinItem.ParameterValues);
                result = getPrintService().GetMainBat(currentPrinItem.SpName, currentPrinItem.ParameterKeys, currentPrinItem.ParameterValues);

                //Get Remote bat path
                string remoteBatPath = getPrintTemplate().GetRemoteBatPath(pCode);

                if (string.IsNullOrEmpty(remoteBatPath))
                {
                    remoteBatPath = batFilePath;
                }
                
                //Vincent [2014-03-24]: Set Sequence
                //result = result + "\r\nSET BATPATH=" + remoteBatPath;                         

                //result = result + "\r\nSET PORT=" + currentPrinItem.PrinterPort + "\r\npushd \"" + batFilePath + "\"\r\nCALL \"" + remoteBatPath + "\\" + currentPrinItem.TemplateName + "\"";

                string appendHeader = "SET BATPATH=" + remoteBatPath + "\r\nSET PORT=" + currentPrinItem.PrinterPort + "\r\npushd \"" + batFilePath + "\"\r\n";

                result = appendHeader + result;
                
                //result = result + "\"\r\nCALL \"" + remoteBatPath + "\\" + currentPrinItem.TemplateName + "\"";

               
                if (currentPrinItem.BatPiece > 0)
                {
                    StringBuilder copyCall = new StringBuilder();
                    for (int i = 0; i < currentPrinItem.BatPiece; i++)
                    {
                        copyCall.Append("\r\nCALL \"" + remoteBatPath + "\\" + currentPrinItem.TemplateName + "\"");
                    }

                    result = result + copyCall.ToString() + "\r\npopd";
                }
            }
            return result;

        }
예제 #6
0
파일: SNCheck.cs 프로젝트: wra222/testgit
        public IList<PrintItem> InputCustSNOnPizzaReturn(string custsnOnPizza, string custsnOnProduct, string pdLine, string editor, string stationId, string customerId,string cartonPn, IList<PrintItem> printItems)
        {
            logger.Debug("(SNCheck)InputCustSNOnPizzaReturnPrint start, custsnOnPizza:" + custsnOnPizza + " custsnOnProduct:" + custsnOnProduct + " editor:" + editor + " customerId:" + customerId);

            FisException ex;
            List<string> erpara = new List<string>();

            var currentProduct = CommonImpl.GetProductByInput(custsnOnProduct, CommonImpl.InputTypeEnum.CustSN);

            try
            {
                string sessionKey = custsnOnProduct;
                Session Session = SessionManager.GetInstance.GetSession(sessionKey, TheType);
                Session sessionInfo = SessionManager.GetInstance.GetSession(sessionKey, TheType);

                if (sessionInfo == null)
                {
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK021", erpara);
                    throw ex;
                }
                else
                {
                    sessionInfo.AddValue(Session.SessionKeys.PrintLogName, "EnergyLabel");
                    sessionInfo.AddValue(Session.SessionKeys.PrintLogBegNo, currentProduct.CUSTSN);
                    sessionInfo.AddValue(Session.SessionKeys.PrintLogEndNo, currentProduct.CUSTSN);
                    sessionInfo.AddValue(Session.SessionKeys.PrintLogDescr, currentProduct.CUSTSN);
                    sessionInfo.AddValue(Session.SessionKeys.PrintItems, printItems);

                    //原本InputCustSNOnPizzaReturn是回傳字串,現在這個要回傳List。 此empty是為了在List帶入原本要回傳的字串
                    string ret = InputCustSNOnPizzaReturn(custsnOnPizza, custsnOnProduct, pdLine, editor, stationId, customerId,cartonPn);
                    PrintItem empty = new PrintItem();
                    empty.LabelType = "SNCheckReturn";
                    empty.TemplateName = ret;

                    IList<PrintItem> pi = (IList<PrintItem>) sessionInfo.GetValue(Session.SessionKeys.PrintItems);
                    pi.Add(empty);
                    return pi;
                }
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(SNCheck)InputCustSNOnPizzaReturnPrint end, custsnOnPizza:" + custsnOnPizza + " custsnOnProduct:" + custsnOnProduct + " editor:" + editor + " customerId:" + customerId);
            }
        }