Refactoring Large Class Code Behind

I have big class in ASP.NET WebForms (legacy). I use VS 2012.

I would like Refactoring Large Class Code Behind.

I want to evaluate Conditions and execute Actions - Commands like:

Create in AD

Delete in AD

Enable in CRM

DesEnable in CRM (Delete in CRM)

Delete Licenses CRM

Send Email Warning 1

Send Email Warning 2

ShowNotification

TODO code:

    if (ActionTypePage == ActionType.Modification || ActionTypePage == ActionType.MyDataMod)           if (user.Enabled && isEmployer)         {             // 1a) (Employer) NOT exists in AD ==> Error             if (!existsinAD)             {                 ShowNotification(msg, CommunicationType.Error, true);                 return;             }              // 1b) If Employer exists in AD ==> Enable in CRM (If false, New Request to CRM)             // Enable in CRM (If false, New Request CRM)         }          if (user.Enabled && !isEmployer)         {             // 2a) If NOTEmployer NOT exists in AD ==> Create user in AD y Enable in CRM (If false, New Request CRM)             if (!existeinAD)             {                 //  Create in AD                  // Enable in CRM (If false, New RequestCRM)             }              // 2b) If NOTEmployer exists in AD ==> Warning (Email) y Enable in CRM (If false, New RequestCRM)             if (existeinAD)             {                 // Send Email Warning                 // Enable in CRM (If false, New RequestCRM)             }          }           // DES-Enable         // 1a) If (Employer) NOT exists in AD ==> Error         // 1b) If (Employer) exists in AD ==> DesEnable in CRM (Delete in CRM) - Delete Licenses CRM          if (!user.Enabled && isEmployer)         {             if (!existsinAD)             {                ShowNotification(msg, CommunicationType.Error, true);                 return;             }              // DesEnable in CRM (Delete in CRM)              //  Delete Licenses CRM           }          if (!user.Enabled && !isEmployer)         {             // 2a) If NOTEmployer NOT exists in AD ==> Warning (Email) y  DesEnable in CRM (Delete in CRM) - Delete Licenses CRM              //  Delete Licenses CRM              if (!existeinAD)             {                  // Send Email Warning                 // DesEnable in CRM (Delete in CRM)                  //  Delete Licenses CRM              }              // 2b) If NOTEmployer exists in AD ==> Eliminar de AD y DesEnable in CRM (Delete in CRM) - Delete Licenses CRM              if (!existeinAD)             {                 // Delete in AD                // DesEnable in CRM (Delete in CRM)                //  Delete Licenses CRM               }         } 

Any suggestions for refactoring, not code-smell ?

Replay

Category: asp.net Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.122 (s). 12 q(s)