Esempio n. 1
0
        /// <summary>
        /// Method to Generate AFC
        /// </summary>
        /// <param name="argEn">AFC Entity is an Input</param>
        /// <param name="RecStatus">RecStatus is an Input</param>
        /// <param name="batch">Batch is an Input</param>
        /// <returns>Returns BatchCode</returns>
        public string AFCNEW(AFCEn argEn, string RecStatus, string batch)
        {
            //Transaction Scope added by Solomon
            string NewAFC = string.Empty;

            //using (TransactionScope ts = new TransactionScope())
            //{
            try
            {
                AFCDAL loDs = new AFCDAL();
                loDs.BatchDelete(argEn, "Check");
                NewAFC = loDs.AFCNEW(argEn, RecStatus, batch);
                //ts.Complete();
                //if (Transaction.Current.TransactionInformation.Status == TransactionStatus.Committed)
                //{
                return(NewAFC);
                //}
                //else
                //{
                //    ts.Dispose();
                //    throw new TransactionException("Transaction is lost Record is not saved");
                //}
            }
            catch (Exception ex)
            {
                //ts.Dispose();
                throw ex;
            }
            //}
        }
Esempio n. 2
0
        /// <summary>
        /// Method to Delete Batch AFC
        /// </summary>
        /// <param name="argEn">AFC Entity is an Input.</param>
        /// <returns>Returns Boolean</returns>
        public bool BatchDelete(AFCEn argEn, String Delete)
        {
            bool flag;

            using (TransactionScope ts = new TransactionScope())
            {
                try
                {
                    AFCDAL loDs = new AFCDAL();
                    flag = loDs.BatchDelete(argEn, Delete);
                    ts.Complete();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            return(flag);
        }