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

            //EDIT
            if (Parameter.AccountID != null && Parameter.AccountID != Guid.Empty)
            {
                var item = new ORM_USR_Account();
                if (item.Load(Connection, Transaction, Parameter.AccountID) == null)
                {
                    returnValue.Status = FR_Status.Error_Internal;
                    return(returnValue);
                }

                ORM_CMN_PER_PersonInfo_2_Account.Query searchConnection = new CL1_CMN_PER.ORM_CMN_PER_PersonInfo_2_Account.Query();
                searchConnection.IsDeleted         = false;
                searchConnection.Tenant_RefID      = securityTicket.TenantID;
                searchConnection.USR_Account_RefID = Parameter.AccountID;

                ORM_CMN_PER_PersonInfo_2_Account personInfo2Account = ORM_CMN_PER_PersonInfo_2_Account.Query.Search(Connection, Transaction, searchConnection).FirstOrDefault();

                if (personInfo2Account != null)
                {
                    ORM_CMN_PER_PersonInfo PersonInfo = new ORM_CMN_PER_PersonInfo();
                    PersonInfo.Load(Connection, Transaction, personInfo2Account.CMN_PER_PersonInfo_RefID);

                    if (PersonInfo != null)
                    {
                        PersonInfo.FirstName = Parameter.FirstName;
                        PersonInfo.LastName  = Parameter.LastName;

                        PersonInfo.Save(Connection, Transaction);

                        returnValue.Status = FR_Status.Success;
                        return(returnValue);
                    }
                }
            }



            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_L3US_SUAI_1642 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_L3US_SUAI_1642 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 new Exception("Exception occured in method cls_Save_UserAccountInformation", ex);
            }
            return(functionReturn);
        }