Example #1
0
        internal static void AddJobToPrintQueue(BarcodeLabel item)
        {
            try
            {
                 SqlParameter pWSNumber = new SqlParameter();
                pWSNumber.ParameterName = "WSNumber";
                pWSNumber.Value = item.WSNumber;

                SqlParameter pUserName = new SqlParameter();
                pUserName.ParameterName = "userName";
                pUserName.Value = item.UserName;

                SqlParameter pLineID = new SqlParameter();
                pLineID.ParameterName = "lineID";
                pLineID.Value = item.LineID;

                SqlParameter pItemID = new SqlParameter();
                pItemID.ParameterName = "itemID";
                pItemID.Value = item.ItemID;

                SQLHelper.ExecuteStoredProcedure(StoredProcedures.AddJobToPrintQueue, pWSNumber, pLineID, pItemID, pUserName);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #2
0
 public bool PrintBarcodeLabel(BarcodeLabel item)
 {
     bool isValidItem = false;
     try
     {
         isValidItem = BusinessLogic.IsValidWorksheetLineItem(item);
         if (isValidItem)
         {
             BusinessLogic.AddJobToPrintQueue(item);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
     return isValidItem;
     //GlassProductManager.BarcodePrinter.PrintLineItem(item.WSNumber, item.LineID, item.ItemID);
 }
Example #3
0
        internal static bool IsValidWorksheetLineItem(BarcodeLabel item)
        {
            bool isValidWSItem = false;
            try
            {
                SqlParameter pWSNumber = new SqlParameter();
                pWSNumber.ParameterName = "WSNumber";
                pWSNumber.Value = item.WSNumber;

                SqlParameter pLineID = new SqlParameter();
                pLineID.ParameterName = "lineID";
                pLineID.Value = item.LineID;

                SqlParameter pItemID = new SqlParameter();
                pItemID.ParameterName = "itemID";
                pItemID.Value = item.ItemID;

                var result = SQLHelper.ExecuteStoredProcedure(StoredProcedures.IsValidWorksheetLineItem, pWSNumber, pLineID, pItemID);
                if (result == null || result.Tables == null || result.Tables.Count == 0 || result.Tables[0].Rows.Count == 0)
                {
                    return isValidWSItem;
                }

                isValidWSItem = bool.Parse(result.Tables[0].Rows[0][ColumnNames.Status].ToString());
            }
            catch (Exception ex)
            {
                throw;
            }
            return isValidWSItem;
        }
Example #4
0
        internal static ObservableCollection<BarcodeLabel> GetPrintJobQueue()
        {
            ObservableCollection<BarcodeLabel> printJobqueue = null;
            try
            {
                var result = SQLHelper.ExecuteStoredProcedure(StoredProcedures.GetPrintJobQueue);

                if (result == null || result.Tables == null || result.Tables.Count == 0 || result.Tables[0].Rows.Count == 0)
                    return printJobqueue;

                printJobqueue = new ObservableCollection<BarcodeLabel>();
                BarcodeLabel item = new BarcodeLabel();
                for (int rowIndex = 0; rowIndex < result.Tables[0].Rows.Count; rowIndex++)
                {
                    item = new BarcodeLabel();
                    item.ID = int.Parse(result.Tables[0].Rows[rowIndex][ColumnNames.ID].ToString());
                    item.LineID = int.Parse(result.Tables[0].Rows[rowIndex][ColumnNames.LineID].ToString());
                    item.ItemID = int.Parse(result.Tables[0].Rows[rowIndex][ColumnNames.ItemID].ToString());
                    item.WSNumber = result.Tables[0].Rows[rowIndex][ColumnNames.WSNumber].ToString();
                    item.UserName = result.Tables[0].Rows[rowIndex][ColumnNames.UserName].ToString();

                    printJobqueue.Add(item);
                }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return printJobqueue;
        }