Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 days ago.
Improve this question
I'm working on ASP.NET CORE MVC application and I need to check whether G-Drive migration is already completed and if so, needs to prevent that to be happened again. Kindly suggest!
public IList < UserDetailsMigrate > getMigrationUserDetails() {
IList < UserDetailsMigrate > userDetailsMigrates = new List < UserDetailsMigrate > ();
DataTable dtUserDetails = migrateGFolderDAL.getMigrationUserDetails();
foreach(DataRow drUserMigrate in dtUserDetails.Rows)
{
UserDetailsMigrate userDetailsMigrate = new UserDetailsMigrate();
userDetailsMigrate.UserMigrateId = Convert.ToInt32(drUserMigrate["UserMigrateId"])
userDetailsMigrate.StaffId = Convert.ToString(drUserMigrate["StaffId"]);
userDetailsMigrate.Emailld = Convert.ToString(drUserMigrate["EmailId"]);
userDetailsMigrate.FirstName = Convert.ToString(drUserMigrate["FirstName"]);
userDetailsMigrate.LastName = Convert.ToString(drUserMigrate["LastName"]);
userDetailsMigrate.Role = Convert.ToString(drUserMigrate[“"Role"]);
userDetailsMigrate.Status = Convert.ToString(drUserMigrate["Status"]);
userDetailsMigrates.Add(userDetailsMigrate);
return userDetailsMigrates;
}
}
Ref:
Screenshot
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I need to write a job that can be run to update all Users to default country/region to USA.
Here is the path
System administration > Common > Users> All users.
Try this code:
static void StackOverflow(Args _args)
{
SysUserInfo sysUserInfo;
// Method 1
ttsBegin;
while select forUpdate sysUserInfo
{
SysUserInfo.DefaultCountryRegion = "USA";
SysUserInfo.update();
}
ttsCommit;
// Method 2
update_recordSet sysUserInfo
setting DefaultCountryRegion = "USA";
info("End process");
}
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I want to migrate all alfresco repository contents from one repository to other. but i don't want the existing folder structure.
while migrating i have to validate the content according to some business requirement, and based on content type i have to create different folder structure in new repository.
Does any one did this previously.
Please help.
Thanks in Advance...
Ok, the solution that i give is not the best one, but i think it will work, we will start with a simple document and see if it's working (we will modifie the answer)
Getting the inputStram of a document
I think it's the most important part
public InputStream getTheInputStream () {
Document newDocument = (Document) getSession(serverURL, userName, password).getObject(path);
ContentStream cs = newDocument.getContentStream(null);
return cs.getStream();
}
Moving the inputStram from Server A to Server B
public void transfert() throws FileNotFoundException, IOException {
Session sessionB = getSession(serverUrlB, usernameB, passwordB);
//////////////////////////// GET THE FOLDER THAT YOU WILL WORK WITH
Folder root = sessionB.getRootFolder();
//////////////////////////// GET THE FOLDER THAT YOU WILL WORK WITH
File newfile = new File(fileName);
String nom = fileName;
Map<String, Object> properties = new HashMap<>();
properties.put(PropertyIds.OBJECT_TYPE_ID, BaseTypeId.CMIS_DOCUMENT.value());
properties.put(PropertyIds.NAME, nom);
List<Ace> addAces = new LinkedList<>();
List<Ace> removeAces = new LinkedList<>();
List<Policy> policies = new LinkedList<>();
String extension = FilenameUtils.getExtension(nom);
ContentStream contentStream = new ContentStreamImpl("content." + extension, BigInteger.valueOf(nom).length()),
new MimetypesFileTypeMap().getContentType(newfile), (theInputStream);
Document dc = root.createDocument(properties, contentStream, VersioningState.MAJOR, policies, addAces, removeAces, sessionB.getDefaultContext());
}
Try this method and tell me if it's working, if you don't have the getSession method just look to this post get session method.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to generate an UI where someone can navigate through the path of a tree structure. Here is an example of what I want, taken from JavaFX Scene Builder.
Depending on the actual position in an TreeView, this UI is updated. By clicking on individual items the tree is updated.
My question:
What Nodes/Controls are best used for this approach? (no full code required. Just mention the name of the controls).
My first idea is to generate a row of buttons closely to each other, but maybe there are better ideas.
Thanks.
You can use ControlsFx's BreadCrumbBar
Pane root = ...
Label selectedCrumbLbl = new Label();
BreadCrumbBar<String> sampleBreadCrumbBar = new BreadCrumbBar<>();
root.getChildren().addAll(sampleBreadCrumbBar, selectedCrumbLbl);
TreeItem<String> model = BreadCrumbBar.buildTreeModel("Hello", "World", "This", "is", "cool");
sampleBreadCrumbBar.setSelectedCrumb(model);
sampleBreadCrumbBar.setOnCrumbAction(new EventHandler<BreadCrumbBar.BreadCrumbActionEvent<String>>() {
#Override public void handle(BreadCrumbActionEvent<String> bae) {
selectedCrumbLbl.setText("You just clicked on '" + bae.getSelectedCrumb() + "'!");
}
});
https://github.com/controlsfx/controlsfx/blob/master/controlsfx-samples/src/main/java/org/controlsfx/samples/button/HelloBreadCrumbBar.java
The chosen solution did not work for me. I had to listen to the selectedCrumbProperty.
TreeItem<String> helloView = new TreeItem("Hello");
TreeItem<String> worldView = new TreeItem("World");
hellowView.getChildren().add(worldView);
TreeItem<String> thisView = new TreeItem("This");
worldView.getChildren().add(thisView);
TreeItem<String> isView = new TreeItem("is");
thisView.getChildren().add(isView);
BreadCrumbBar<String> sampleBreadCrumbBar = new BreadCrumbBar<>(helloView);
sampleBreadCrumbBar.setSelectedCrumb(helloView);
sampleBreadCrumbBar.selectedCrumbProperty().addListener((observable, oldValue, newValue) -> {
System.out.println(newValue);
if (newValue == worldView) {
//load this view
}
});
I typed this directly into the answer. There may be errors. Leave a note.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I need to show asp.net message box with yes and no (after validating the data with database)
My Requirement is
Before inserting of any data into Database(I need to check the data is present is DB on that data)
If data is present I need to show message box stating that data exists on the same day ? Are you sure want to save the data or cancel the
Not immediately after button click
please help me
Do you need help with validation?
Otherwise you just need to
If(isValid){
//Show MessageBox
}
Check validation first, if its valid show the messagebox.
On btn save_click.first check that data exists or not if exists then show message else save it. You can do like this:
SqlConnection con = new SqlConnection("Connectionstring");
con.Open();
string query = "Select count(*) from AD_Organisation where OrgName=#a";
SqlCommand cmd1 = new SqlCommand(query, con);
cmd1.Parameters.AddWithValue("#a", txtorgname.Text.ToString());
int count = Convert.ToInt32(cmd1.ExecuteScalar());
con.Close();
if (count > 0)
{
//show message that the data already exists
//call javascript
}
else
{
//insert command
}
For popup message you can use the javascript :
<script language="javascript" type="text/javascript">
function showalert() {
alert('Data already exists');
return false;
}
</script>
For calling the javascript message use
ScriptManager.RegisterStartupScript(this, GetType(), "display", "showalert('msg');", true);
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
can somebody help me how to get selected cell value when I click cell of Datagrid ? wondering I have datagrid with 5 fields and many rows, but I want to get cell value from datagrid which I clicked the row. Thanks advance.
If you need get row's value use this :
var row = $('#datagrid').datagrid('getSelected');
If you need get cell's value use this :
$('#datagrid').datagrid({'onClickCell': function (index, field, value) {
.... your code ...
}});
first you need to set datagrid property with onClickRow: onClickRow,
and then you can add this function
function onClickRow(index){
var tr = $(this).closest('tr.datagrid-row');
var idx = parseInt(tr.attr('datagrid-row-index'));
var ed = $("#dg").datagrid("getEditor", {index:editIndex, field:'myfield'});
var value = $(ed.target).val();
}
value variable will fill with the value from myfield when the row is click
Hope this can help you