private void PostHHTRecord(Guid headerId)
 {
     using (var ctx = new EF6.RT2020Entities())
     {
         var hhtHeader = ctx.StocktakeHeader_HHT.Find(headerId);
         if (hhtHeader != null)
         {
             //string sql = "TxNumber = '" + hhtHeader.TxNumber + "'";
             var stkHeader = StockTakeHeaderEx.GetByTxNumber(hhtHeader.TxNumber);
             if (stkHeader != null)
             {
                 if (!string.IsNullOrEmpty(stkHeader.ADJNUM) && stkHeader.PostedOn.Value.Year > 1900)
                 {
                     MessageBox.Show("Stock Take# [" + hhtHeader.TxNumber + "] had been posted!", "ATTENTION");
                 }
                 else
                 {
                     Posting(hhtHeader.HeaderId, stkHeader.HeaderId);
                 }
             }
             else
             {
                 MessageBox.Show("Stock Take# [" + hhtHeader.TxNumber + "] worksheet does not exist! Create new one?", "ATTENTION", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, new EventHandler(CreateNewWorksheet));
             }
         }
     }
 }
Example #2
0
        private Guid RecaptureSTK(string txNumber)
        {
            Guid stkHeaderId = Guid.Empty;

            var stkHeader = StockTakeHeaderEx.GetByTxNumber(txNumber);

            if (stkHeader != null)
            {
                stkHeaderId = stkHeader.HeaderId;
                RecaptureStkDetails(stkHeaderId);
            }
            return(stkHeaderId);
        }