public void Execute(ref ClientOrganization clientOrganization)
        {
            Parameters.AddWithValue("@ParentOrganizationID", clientOrganization.ParentOrganizationID);
            Parameters.AddWithValue("@Name", clientOrganization.Name);
            Parameters.AddWithValue("@Description", clientOrganization.Description);
            Parameters.AddWithValue("@CampaignEnabled", clientOrganization.CampaignEnabled);
            Parameters.AddWithValue("@Terminated", clientOrganization.Terminated);
            Parameters.AddWithValue("@Contracted", clientOrganization.Contracted);
            Parameters.AddWithValue("@AddressID", clientOrganization.AddressID);
            Parameters.AddWithValue("@LoadInProgress", clientOrganization.LoadInProgress);
            Parameters.AddWithValue("@CommunityLastUpdate", clientOrganization.CommunityLastUpdate);
            Parameters.AddWithValue("@IPDataLastUpdate", clientOrganization.IPDataLastUpdate);
            Parameters.AddWithValue("@OPDataLastUpdate", clientOrganization.OPDataLastUpdate);
            Parameters.AddWithValue("@ERDataLastUpdate", clientOrganization.ERDataLastUpdate);

            if (string.IsNullOrEmpty(clientOrganization.CreatedBy))
            {
                clientOrganization.CreatedBy = Environment.UserName;
            }
            Parameters.AddWithValue("@CreatedBy", clientOrganization.CreatedBy);

            DataTable t = ExecuteReader();
            if (t.Rows.Count > 0)
            {
                clientOrganization.ClientOrganizationID = t.Rows[0].Field<int>("ClientOrganizationID");
            }

        }
        public void Execute(ref ClientOrganization clientOrganization)
        {
            // Set Audit Fields
            clientOrganization.UpdatedBy = Environment.UserName;
            clientOrganization.UpdatedDT = DateTime.Now;

            Parameters.AddWithValue("@AddressID", clientOrganization.AddressID);
            Parameters.AddWithValue("@CampaignEnabled", clientOrganization.CampaignEnabled);
            Parameters.AddWithValue("@ClientOrganizationID", clientOrganization.ClientOrganizationID);
            Parameters.AddWithValue("@CommunityLastUpdate", clientOrganization.CommunityLastUpdate);
            Parameters.AddWithValue("@Contracted", clientOrganization.Contracted);
            Parameters.AddWithValue("@Description", clientOrganization.Description);
            Parameters.AddWithValue("@ERDataLastUpdate", clientOrganization.ERDataLastUpdate);
            Parameters.AddWithValue("@IPDataLastUpdate", clientOrganization.IPDataLastUpdate);
            Parameters.AddWithValue("@LoadInProgress", clientOrganization.LoadInProgress);
            Parameters.AddWithValue("@Name", clientOrganization.Name);
            Parameters.AddWithValue("@OPDataLastUpdate", clientOrganization.OPDataLastUpdate);
            Parameters.AddWithValue("@ParentOrganizationID", clientOrganization.ParentOrganizationID);
            Parameters.AddWithValue("@Terminated", clientOrganization.Terminated);
            Parameters.AddWithValue("@UpdatedBy", clientOrganization.UpdatedBy);
            ExecuteReader();
        }
 public ClientOrganization Clone()
 {
     ClientOrganization result = new ClientOrganization();
     result.ClientOrganizationID = this.ClientOrganizationID;
     result.ParentOrganizationID = this.ParentOrganizationID;
     result.Name = this.Name;
     result.Description = this.Description;
     result.CampaignEnabled = this.CampaignEnabled;
     result.Terminated = this.Terminated;
     result.Contracted = this.Contracted;
     result.LoadInProgress = this.LoadInProgress;
     result.AddressID = this.AddressID;
     result.CommunityLastUpdate = this.CommunityLastUpdate;
     result.IPDataLastUpdate = this.IPDataLastUpdate;
     result.OPDataLastUpdate = this.OPDataLastUpdate;
     result.ERDataLastUpdate = this.ERDataLastUpdate;
     result.CreatedDT = this.CreatedDT;
     result.CreatedBy = this.CreatedBy;
     result.UpdatedDT = this.UpdatedDT;
     result.UpdatedBy = this.UpdatedBy;
     return result;
 }
        private void ClientOrganizationUpdate(ref ClientOrganization org)
        {
            try
            {
                spClientOrganizationUpdate proc = new spClientOrganizationUpdate(ConnectionString);
                proc.Execute(ref org);
            }
            catch (Exception ex)
            {
                log.Error("Error updating ClientOrganization", ex);
                throw;
            }

        }
 private void ClientOrganizationAdd(ref ClientOrganization org)
 {
     spClientOrganizationAdd proc = new spClientOrganizationAdd(ConnectionString);
     proc.Execute(ref org);
 }
 public void ClientOrganizationSave(ref ClientOrganization org)
 {
     if (org.ClientOrganizationID == 0)
     {
         ClientOrganizationAdd(ref org);
     }
     else
     {
         ClientOrganizationUpdate(ref org);
     }
 }
 public void ClientOrganizationFinishImport(ref ClientOrganization org)
 {
     org.LoadInProgress = false;
     this.ClientOrganizationSave(ref org);
 }
 public void ClientOrganizationBeginImport(ref ClientOrganization org)
 {
     org.LoadInProgress = true;
     this.ClientOrganizationSave(ref org);
 }
        public ClientOrganization ClientOrganizationLoadByID(int clientOrganizationID)
        {

            StoredProcedure proc = new StoredProcedure("[App].[spClientOrganizationSelect]",this.ConnectionString);
            proc.Parameters.AddWithValue("@ClientOrganizationID", clientOrganizationID);
            DataTable t = proc.ExecuteReader();
            if (t.Rows.Count > 0)
            {
                ClientOrganization result = new ClientOrganization(t.Rows[0]);
                return result;
            }
            return null;
        }
 public ClientOrgModel(ClientOrganization org, Address address)
 {
     this.clientOrg = org;
     this.address = address;
 }
Example #11
0
 /// <summary>
 /// Read the values that we need from ImportedFileStatus table
 /// </summary>
 /// <param name="importedFileStatusID">ImportedFileStatus Primary Key to read.</param>
 private void GetFileValues(int importedFileStatusID)
 {
     var sw = new Stopwatch();
     sw.Start();
     try
     {
         file = SystemDataProvider.ClientDataProvider.ImportedFileStatusLoadByID(importedFileStatusID);
         file.ProcessStatusID = (int)ProcessStatus.Processing;
         SystemDataProvider.ClientDataProvider.ImportedFileStatusSave(ref file);
         clientOrg = SystemDataProvider.ClientDataProvider.ClientOrganizationLoadByID(file.ClientOrganizationID.Value);
     }
     catch (Exception ex)
     {
         log.Error("GetFileValues", ex);
         throw;
     }
     finally
     {
         sw.Stop();
         log.Debug(RecordTiming(System.Reflection.MethodBase.GetCurrentMethod().Name, sw));
     }
 }