Example #1
0
        protected void dataSourceUserView_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            if (!IsValid())
            {
                return;
            }

            UserViewData ChangedUserData = (UserViewData)e.Instance;

            //Update IsActive of UserData with what we got from Updating method.
            //ChangedUserData.IsActive = IsActiveUser;

            if (UserBLL.UpdateUserProfile(GetChangedUserProfile(ChangedUserData), this.AccountInfo.UserId))
            {
                if (UserBLL.UpdateUserAccount(this.AccountInfo, this.AccountInfo.UserId))
                {
                    DisplayMessage("The submitted information has been saved successfully.", false);
                }
                else
                {
                    DisplayMessage("Unable to save Zip and County of Counseling location. However, the rest of the profile information has been saved successfully.", true);
                }
            }
            else
            {
                DisplayMessage("Sorry. Unable to save the information. Please contact support for assistance.", true);
            }

            FetchUserData();
        }
Example #2
0
        protected void dataSourceSubStateUserAdd_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            UserRegionalAccessProfile ChangedUserSubStateRegionData = (UserRegionalAccessProfile)e.Instance;

            UpdateUserSubStateRegionData(ChangedUserSubStateRegionData);

            if (UserSubStateRegionData.RegionId != 0)
            {
                if (UserSubStateRegionBLL.AddUserSubStateRegionalProfile(UserSubStateRegionData, this.AccountInfo.UserId))
                {
                    //display success message
                    DisplayMessage("The submitted information has been saved successfully.", false);
                }
                else
                {
                    DisplayMessage("Sorry. We were unable to save the information. Please contact support for assistance.", true);
                }
            }
            else
            {
                plhMessage.Visible   = true;
                lblTitleMessage.Text = "Error";
                lblMessage.Text      = "A Sub state must be selected.";
                lblMessage.CssClass  = "required";

                hlBackToEdit.EnableViewState = false;
                hlBackToEdit.Visible         = false;
                hlBackToEdit.NavigateUrl     = RouteController.UserEdit(UserProfileUserId);
            }

            Page.DataBind();
        }
        protected void dataSourceViewResourceReport_Inserted(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            ViewResourceReportViewData RptData = (ViewResourceReportViewData)e.Instance;

            RptData.SubmitterID = AccountInfo.UserId.ToString();
            _NewReportId        = Logic.AddReport(RptData);
        }
Example #4
0
        protected void dataSourceSubStateUserEdit_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            UserRegionalAccessProfile ChangedUserSubStateRegionData = (UserRegionalAccessProfile)e.Instance;

            if (UserSubStateRegionBLL.UpdateUserSubState(ChangedUserSubStateRegionData, this.AccountInfo.UserId))
            {
                bool ReviewerUpdateFailed = false;

                //Save the new ReviewerID (Supervisor)
                if (NewSupervisorId != UserIdOfOldReviewer)
                {
                    ReviewerUpdateFailed = !UserBLL.SaveSupervisorForUser(UserSubStateRegionData.UserId, NewSupervisorId, UserSubStateRegionId, this.AccountInfo.UserId);
                }


                if (ReviewerUpdateFailed)
                {
                    DisplayMessage("The new supervisor was not saved. The rest of the submitted information has been saved successfully.", false);
                }
                else
                {
                    DisplayMessage("The submitted information has been saved successfully.", false);
                }
            }
            else
            {
                DisplayMessage("Sorry. We were unable to save the information. Please contact support for assistance.", true);
            }

            UserData = null;
        }
Example #5
0
        protected void dataSourceEditAgencyLocation_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            var viewData = (EditAgencyLocationViewData)e.Instance;

            viewData.SetLastUpdated(AccountInfo.UserId);
            Logic.UpdateAgencyLocation(viewData);
            RouteController.RouteTo(RouteController.AgencyLocationView(Id.Value));
        }
Example #6
0
        protected void dataSourceEditClientContact_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            var viewData = (EditClientContactViewData)e.Instance;

            viewData.SetLastUpdated(AccountInfo.UserId);
            Logic.UpdateClientContact(viewData);
            RouteController.RouteTo(RouteController.CcfView(Id.GetValueOrDefault(0)));
        }
        protected void dataSourceSubStateRegion_Inserted(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            var viewData = (AddSubStateRegionViewData)e.Instance;

            viewData.SetIsActive(true);
            viewData.SetCreated(AccountInfo.UserId);
            viewData.SetLastUpdated(AccountInfo.UserId);
            RouteController.RouteTo(RouteController.AgencyRegionSuccess(Logic.AddSubStateRegion(viewData)));
        }
    protected void OrderItemContainerDataSource_Deleted(object sender, ObjectContainerDataSourceStatusEventArgs e)
    {
        UpdateRowIfInEditMode();
        List <OrderItemLine> lines = new List <OrderItemLine>();

        lines.Add((OrderItemLine)e.Instance);
        _presenter.OnDeleteOrderItemLines(lines);
        SetLastRowToEditMode();
    }
Example #9
0
 protected void dataSourceAgencyLocation_Inserted(object sender, ObjectContainerDataSourceStatusEventArgs e)
 {
     var viewData = (AddAgencyLocationViewData)e.Instance;
     viewData.SetIsActive(true);
     viewData.SetCreated(AccountInfo.UserId);
     viewData.SetLastUpdated(AccountInfo.UserId);
     Logic.AddAgencyLocation(viewData);
     RouteController.RouteTo(RouteController.AgencyView(AgencyId.Value));
 }
        protected void dataSourceSubStateRegion_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            var viewData = (EditSubStateRegionViewData)e.Instance;

            viewData.SetIsActive(viewData.IsActive);
            viewData.SetCreated(AccountInfo.UserId);
            viewData.SetLastUpdated(AccountInfo.UserId);
            Logic.UpdateSubStateRegion(viewData);
            RouteController.RouteTo(RouteController.AgencyRegionSuccess(Id.GetValueOrDefault(0)));
        }
Example #11
0
        protected void dataSourceEditSHIP_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            var viewData = (EditShipProfileViewData)e.Instance;

            //viewData.SetLastUpdated(AccountInfo.UserId);
            Logic.UpdateShipProfile(viewData);

            dataSourceEditSHIP.DataSource = viewData;
            MessageBox.Visible            = true;
            MessageBox.Text = "Record updated successfull!.";
            //RouteController.RouteTo(RouteController.ShipProfileEdit());
        }
        protected void dataSourceAgencyUserEdit_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            //UserAgencyData = (UserRegionalAccessProfile)e.Instance;
            UserAgencyData = null;
            SynchronizeChangesToUserAgencyData((UserRegionalAccessProfile)e.Instance);

            //Readonly descriptors verification:
            //  New logic to ensure that certain readonly descriptors are not saved along with non-readonly ones.
            bool   ShowError = true;
            string Message   = "Sorry. We were unable to save the information. Please contact support for assistance.";

            if (ValidateDescriptorsForUser(ref Message))
            {
                if (UserAgencyBLL.UpdateUserAgency(UserAgencyData, this.AccountInfo.UserId))
                {
                    //display success message
                    bool ReviewerUpdateFailed = false;

                    //Save the new ReviewerID (Supervisor)
                    if (NewSupervisorId != UserIdOfOldReviewer)
                    {
                        ReviewerUpdateFailed = !UserBLL.SaveSupervisorForUser(UserAgencyData.UserId, NewSupervisorId, AgencyId, this.AccountInfo.UserId);
                    }

                    if (ReviewerUpdateFailed)
                    {
                        DisplayMessage("The new supervisor was not saved. The rest of the submitted information has been saved successfully.", false);
                        ShowError = false;
                    }
                    else
                    {
                        DisplayMessage("The submitted information has been saved successfully.", false);
                        ShowError = false;
                    }
                }
            }

            //Added error for the readonly descriptors verification
            if (ShowError)
            {
                DisplayMessage(Message, true);
            }
        }
Example #13
0
        protected void dataSourceUserView_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            if (UserViewData != null)
            {
                if (RegisterUserBLL.DoesUserNameExist(UserViewData.PrimaryEmail))
                {
                    DisplayMessage("The Primary Email address is already registered. Duplicates are not allowed.", true);
                    //formView.ChangeMode(FormViewMode.Edit);
                }
                else
                {
                    IRegisterUser regBLL = RegisterUserBLL.CreateRegistrationProviderObject(CreateRegistrationObject());
                    regBLL.ValidateData();
                    if (regBLL.IsValid)
                    {
                        if (regBLL.Save())
                        {
                            AddPresentorStatus = 1;
                            DisplayMessage("The Presenter has been added successfully. You may add another presenter or close this window.", false);
                            UserViewData = new UserViewData();
                        }
                        else
                        {
                            DisplayMessage("Unable to add presenter. Please contact support if the issue persists. Error: " + regBLL.ErrorMessage, true);
                        }
                    }
                    else
                    {
                        DisplayMessage("Validation error occured while adding new User. Error: " + regBLL.ErrorMessage, true);
                    }
                }
            }


            Page.DataBind();
        }
 void TestableObjectContainerDataSource_Deleted(object sender, ObjectContainerDataSourceStatusEventArgs e)
 {
     _DeletedFired = true;
 }
Example #15
0
        protected void dataSourceUserView_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            Page.Validate("UserProfile");
            if (!Page.IsValid)
            {
                return;
            }

            UserViewData ChangedUserData = (UserViewData)e.Instance;

            try
            {
                if (IsCMSOrStateScope)
                {
                    UserBLL.UpdateIsAdminStatus(ChangedUserData.UserId, ChangedUserData.IsAdmin);
                }
            }
            catch (Exception UpdateAccountEx)
            {
                DisplayMessage("Failed while saving administrator status. Please try later or contact support for assistance.", true);
                return;
            }

            //Update IsActive of UserData with what we got from Updating method.
            //ChangedUserData.IsActive = IsActiveUser;
            //using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
            //{
            if (UserBLL.UpdateUserProfile(CreateUserProfile(ChangedUserData), this.AccountInfo.UserId))
            {
                if (!UserData.IsShipDirector && UserData.IsUserStateScope)
                {
                    string ErrorMessage;
                    if (!UserBLL.SaveDescriptors(ChangedUserData.UserId, GetDescriptorsSelectedByAdmin(), ShiptalkLogic.Constants.Defaults.DefaultValues.AgencyIdForNonAgencyUsers, this.AccountInfo.UserId, out ErrorMessage))
                    {
                        DisplayMessage(ErrorMessage, true);
                        return;
                    }

                    if (!UserBLL.UpdateStateSuperDataEditor(ChangedUserData.UserId, ChangedUserData.IsStateSuperDataEditor, this.AccountInfo.UserId))
                    {
                        DisplayMessage("An error occured while updating the super data editor status", true);
                        return;
                    }
                }

                //Update the Is Approver Designate status for CMS/State scope Admins alone.
                //Ignore Ship directors and CMS Admins.
                if (UserData.IsAdmin)
                {
                    if ((!UserData.IsCMSAdmin && UserData.IsUserCMSScope) || (!UserData.IsShipDirector && UserData.IsUserStateScope))
                    {
                        if (!UserBLL.UpdateApproverDesignate(UserData.UserId, GetApproverDesignateSelection(), this.AccountInfo.UserId))
                        {
                            DisplayMessage("Failed while updating approver designate status. Please try later or contact support for assistance.", true);
                            return;
                        }
                    }
                }

                bool ReviewerUpdateFailed = false;
                if (ScopeIdOfUser == Scope.State.EnumValue <int>())
                {
                    if (NewSupervisorId == -1)
                    {
                        NewSupervisorId = 0;
                    }

                    if (NewSupervisorId != UserIdOfOldReviewer)
                    {
                        //Save the new ReviewerID as Supervisor
                        if (!UserBLL.SaveSupervisorForUser(ChangedUserData.UserId, NewSupervisorId, null, this.AccountInfo.UserId))
                        {
                            //If update failed, then
                            ReviewerUpdateFailed = true;
                        }
                    }
                }
                //Lavnaya: Included Change Email process : 09/02/2012
                //If Primary Email is changed, then the email should be sent to user's old email id and as well as to new email id to notify them.
                // Email verification link will be sen to the user's new email id. Users can login using their old email id till they vefy the new email. this process is same as "Edit my Email" functionality.
                //If the Primary EMail id is not changed, then we dont change it in database.

                bool   DoCommit = false;
                string ErrorMsg;
                string NewEmail = string.Empty;

                TextBox Email = formView.FindControl("Email") as TextBox;

                NewEmail = Email.Text;

                if (NewEmail != UserData.PrimaryEmail)
                {
                    if (NewEmail != "" && NewEmail != null)
                    {
                        //Check if the Username already exists
                        if (RegisterUserBLL.DoesUserNameExist(NewEmail))
                        {
                            DisplayMessage("The Primary Email address is already registered. Duplicates are not allowed.", true);
                            return;
                        }
                        else
                        {
                            if (UserBLL.ChangeEmail(ChangedUserData.UserId, UserData.PrimaryEmail, NewEmail, this.AccountInfo.UserId, out ErrorMsg))
                            {
                                if (VerifyEmail.SendEmailVerificationNotificationforEmailChange(false, ChangedUserData.UserId, ChangedUserData.UserId, NewEmail, out ErrorMsg))
                                {
                                    DoCommit = true;
                                }
                            }

                            //if (DoCommit)
                            //{
                            //    //scope.Complete();
                            //    DisplayMessage("Your request has been submitted. You will receive this Change Email request information email at your old Email address and  'Email verification' email at your new Email address shortly. Please follow the instruction to complete the Email verification process . If you do not receive an email after a while, please contact the help desk.", false);
                            //}

                            //}
                        }
                    }
                }


                //Lavnaya: Included Change Email process : 09/02/2012 -- End

                if (ReviewerUpdateFailed)
                {
                    DisplayMessage("Unable to save new supervisor. Please try later or contact support for assistance.", true);
                }


                //else if (!DoCommit)Pbattineni: If (!DoCommit) & and New email is not equal to Primary email then Throw error Message- 10/08/12
                else if (!DoCommit && NewEmail != UserData.PrimaryEmail)
                {
                    DisplayMessage("Sorry. Unable to change your email. Please contact support for assistance.", true);
                }
                else
                {
                    //scope.Complete();
                    DisplayMessage("The submitted information has been saved successfully.", false);
                }
                //formView.DataBind();
                //listViewUserRegionalProfiles.DataBind();
                //Page.DataBind();
            }
            else
            {
                DisplayMessage("Sorry. We were unable to save the information. Please contact support for assistance.", true);
            }
            //}

            //Get Fresh data for rebind.
            FetchUserData();
        }
Example #16
0
 protected void CustomersDataSource_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
 {
     _presenter.OnCustomerUpdated((Customer)e.Instance);
 }
 protected void TransferBatchDataSource_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
 {
     _presenter.OnTransferUpdated((Transfer)e.Instance);
 }
 protected void OrderItemContainerDataSource_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
 {
     _presenter.OnChangedOrderItemLine((OrderItemLine)e.Instance);
 }