public void UpdateUserGroupTest() { UserGroupBLL target = new UserGroupBLL(); // TODO: Initialize to an appropriate value UserGroup userGroup = null; // TODO: Initialize to an appropriate value target.UpdateUserGroup(userGroup); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
protected void updateButton_Click(object sender, EventArgs e) { UserGroupBLL userGroup = new UserGroupBLL(); try { if (userGroupIdForUpdateHiddenField.Value.Trim() == "") { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = "User Group not found to update."; } else if (userGroupNameTextBox.Text == "") { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "User Group Name field is required."; } else if (descriptionTextBox.Text == "") { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Description field is required."; } else { userGroup.UserGroupId = userGroupIdForUpdateHiddenField.Value.Trim(); userGroup.UserGroupName = userGroupNameTextBox.Text.Trim(); userGroup.Description = descriptionTextBox.Text.Trim(); if (!userGroup.CheckDuplicateUserGroup(userGroupNameTextBox.Text.Trim())) { userGroup.UpdateUserGroup(); userGroupNameForUpdateHiddenField.Value = ""; userGroupIdForUpdateHiddenField.Value = ""; string message = " <span class='actionTopic'>" + " User Group Updated Successfully</span>."; MyAlertBox("var callbackOk = function () { window.location = \"/setting/UserGroup/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);"); } else { if (userGroupNameForUpdateHiddenField.Value == userGroupNameTextBox.Text.Trim()) { userGroup.UserGroupName = "WithOut"; userGroup.UpdateUserGroup(); userGroupNameForUpdateHiddenField.Value = ""; userGroupIdForUpdateHiddenField.Value = ""; //MyAlertBox("alert(\"User Group Updated Successfully.\"); window.location=\"/HRUI/UserGroup/List.aspx\""); string message = " <span class='actionTopic'>" + " User Group Updated Successfully.</span>."; MyAlertBox("var callbackOk = function () { window.location = \"/setting/UserGroup/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);"); } else { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Data Duplicate!!!"; msgDetailLabel.Text = "This User Group already exist, try another one."; } } } } catch (Exception ex) { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } finally { userGroup = null; } }