Exemplo n.º 1
0
        public static string GET_MASTER_TRANSACTION_ID()
        {
            //The Transaction_Type can be 'expired' and 'sold'

            PUYODataContext a = new PUYODataContext();

            string Master_Transaction_ID;

            var Get_Last_Master_Transaction = from Master_Transaction in a.Master_Transactions
                                              orderby Master_Transaction.Master_Transaction_ID descending
                                              select Master_Transaction.Master_Transaction_ID;

            int Count_Master_Transaction = Get_Last_Master_Transaction.Count();

            if (Count_Master_Transaction == 0)
            {
                Master_Transaction_ID = "MT00001";
            }
            else
            {
                var    Get_Last_Master_Transaction_ID = Get_Last_Master_Transaction.First().ToString();
                string New_Master_Transaction_ID      = ID_PADDING(Get_Last_Master_Transaction_ID);
                Master_Transaction_ID = New_Master_Transaction_ID;
            }

            DateTime Now_Date = DateTime.Now;

            Master_Transaction New_Master_Transaction = new Master_Transaction();

            New_Master_Transaction.Master_Transaction_ID   = Master_Transaction_ID;
            New_Master_Transaction.Master_Transaction_Date = Now_Date;

            a.Master_Transactions.InsertOnSubmit(New_Master_Transaction);
            a.SubmitChanges();

            return(Master_Transaction_ID);
        }
 partial void UpdateMaster_Transaction(Master_Transaction instance);
 partial void DeleteMaster_Transaction(Master_Transaction instance);
 partial void InsertMaster_Transaction(Master_Transaction instance);