Can anyone tell me that how can we create clone of an object in dynamic data site. Here is the brief of the requirement:
I am working on project where we raise invoices, now invoices are of two types: 1) One time. 2) Recurring (Repeating). One time invoice generation is simple, but in case of recurring invoices I am confused about how to do it. I think of doing it in 2 ways.
1) Create single invoice and in listing page have a link for clone invoice, where we open insert form having all the field values filled in from previous invoice, user makes relevant changes and save a new copy. My question is how can we do this?
2) We can give option to user, to add another invoice by clicking on link while creating invoice, which will open another copy of required details (like Amount, date, details etc), and then user can save the same in one go. We can use jquery for dynamically
creating fields. Again the question for this approach remains same that how can we do it?
Thanks in advance.
dynamic data .net c#Clone/Copy
Warm Regards:
Sitanshu
Please "Mark as Answer" if my post sort your problem
I am using LINQ to SQL for this and using VS 2008 SP1. I have implemented the same in my project but the clone link in the list page is appearing without havig link on it.
Thanks
Warm Regards:
Sitanshu
Please "Mark as Answer" if my post sort your problem
Thanks Rohit and Sandeep for prompt reply, but I want to implement it in dynamic data site, please have a look at the solution provided by Sjnaughton which is in context of dynamic data site, I have implemented IClonable object in mvc site, but how to do
it in dynamic data site.
Warm Regards:
Sitanshu
Please "Mark as Answer" if my post sort your problem
Hi Sbakshi, AFAIK this is the only sample of doing a clone in DD, I tend to do a custom page as when cloning there are always spcifics, i.e. clone all field but these etc.
What more do you want other than what the project offers?
Dynamic DataClone/Copy
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
sbakshi
Participant
1147 Points
222 Posts
How to create clone of an object?
Mar 10, 2010 06:37 AM|LINK
Hi,
Can anyone tell me that how can we create clone of an object in dynamic data site. Here is the brief of the requirement:
I am working on project where we raise invoices, now invoices are of two types: 1) One time. 2) Recurring (Repeating). One time invoice generation is simple, but in case of recurring invoices I am confused about how to do it. I think of doing it in 2 ways.
1) Create single invoice and in listing page have a link for clone invoice, where we open insert form having all the field values filled in from previous invoice, user makes relevant changes and save a new copy. My question is how can we do this?
2) We can give option to user, to add another invoice by clicking on link while creating invoice, which will open another copy of required details (like Amount, date, details etc), and then user can save the same in one go. We can use jquery for dynamically creating fields. Again the question for this approach remains same that how can we do it?
Thanks in advance.
dynamic data .net c# Clone/Copy
Sitanshu
Please "Mark as Answer" if my post sort your problem
Blog: http://sharp-architecture.blogspot.com/
Rohit Rao
Participant
1869 Points
357 Posts
Re: How to create clone of an object?
Mar 10, 2010 07:14 AM|LINK
This will help you - >
Here
Das.Sandeep
Star
10652 Points
1897 Posts
Re: How to create clone of an object?
Mar 10, 2010 07:17 AM|LINK
http://www.csharp411.com/c-object-clone-wars/
http://stackoverflow.com/questions/78536/cloning-objects-in-c
http://www.codeproject.com/KB/cs/cloneimpl_class.aspx
Please give us feedback no matter whether you get your answer.
Please "Mark as Answer" if it's useful for you.
Regards,
Sandeep
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: How to create clone of an object?
Mar 10, 2010 08:11 AM|LINK
Hi Sbakshi, have a look at N41 DynamicData Extender this is a clone utility for DD.
Dynamic Data Clone/Copy
Always seeking an elegant solution.
sbakshi
Participant
1147 Points
222 Posts
Re: How to create clone of an object?
Mar 10, 2010 09:43 AM|LINK
Hi Sjnaughton,
I am using LINQ to SQL for this and using VS 2008 SP1. I have implemented the same in my project but the clone link in the list page is appearing without havig link on it.
Thanks
Sitanshu
Please "Mark as Answer" if my post sort your problem
Blog: http://sharp-architecture.blogspot.com/
sbakshi
Participant
1147 Points
222 Posts
Re: How to create clone of an object?
Mar 10, 2010 09:45 AM|LINK
Thanks Rohit and Sandeep for prompt reply, but I want to implement it in dynamic data site, please have a look at the solution provided by Sjnaughton which is in context of dynamic data site, I have implemented IClonable object in mvc site, but how to do it in dynamic data site.
Sitanshu
Please "Mark as Answer" if my post sort your problem
Blog: http://sharp-architecture.blogspot.com/
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: How to create clone of an object?
Mar 10, 2010 10:53 AM|LINK
Hi Sbakshi, AFAIK this is the only sample of doing a clone in DD, I tend to do a custom page as when cloning there are always spcifics, i.e. clone all field but these etc.
What more do you want other than what the project offers?
Dynamic Data Clone/Copy
Always seeking an elegant solution.
sbakshi
Participant
1147 Points
222 Posts
Re: How to create clone of an object?
Mar 11, 2010 06:45 AM|LINK
Hi,
The reason why clone link is not clickable is because it is not entered in the RouteValueDictionary of Global.asax file.
We need to add the action to RouteValueDictionary in Global.asax file in order to use it in our project. That means the solution works.
Thanks Sjnaughton for solution, but it is in EntityDataModel, where as I am using Linq to Sql.
Now I will have to convert the extentions classes for Linq to SQL model.
Many Thanks
Sitanshu
Please "Mark as Answer" if my post sort your problem
Blog: http://sharp-architecture.blogspot.com/
sbakshi
Participant
1147 Points
222 Posts
Re: How to create clone of an object?
Mar 11, 2010 08:24 AM|LINK
Hi Sjnaughton,
Do we have linq to sql version of dd extension?
Sitanshu
Please "Mark as Answer" if my post sort your problem
Blog: http://sharp-architecture.blogspot.com/
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: How to create clone of an object?
Mar 11, 2010 09:55 AM|LINK
Sorry not aure what you mean [:$]
Dynamic Data
Always seeking an elegant solution.