Beispiel #1
0
 /// <summary>
 /// This method is used to save the roles;
 /// </summary>
 private void SaveRoles()
 {
     try
     {
         if (Sec_Roles_Master.ROLE_NAME.ToString().Trim() == "")
         {
             MessageBox.Show("Role name cannot be empty", "Process Designer", MessageBoxButton.OK, MessageBoxImage.Information);
         }
         if (_usrroledet.CheckDuplicate(Sec_Roles_Master.ROLE_NAME) == false)
         {
             if (_usrroledet.SaveRoles(Sec_Roles_Master) == true)
             {
                 MessageBox.Show("The Role was saved successfully", "Process Designer", MessageBoxButton.OK, MessageBoxImage.Information);
                 CloseAction();
             }
             else
             {
                 MessageBox.Show("The Role could not be Saved", "Process Designer", MessageBoxButton.OK, MessageBoxImage.Information);
             }
         }
         else
         {
             MessageBox.Show("Role already exists", "Process Designer", MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #2
0
        /// <summary>
        /// This method is used to save the roles;
        /// </summary>
        private void SaveRoles()
        {
            try
            {
                if (Sec_Roles_Master.ROLE_NAME.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Role name"));
                    //MessageBox.Show("Role name cannot be empty", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }
                Sec_Roles_Master.ROLE_NAME = Sec_Roles_Master.ROLE_NAME.ToValueAsString().Trim();
                if (_usrroledet.CheckDuplicate(Sec_Roles_Master, _mode) == false)
                {
                    Progress.ProcessingText = PDMsg.ProgressUpdateText;
                    Progress.Start();

                    if (_usrroledet.SaveRoles(Sec_Roles_Master, _mode) == true)
                    {
                        if (selecteditem != null)
                        {
                            selecteditem["ROLE_NAME"] = Sec_Roles_Master.ROLE_NAME.Trim();
                        }
                        Progress.End();
                        if (_mode == OperationMode.AddNew)
                        {
                            ShowInformationMessage(PDMsg.SavedSuccessfully);
                        }
                        else
                        {
                            ShowInformationMessage(PDMsg.UpdatedSuccessfully);
                        }
                        //MessageBox.Show("The Role was saved successfully", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                        if (_closed == false)
                        {
                            _closed = true;
                            CloseAction();
                        }
                    }
                    else
                    {
                        Progress.End();
                        MessageBox.Show("The Role could not be Saved", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
                else
                {
                    ShowInformationMessage(PDMsg.AlreadyExists("Role"));
                    //MessageBox.Show("Role already exists", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }