public void SaveMasterConfiguration()
        {
            MasterConfigurationBO objMasterConfigurationBO = new MasterConfigurationBO();

            objMasterConfigurationBO.MinPasswordLength = 8;
            objMasterConfigurationBO.RequireNumberInPassword = true;
            objMasterConfigurationBO.RequireSpecialCharacterInPassword = true;
            objMasterConfigurationBO.MaxPasswordLife = 100;
            objMasterConfigurationBO.MaxLogonRetry = 2;
            objMasterConfigurationBO.PasswordHistoryCount = 2;
            objMasterConfigurationBO.AllowReusePasswordFromHistory = false;
            objMasterConfigurationBO.CreatedBy = "Paresh Rao";
            objMasterConfigurationBO.CreatedOn = DateTime.Now;
            //Optional Fields
            objMasterConfigurationBO.ModifiedBy = "Ravi Keshwani";
            objMasterConfigurationBO.ModifiedOn = DateTime.Now;
            objMasterConfigurationBO.IPAddressOfLastAction = "10.7.200.300";
            objMasterConfigurationBO.DefaultEmailAddress = "*****@*****.**";
            objMasterConfigurationBO.OutgoingEmailServer = "10.10.10.10";
            objMasterConfigurationBO.SenderMailAddress = "*****@*****.**";
            objMasterConfigurationBO.EmailAccountUserName = "******";
            objMasterConfigurationBO.EmailAccountUserPassword = "******";

            MasterConfigurationBLL objMasterConfigBL = new MasterConfigurationBLL();
            int returnVal = objMasterConfigBL.SaveMasterConfiguration(objMasterConfigurationBO);

            Assert.AreEqual(1,returnVal, "It should return 1");
        }
        /// <summary>
        /// Saves master configurations
        /// </summary>
        /// <param name="masterConfigurationBO"></param>
        /// <returns></returns>
        public int SaveMasterConfiguration(MasterConfigurationBO masterConfigurationBO)
        {
            Mapper.CreateMap<MasterConfigurationBO, tblMasterConfigurationDto>();
            tblMasterConfigurationDto tblMasterConfigurationDto = new Domain.tblMasterConfigurationDto();

            Mapper.Map(masterConfigurationBO, tblMasterConfigurationDto);
            MasterConfigurationProvider objMasterConfigurationProvider = new MasterConfigurationProvider();
            return objMasterConfigurationProvider.SaveMasterConfiguration(tblMasterConfigurationDto);
        }
 /// <summary>
 /// Saves master configuration
 /// </summary>
 /// <param name="masterConfigurationBO"></param>
 /// <returns></returns>
 public int SaveMasterConfiguration(MasterConfigurationBO masterConfigurationBO)
 {
     int result = 0;
     if (ValidateMasterConfiguration(masterConfigurationBO))
     {
         MasterConfigurationProviderDAL objMasterConfigurationProvider = new MasterConfigurationProviderDAL();
         result = objMasterConfigurationProvider.SaveMasterConfiguration(masterConfigurationBO);
     }
     return result;
 }
 /// <summary>
 /// Validates master configuration data
 /// </summary>
 /// <param name="masterConfigurationBO"></param>
 /// <returns></returns>
 private bool ValidateMasterConfiguration(MasterConfigurationBO masterConfigurationBO)
 {
     bool isValid = true;
     try
     {
         if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(masterConfigurationBO.MinPasswordLength);
         if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(masterConfigurationBO.RequireNumberInPassword);
         if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(masterConfigurationBO.RequireSpecialCharacterInPassword);
         if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(masterConfigurationBO.MaxPasswordLife);
         if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(masterConfigurationBO.MaxLogonRetry);
         if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(masterConfigurationBO.PasswordHistoryCount);
         if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(masterConfigurationBO.AllowReusePasswordFromHistory);
         if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(masterConfigurationBO.CreatedBy);
         if (isValid) isValid = ValidateBLL.CheckNullOrEmpty(masterConfigurationBO.CreatedOn);
     }
     catch
     {
         isValid = false;
     }
     return isValid = true;
 }
        /// <summary>
        /// Saves master configuration
        /// </summary>
        /// <param name="masterConfigurationViewModel"></param>
        /// <returns></returns>
        public int SaveMasterConfiguration(MasterConfigurationViewModel masterConfigurationViewModel)
        {
            var masterConfigurationBLL = new MasterConfigurationBLL();
            Mapper.CreateMap<MasterConfigurationViewModel, MasterConfigurationBO>();

            var masterConfigurationBO = new MasterConfigurationBO();
            masterConfigurationBO = Mapper.Map<MasterConfigurationViewModel, MasterConfigurationBO>(masterConfigurationViewModel);
            return masterConfigurationBLL.SaveMasterConfiguration(masterConfigurationBO);
        }