예제 #1
0
        protected static FR_Base Execute(DbConnection Connection, DbTransaction Transaction, P_L5BD_DMI_1248 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Base();
            //Put your code here

            ORM_RES_LOC_LocationInformation.Query locationInfoQuery = new ORM_RES_LOC_LocationInformation.Query();

            if (Parameter.MapType == "AreaMap")
            {
                locationInfoQuery.LocationInformation_MapImage_DocID = Parameter.DocumentID;
            }
            else if (Parameter.MapType == "SateliteMap")
            {
                locationInfoQuery.LocationInformation_SatelliteImage_DocID = Parameter.DocumentID;
            }
            else if (Parameter.MapType == "RegionMap")
            {
                locationInfoQuery.LocationInformation_AddressImage_DocID = Parameter.DocumentID;
            }

            locationInfoQuery.Tenant_RefID = securityTicket.TenantID;
            locationInfoQuery.IsDeleted    = false;

            ORM_RES_LOC_LocationInformation locationInfo = ORM_RES_LOC_LocationInformation.Query.Search(Connection, Transaction, locationInfoQuery).FirstOrDefault();

            if (Parameter.MapType == "AreaMap")
            {
                locationInfo.LocationInformation_MapImage_DocID = Guid.Empty;
            }
            else if (Parameter.MapType == "SateliteMap")
            {
                locationInfo.LocationInformation_SatelliteImage_DocID = Guid.Empty;
            }
            else if (Parameter.MapType == "RegionMap")
            {
                locationInfo.LocationInformation_AddressImage_DocID = Guid.Empty;
            }

            locationInfo.Save(Connection, Transaction);

            return(returnValue);

            #endregion UserCode
        }
예제 #2
0
 ///<summary>
 /// Ivokes the method with the given Connection, leaving it open if no exceptions occured
 ///<summary>
 public static FR_Base Invoke(DbConnection Connection, P_L5BD_DMI_1248 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, null, null, Parameter, securityTicket));
 }
예제 #3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_Base Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5BD_DMI_1248 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_Base functionReturn = new FR_Base();

            try
            {
                if (cleanupConnection == true)
                {
                    Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                if (cleanupTransaction == true)
                {
                    Transaction = Connection.BeginTransaction();
                }

                functionReturn = Execute(Connection, Transaction, Parameter, securityTicket);


                #region Cleanup Connection/Transaction
                //Commit the transaction
                if (cleanupTransaction == true)
                {
                    Transaction.Commit();
                }
                //Close the connection
                if (cleanupConnection == true)
                {
                    Connection.Close();
                }
                #endregion
            }
            catch (Exception ex)
            {
                try
                {
                    if (cleanupTransaction == true && Transaction != null)
                    {
                        Transaction.Rollback();
                    }
                }
                catch { }

                try
                {
                    if (cleanupConnection == true && Connection != null)
                    {
                        Connection.Close();
                    }
                }
                catch { }

                throw ex;
            }
            return(functionReturn);
        }