Search Results

Search found 8990 results on 360 pages for 'customer contact'.

Page 44/360 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • How to deal with multiple sub-type of one super-type in Django admin

    - by Henri
    What would be the best solution for adding/editing multiple sub-types. E.g a super-type class Contact with sub-type class Client and sub-type class Supplier. The way shown here works, but when you edit a Contact you get both inlines i.e. sub-type Client AND sub-type Supplier. So even if you only want to add a Client you also get the fields for Supplier of vice versa. If you add a third sub-type , you get three sub-type field groups, while you actually only want one sub-type group, in the mentioned example: Client. E.g.: class Contact(models.Model): contact_name = models.CharField(max_length=128) class Client(models.Model): contact = models.OneToOneField(Contact, primary_key=True) user_name = models.CharField(max_length=128) class Supplier(models.Model): contact.OneToOneField(Contact, primary_key=True) company_name = models.CharField(max_length=128) and in admin.py class ClientInline(admin.StackedInline): model = Client class SupplierInline(admin.StackedInline): model = Supplier class ContactAdmin(admin.ModelAdmin): inlines = (ClientInline, SupplierInline,) class ClientAdmin(admin.ModelAdmin): ... class SupplierAdmin(admin.ModelAdmin): ... Now when I want to add a Client, i.e. only a Client I edit Contact and I get the inlines for both Client and Supplier. And of course the same for Supplier. Is there a way to avoid this? When I want to add/edit a Client that I only see the Inline for Client and when I want to add/edit a Supplier that I only see the Inline for Supplier, when adding/editing a Contact? Or perhaps there is a different approach. Any help or suggestion will be greatly appreciated.

    Read the article

  • Improving field get and set performance with ASM or Javassist

    - by ng
    I would like to avoid reflection in an open source project I am developing. Here I have classes like the following. public class PurchaseOrder { @Property private Customer customer; @Property private String name; } I scan for the @Property annotation to determine what I can set and get from the PurchaseOrder reflectively. There are many such classes all using java.lang.reflect.Field.get() and java.lang.reflect.Field.set(). Ideally I would like to generate for each property an invoker like the following. public interface PropertyAccessor<S, V> { public void set(S source, V value); public V get(S source); } Now when I scan the class I can create a static inner class of PurchaseOrder like so. static class customer_Field implements PropertyAccessor<PurchaseOrder, Customer> { public void set(PurchaseOrder order, Customer customer) { order.customer = customer; } public Customer get(PurchaseOrder order) { return order.customer; } } With these I totally avoid the cost of reflection. I can now set and get from my instances with native performance. Can anyone tell me how I would do this. A code example would be great. I have searched the net for a good example but can find nothing like this. The ASM and Javasist examples are pretty poor also. The key here is that I have an interface that I can pass around. So I can have various implementations, perhaps one with Java Reflection as a default, one with ASM, and one with Javassist? Any help would be greatly appreciated.

    Read the article

  • When to call Dispose in Entity Framework?

    - by Abdel Olakara
    Hi All, In my application I am making use of Spring.Net for IoC. The service objects are called from the ASP.Net files to perform CRUD operations using these service object. For example, I have CustomerService to do all CRUD operations on Customer table. I use entity framework and the entities are injected .. my question is where do I call the dispose method? As far as I understood from the API documentations, unless I call Dispose() there is no guaranty it will be garbage collected! So where and how do I do it? Example Service Class: public class CustomerService { public ecommEntities entities = {get; set;} public bool AddCustomer(Customer customer) { try { entities.AddToCustomer(customer); entities.SaveChanges(); return true; } catch (Exception e) { log.Error("Error occured during creation of new customer: " + e.Message + e.StackTrace); return false; } } public bool UpdateCustomer(Customer customer) { entities.SaveChanges(); return true; } public bool DeleteCustomer(Customer customer) . . . And I just create an object of CustomerService at the ASP partial class and call the necessary methods. Thanks in advance for the best practice and ideas.. Regards, Abdel Raoof

    Read the article

  • Improving field get and set performance with ASM

    - by ng
    I would like to avoid reflection in an open source project I am developing. Here I have classes like the following. public class PurchaseOrder { @Property private Customer customer; @Property private String name; } I scan for the @Property annotation to determine what I can set and get from the PurchaseOrder reflectively. There are many such classes all using java.lang.reflect.Field.get() and java.lang.reflect.Field.set(). Ideally I would like to generate for each property an invoker like the following. public interface PropertyAccessor<S, V> { public void set(S source, V value); public V get(S source); } Now when I scan the class I can create a static inner class of PurchaseOrder like so. static class customer_Field implements PropertyAccessor<PurchaseOrder, Customer> { public void set(PurchaseOrder order, Customer customer) { order.customer = customer; } public Customer get(PurchaseOrder order) { return order.customer; } } With these I totally avoid the cost of reflection. I can now set and get from my instances with native performance. Can anyone tell me how I would do this. A code example would be great. I have searched the net for a good example but can find nothing like this. The ASM examples are pretty poor also. The key here is that I have an interface that I can pass around. So I can have various implementations, perhaps one with Java Reflection as a default, one with ASM, and maybe one with Javassist? Any help would be greatly appreciated.

    Read the article

  • Clearly defined Rails routing problem - undefined method for Nil:NilClass

    - by sscirrus
    Guys and girls, I have been working on this problem for a while but still no joy. This is my second question within this general area, because the last question was getting too long and this is now more well-defined. Summary of the Problem: I am loading a page for my customers and I get error: undefined method 'name' for Nil:NilClass My Code #Link on views/users/show.html.erb: <%= link_to "Customer Account", :action => "home", :controller => "customers", :id => @user.user_type_id %> #Regular Route: map.connect 'customers/home/:id', :controller => 'customers', :action => 'home' #Rake Routes, first entry: /customers/home/:id :controller=>:"customers", :action=>"home" #Customers Controller: def home render :layout => 'home' @customer = Customer.find(params[:id]) @user = @current_user_session.user flash[:error] = "Customer not found" and return unless @customer @jobs = @customer.jobs end #views/customers/home.html.erb: <%= @customer.name %> I have absolutely no idea why this seemingly clear sequence of events is resulting in a NilClass. Search the console for Customer.find(2) returns the correct customer. What is this noob missing? Thank you very much.

    Read the article

  • Generating a field setter and getter with ASM

    - by ng
    I would like to avoid reflection in an open source project I am developing. Here I have classes like the following. public class PurchaseOrder { @Property private Customer customer; @Property private String name; } I scan for the @Property annotation to determine what I can set and get from the PurchaseOrder reflectively. There are many such classes all using java.lang.reflect.Field.get() and java.lang.reflect.Field.set(). Ideally I would like to generate for each property an invoker like the following. public interface PropertyAccessor<S, V> { public void set(S source, V value); public V get(S source); } Now when I scan the class I can create a static inner class of PurchaseOrder like so. static class customer_Field implements PropertyAccessor<PurchaseOrder, Customer> { public void set(PurchaseOrder order, Customer customer) { order.customer = customer; } public Customer get(PurchaseOrder order) { return order.customer; } } With these I totally avoid the cost of reflection. I can now set and get from my instances with native performance. Can anyone tell me how I would do this. A code example would be great. I have searched the net for a good example but can find nothing like this. The ASM examples are pretty poor also. The key here is that I have an interface that I can pass around. So I can have various implementations, perhaps one with Java Reflection as a default, one with ASM, and maybe one with Javassist? Any help would be greatly appreciated.

    Read the article

  • VB.NET editing existing that with a form

    - by user127147
    Hi there, I have a simple questions that puzzles me. I need a little bit of refreashment with VB as I have been away for a while. I have a form that adds new contacts. New contacts are added by pressing an appropriate button and they appear as an entry in the list on the form. I try now to add an edit button that will edit existing entries. User will select a given entry on the list and press edit button and will be presented with an appropriate form (AddContFrm). Right now it simply adds another entry with the same title. Logic is handled in a class called Contact.vb Here is my code. Public Class Contact Public Contact As String Public Title As String Public Fname As String Public Surname As String Public Address As String Private myCont As String Public Property Cont() Get Return myCont End Get Set(ByVal value) myCont = Value End Set End Property Public Overrides Function ToString() As String Return Me.Cont End Function Sub NewContact() FName = frmAddCont.txtFName.ToString frmStart.lstContact.Items.Add(FName) frmAddCont.Hide() End Sub Public Sub Display() Dim C As New Contact 'C.Cont = InputBox("Enter a title for this contact.") C.Cont = frmAddCont.txtTitle.Text C.Fname = frmAddCont.txtFName.Text C.Surname = frmAddCont.txtSName.Text C.Address = frmAddCont.txtAddress.Text 'frmStart.lstContact.Items.Add(C.Cont.ToString) frmStart.lstContact.Items.Add(C) End Sub End Class AddContFrm Public Class frmAddCont Public Class ControlObject Dim Title As String Dim FName As String Dim SName As String Dim Address As String Dim TelephoneNumber As Integer Dim emailAddress As String Dim Website As String Dim Photograph As String End Class Private Sub btnConfirmAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConfirmAdd.Click Dim C As New Contact C.Display() Me.Hide() End Sub Private Sub frmAddCont_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class and frmStart.vb Public Class frmStart Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click frmAddCont.Show() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDel.Click Dim DelCont As Contact DelCont = Me.lstContact.SelectedItem() lstContact.Items.Remove(DelCont) End Sub Private Sub lstContact_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstContact.SelectedIndexChanged End Sub Private Sub btnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEdit.Click Dim C As Contact If lstContact.SelectedItem IsNot Nothing Then C = DirectCast(lstContact.SelectedItem, Contact) C.Display() End If End Sub End Class

    Read the article

  • c++ exercise question

    - by Djecua
    in need of help on a C++ program that will help a deli owner help her customers.Prompt the user for the number of bagels.if then calculate the customers payment two ways. first it finds the price of the smallest multiple of 13 bagels that is closet to the customer's order. it then calculates the price of the customer's order so that the customer's payment is the smallest amount possible with the customer getting the exact number of bagels ordered. if the first method is the smallest amount the program outputs the number of bagels the customer will receive along with the dollar amount owed and the dollar amount saved. otherwise just print the number of bagels received the dollar amount owed $ 3.80 for a dozen bagels (13 bagels) half a dozen(6 bagels) sing bagel cost $.50 owner of the deli is a honest merchant, customers always get the best price on an order, even if they get more bagels than ordered, for example a customer that orders 10 bagels would pay $ 4.60 (2.60 for a half dozen bagels plus $2.00 for 4 single bagels.merchant gives her customer 13 bagels saving the customer $0.80 If someone can example to me how would i design to give customer extra bagels and how to calculate cost.

    Read the article

  • Problems breaking out of nested loops

    - by user1040281
    I have problems breaking out off these nested loops correctly. What the code is trying to do is to indicate that a customer has rented a certain movie. Both the movie and customer are compared to properties of arraylist objects and then if all checks out the name property and ID property of a movie object are added as a string to another arraylist. All this works correctly as long as I use the first movie (from movies) and the first customer (from customers) but if I try renting other movies further down my arraylist with other customers then it adds the rented movie to the customerRentedMovies arraylist but prints out the "else message". I figure I need to break out of the foreach(blabla) loops aswell? or could goto be used? Comments was removed (looked kinda messy, can explain further if needed) public void RentMovie(string titel, int movieID, string name, int customerID) { foreach (Customer customer in customers) { if (name == customer.Name && customerID == customer.CustomerID) { foreach (MovieInfo movie in movies) { if (titel == movie.Titel && movieID == movie.MovieID) { movie.rented = true; string rentedMovie = string.Format("{0} ID: {1}", movie.Titel, movie.MovieID); customer.customerRentedMovies.Add(rentedMovie); break; } else { Console.WriteLine("No movie with that titel and ID!"); } } break; } else { Console.WriteLine("No customer with that ID and name"); } } }

    Read the article

  • need an empty XML while unmarshalling a JAXB annotated class

    - by sswdeveloper
    I have a JAXB annotated class Customer as follows @XmlRootElement(namespace = "http://www.abc.com/customer") public class Customer{ private String name; private Address address; @XmlTransient private HashSet set = new HashSet<String>(); public String getName(){ return name; } @XmlElement(name = "Name", namespace = "http://www.abc.com/customer" ) public void setName(String name){ this.name = name; set.add("name"); } public String getAddress(){ return address; } @XmlElement(name = "Address", namespace = "http://www.abc.com/customer") public void setAddress(Address address){ this.address = address; set.add("address"); } public HashSet getSet(){ return set; } } I need to return an empty XML representing this to the user, so that he may fill the necesary values in the XML and send a request So what I require is : <Customer> <Name></Name> <Address></Address> </Customer> If i simply create an empty object Customer cust = new Customer() ; marshaller.marshall(cust,sw); all I get is the toplevel element since the other fields of the class are unset. What can I do to get such an empty XML? I tried adding the nillable=true annotation to the elements however, this returns me an XML with the xsi:nil="true" which then causes my unmarshaller to ignore this. How do I achieve this?

    Read the article

  • Grails one-to-many mapping with joinTable

    - by intargc
    I have two domain-classes. One is a "Partner" the other is a "Customer". A customer can be a part of a Partner and a Partner can have 1 or more Customers: class Customer { Integer id String name static hasOne = [partner:Partner] static mapping = { partner joinTable:[name:'PartnerMap',column:'partner_id',key:'customer_id'] } } class Partner { Integer id static hasMany = [customers:Customer] static mapping = { customers joinTable:[name:'PartnerMap',column:'customer_id',key:'partner_id'] } } However, whenever I try to see if a customer is a part of a partner, like this: def customers = Customer.list() customers.each { if (it.partner) { println "Partner!" } } I get the following error: org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; SQL [select this_.customer_id as customer1_162_0_, this_.company as company162_0_, this_.display_name as display3_162_0_, this_.parent_customer_id as parent4_162_0_, this_.partner_id as partner5_162_0_, this_.server_id as server6_162_0_, this_.status as status162_0_, this_.vertical_market as vertical8_162_0_ from Customer this_]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query It looks as if Grails is thinking partner_id is a part of the Customer query, and it's not... It is in the PartnerMap table, which is supposed to find the customer_id, then get the Partner from the corresponding partner_id. Anyone have any clue what I'm doing wrong? Edit: I forgot to mention I'm doing this with legacy database tables. So I have a Partner, Customer and PartnerMap table. PartnerMap has simply a customer_id and partner_id field.

    Read the article

  • How can I have a single helper work on different models passed to it?

    - by Angela
    I am probably going to need to refactor in two steps since I'm still developing the project and learning the use-cases as I go along since it is to scratch my own itch. I have three models: Letters, Calls, Emails. They have some similarilty, but I anticipate they also will have some different attributes as you can tell from their description. Ideally I could refactor them as Events, with a type as Letters, Calls, Emails, but didn't know how to extend subclasses. My immediate need is this: I have a helper which checks on the status of whether an email (for example) was sent to a specific contact: def show_email_status(contact, email) @contact_email = ContactEmail.find(:first, :conditions => {:contact_id => contact.id, :email_id => email.id }) if ! @contact_email.nil? return @contact_email.status end end I realized that I, of course, want to know the status for whether a call was made to a contact as well, so I wrote: def show_call_status(contact, call) @contact_call = ContactCall.find(:first, :conditions => {:contact_id => contact.id, :call_id => call.id }) if ! @contact_call.nil? return @contact_call.status end end I would love to be able to just have a single helper show_status where I can say show_status(contact,call) or show_status(contact,email) and it would know whether to look for the object @contact_call or @contact_email. Yes, it would be easier if it were just @contact_event, but I want to do a small refactoring while I get the program up and running, and this would make the ability to do a history for a given contact much easier. Thanks!

    Read the article

  • Selling Visual Studio ALM

    - by Tarun Arora
    Introduction As a consultant I have been selling Application Lifecycle Management services using Visual Studio and Team Foundation Server. I’ve been contacted various times by friends working in organization telling me that ALM processes in their company were benchmarked when dinosaurs walked the earth. Most of these individuals already know the great features Microsoft ALM tools offer and are keen to start a conversation with the CIO but don’t exactly know where to start. It is very important how you engage in your first conversation, if you start the conversation with ‘There is this great tooling from Microsoft which offers amazing features to boost developer productivity, … ‘ from experience I can tell you the reply from your CIO would be ‘I already know! Our existing landscape has a combination of bleeding edge open source and cutting edge licensed tools which already cover these features quite well, more over Microsoft products have a high licensing cost associated to them.’ You will always find it harder to sell by feature, the trick is to highlight the gap in the existing processes & tools and then highlight the impact of these gaps to the overall development processes, by now you would have captured enough attention to show off how the ALM tooling offered by Microsoft not only fills those gaps but offers great value adds to take their development practices to the next level. Rangers ALM Assessment Guide Image 1 – Welcome! First look at the Rangers ALM assessment guide Most organization already have some processes in place to cover aspects of ALM. How do you go about proving that there isn’t enough cover in place? This is where Visual Studio ALM Rangers ALM Assessment guide can help. The ALM assessment guide is really a tool that helps you gather information about Development practices and processes within a customer's environment. Several questionnaires are used to identify the current state of individual development lifecycle areas and decide on a desired state for those processes. It also presents guidance and roll-up summaries to help with recommendations moving forward. The ALM Rangers assessment guide can be downloaded from here. Image 2 – ALM Assessment guide divided into different functions of SDLC The assessment guide is divided into different functions of Software Development Lifecycle (listed below), this gives you the ability to access how mature the company is in different areas of SDLC. Architecture & Design Requirement Engineering & UX Development Software Configuration Management Governance Deployment & Operations Testing & Quality Assurance Project Planning & Management Each section has a set of questions, fill in the assessment by selecting “Never/Sometimes/Always” from the Answer column in the question sheets.  Each answer has weightage to the overall score. Each question has a link next to it, clicking the link takes you to the Reference sheet which gives you more details about the question along with a reason for “why you need to ask this question?”, “other ways to phrase the question” and “what to expect as an answer from the customer”. The trick is to engage the customer in a discussion. You need to probe a lot, listen to the customer and have a discussion with several team members, preferably without management to ensure that you receive candid feedback. This reminds me of a funny incident when during an ALM review a customer told me that they have a sophisticated semi-automated application deployment process, further discussions revealed that deployment actually involved 72 manual configuration steps per production node. Such observations can be recorded in the Issue Brainstorming worksheet for further consideration later. It is also worth mentioning the different levels of ALM maturity to the customer. By default the desired state of ALM maturity is set to Standard, it is possible to set a desired state by area, you should strive for Advanced or Dynamic, it always helps by explaining the classification and advantages. Image 3 – ALM levels by description The ALM assessment guide helps you arrive at a quantitative measure of the company’s ALM maturity. The resultant graph plotted on a spider’s web shows you the company’s current state of ALM maturity and the desired state of ALM maturity. Further since the results are classified by area you can immediately spot the areas where the customer needs immediate help. Image 4 – The spiders web! The red cross icons are areas shouting out for immediate attention, the yellow exclamation icons are areas that need improvement. These icons are calculated on the difference between the Current State of ALM maturity VS the Desired state of ALM maturity. Image 5 – Results by area Conclusion To conclude the Rangers ALM assessment guide gives you the ability to, Measure the customer’s current ALM maturity level Understand the ALM maturity level the customer desires to achieve Capture a healthy list of issues the customer wants to brainstorm further Now What’s next…? Download and get started with the Rangers ALM Assessment Guide. If you have successfully captured the above listed three pieces of information you are in a great state to make recommendations on the identified areas highlighting the benefits that Visual Studio ALM tools would offer. In the next post I will be covering how to take the ALM assessment results as the base to actually convert your recommendation into a sell.  Remember to subscribe to http://feeds.feedburner.com/TarunArora. I would love to hear your feedback! If you have any recommendations on things that I should consider or any questions or feedback, feel free to leave a comment. *** A special thanks goes out to fellow ranges Willy, Ethem and Philip for reviewing the blog post and providing valuable feedback. ***

    Read the article

  • Implementing custom "Remember Me" with Stripe

    - by Matt
    Implementing remember me with Stripe, while not using their Checkout (not supported on PhoneGap), seems to be fine using the path: First time: Request token on the client side using card info. Create customer on server side using token. Upon confirm, charge customer. Second time: Check if current user is Stripe customer by requesting the info from our server. If is Stripe customer, show "use credit card on file" instead of regular CC form. Upon confirm, charge customer. However, there is one important convenience items missing--last four digits of card number. Most sites inform you of the card you're using before making the payment, pretty important in case you have to switch out cards. I have seen that you can retrieve charges which would allow me to get the last four digits. Is it bad practice to pull that and display it? Are there alternative solutions anyone has in mind?

    Read the article

  • New Exadata, Exalogic, Exalytics Public References

    - by Javier Puerta
    CUSTOMER SUCCESS STORIES & SPOTLIGHTS AmerisourceBergen (US) Oracle Exadata, Oracle Advanced Compression, Oracle Advanced Customer Support Services, Oracle Active Data Guard Published: July 31, 2014 Guangzhou Municipal Human Resources and Social Security Bureau (China) Exalogic, Enterprise Mgr Published: July 31, 2014 Norfolk Southern Corp. (US) Oracle Exadata, Oracle Exalytics, Oracle Business Intelligence Suite, Enterprise Edition Published: July 30, 2014 TDC (Denmark) Oracle Exadata, Oracle ZFS Storage Appliance, SPARC T4-4, SPARC T4-1, Oracle Solaris, Oracle Consulting, Oracle Advanced Customer Support Services Published: July 30, 2014 Chosun Ilbo (Korea) Oracle Exadata, Oracle GoldenGate Published: July 29, 2014 GIA (Gemological Institute of America) (US), Exalogic, Exadata Published: July 25, 2014 City of Lakeland (US) Oracle Exadata, Oracle Active Data Guard, Oracle Partitioning, Oracle Tuning Pack, Oracle Enterprise Manager, Oracle Diagnostics Pack, Oracle Enterprise Service Bus, Oracle Advanced Customer Support Services, Oracle Platinum Services Published: July 15, 2014 Tech Mahindra (India) Oracle Exadata, SPARC T5-4, Oracle Solaris 11, PeopleSoft Human Resources, Oracle Advanced Customer Support Services Published: July 01, 2014

    Read the article

  • Recent Updates on Oracle Hardware Technical Resource Center

    - by uwes
    Over the last two weeks there have been some updates on the Oracle Hardware Technical Resource Center (HW TRC). The following list summarize the categories which have been added or changed. Feel free to explore. SPARC Netra T4 Servers customer and technical presentation, partner FAQ and more Oracle Solaris added: 4 customer presentations, technical presentation StorageTek Virtual Storage Manager (VSM) and Virtual Library Extension (VLE) added presentations: customer, technical, value virtual tape, role of tape in mainframe, partner FAQ, config guide T10000 Tape Drives added: sales and technical presentation, partner FAQ T9840D Tape Drives added: sales and technical presentation, FAQ LTO Tape Drives added: customer and technical presentation, partner FAQ, ordering guide and more Netra ATCA Blade Servers Netra x86 Servers added: technical presentation, partner FAQ, configuration hints and more Netra 6000 Modular System added: customer and technical presentation, partner FAQ, order menu and more

    Read the article

  • Code refactoring with Visual Studio 2010 Part-4

    - by Jalpesh P. Vadgama
    I have been writing few post with code refactoring features in Visual Studio 2010. This post also will be part of series and this post will be last of the series. In this post I am going explain two features 1) Encapsulate Field and 2) Extract Interface. Let’s explore both features in details. Encapsulate Field: This is a nice code refactoring feature provides by Visual Studio 2010. With help of this feature we can create properties from the existing private field of the class. Let’s take a simple example of Customer Class. In that I there are two private field called firstName and lastName. Below is the code for the class. public class Customer { private string firstName; private string lastName; public string Address { get; set; } public string City { get; set; } } Now lets encapsulate first field firstName with Encapsulate feature. So first select that field and goto refactor menu in Visual Studio 2010 and click on Encapsulate Field. Once you click that a dialog box will appear like following. Now once you click OK a preview dialog box will open as we have selected preview reference changes. I think its a good options to check that option to preview code that is being changed by IDE itself. Dialog will look like following. Once you click apply it create a new property called FirstName. Same way I have done for the lastName and now my customer class code look like following. public class Customer { private string firstName; public string FirstName { get { return firstName; } set { firstName = value; } } private string lastName; public string LastName { get { return lastName; } set { lastName = value; } } public string Address { get; set; } public string City { get; set; } } So you can see that its very easy to create properties with existing fields and you don’t have to change anything there in code it will change all the stuff itself. Extract Interface: When you are writing software prototype and You don’t know the future implementation of that then its a good practice to use interface there. I am going to explain here that How we can extract interface from the existing code without writing a single line of code with the help of code refactoring feature of Visual Studio 2010. For that I have create a Simple Repository class called CustomerRepository with three methods like following. public class CustomerRespository { public void Add() { // Some code to add customer } public void Update() { //some code to update customer } public void Delete() { //some code delete customer } } In above class there are three method Add,Update and Delete where we are going to implement some code for each one. Now I want to create a interface which I can use for my other entities in project. So let’s create a interface from the above class with the help of Visual Studio 2010. So first select class and goto refactor menu and click Extract Interface. It will open up dialog box like following. Here I have selected all the method for interface and Once I click OK then it will create a new file called ICustomerRespository where it has created a interface. Just like following. Here is a code for that interface. using System; namespace CodeRefractoring { interface ICustomerRespository { void Add(); void Delete(); void Update(); } } Now let's see the code for the our class. It will also changed like following to implement the interface. public class CustomerRespository : ICustomerRespository { public void Add() { // Some code to add customer } public void Update() { //some code to update customer } public void Delete() { //some code delete customer } } Isn't that great we have created a interface and implemented it without writing a single line of code. Hope you liked it. Stay tuned for more.. Till that Happy Programming.

    Read the article

  • Set secondary receiver in PayPal Chained Payment after the initial transaction

    - by CJxD
    I'm running a service whereby customers seek the services of 'freelancers' through our web platform. The customer will make a 'bid' which is immediately taken from their accounts as security. Once the job is completed, the customer marks it as accepted and the bid gets distributed to the freelancer(s) as a reward. After initially storing these rewards in the accounts of the freelancers and relying on MassPay to sort out paying them later, I realised that your business needs to be turning over at least £5000/month before MassPay is switched on. Instead, I was referred to Delayed Chained Payments in PayPal's Adaptive Payments API. This allows the customer to pay the primary receiver (my business) before the payment is later triggered to be sent to the secondary receivers (the freelancers). However, at the time that the customer initiates this transaction, you must understand that nobody yet knows who will receive the reward. So, before I program this whole Adaptive Payments system, is it even possible to change or add the secondary receivers after the customer has paid? If not, what can I do?

    Read the article

  • What Is the Experience Revolution – and Why Does it Matter?

    - by Charles Knapp
    Customer experience is how your customer perceives the sum of their interactions with your organization throughout their buying, service delivery, and ownership experiences. In our highly connected online, phone, social, and mobile interactions, it’s easy to lose a dissatisfied customer – who can readily dissuade future customers. Nevertheless, great brand experiences still deliver top margins and low-cost repeat business. The Experience Revolution seamlessly connects customer-facing interactions with employee-facing CRM transactions. While your organization has invested in some of these capabilities, how well do the pieces work for your customers? Is it time for your organization to join the Experience Revolution? We invite you to join Oracle President Mark Hurd for an incredible, educational evening on June 25, from 6:00 – 9:00 p.m. in New York City.  Attend to see and learn: What leading brands do to win over customers How to unlock the value of customer experiences The bottom-line effect of great experiences Why doing nothing is not an option

    Read the article

  • sending mail in contact information with c#.net problem? help please..

    - by ilkdrl
    protected void Button2_Click(object sender, EventArgs e) { string ad = TextBox1.Text; string firma = TextBox2.Text; string mail = TextBox3.Text; string tel = TextBox4.Text; string tel2 = TextBox5.Text; string fax = TextBox6.Text; string fax2 = TextBox7.Text; string web = TextBox8.Text; string mesaj = TextBox9.Text; try { string fromAddress = "[email protected]"; string fromName = "user"; string toMail = "[email protected]"; string toNme = "Mr."; string msgSubject = "Contact"; string sifre = "userpassword"; string msgBody = "you have a message; \n" + "\n" + "\n" + "Mesaji Gönderenin Adi :" + ad + "\n" + "Mesaji Gönderen Firma :" + firma + "\n" + "Mesaji Gönderenin Maili :" + mail + "\n" + "Mesaji Gönderenin Tel. Numarasi :" + tel + tel2 + "\n" + "Mesaji Gönderenin Fax Numarasi :" + fax + fax2 + "\n" + "Mesaji Gönderenin Web Adresi :" + web + "\n" + "\n" + "\n" + "" + mesaj + "" + "\n" + "\n" + "=======================================" + "\n"; SmtpClient client = new SmtpClient(); client.Credentials = new System.Net.NetworkCredential(fromAddress, sifre); client.Host = "smtp.gmail.com"; client.Port = 1772; client.EnableSsl = false; MailAddress from = new MailAddress(fromAddress, fromName); MailAddress to = new MailAddress(toMail, toNme); MailMessage message = new MailMessage(from, to); message.Subject = msgSubject; message.Body = msgBody; client.Send(message); Response.Redirect("iletisim.aspx"); } catch (Exception ex) { } AND WEB.CONFIG http://go.microsoft.com/fwlink/?LinkId=169433 -- iam trying to send email but i cant give. Where is my problem. Please help me.

    Read the article

  • Help with InvalidCastException

    - by Robert
    I have a gridview and, when a record is double-clicked, I want it to open up a new detail-view form for that particular record. As an example, I have created a Customer class: using System; using System.Data; using System.Configuration; using System.Collections.Generic; using System.ComponentModel; using System.Data.SqlClient; using System.Collections; namespace SyncTest { #region Customer Collection public class CustomerCollection : BindingListView<Customer> { public CustomerCollection() : base() { } public CustomerCollection(List<Customer> customers) : base(customers) { } public CustomerCollection(DataTable dt) { foreach (DataRow oRow in dt.Rows) { Customer c = new Customer(oRow); this.Add(c); } } } #endregion public class Customer : INotifyPropertyChanged, IEditableObject, IDataErrorInfo { private string _CustomerID; private string _CompanyName; private string _ContactName; private string _ContactTitle; private string _OldCustomerID; private string _OldCompanyName; private string _OldContactName; private string _OldContactTitle; private bool _Editing; private string _Error = string.Empty; private EntityStateEnum _EntityState; private Hashtable _PropErrors = new Hashtable(); public event PropertyChangedEventHandler PropertyChanged; private void FirePropertyChangeNotification(string propName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propName)); } } public Customer() { this.EntityState = EntityStateEnum.Unchanged; } public Customer(DataRow dr) { //Populates the business object item from a data row this.CustomerID = dr["CustomerID"].ToString(); this.CompanyName = dr["CompanyName"].ToString(); this.ContactName = dr["ContactName"].ToString(); this.ContactTitle = dr["ContactTitle"].ToString(); this.EntityState = EntityStateEnum.Unchanged; } public string CustomerID { get { return _CustomerID; } set { _CustomerID = value; FirePropertyChangeNotification("CustomerID"); } } public string CompanyName { get { return _CompanyName; } set { _CompanyName = value; FirePropertyChangeNotification("CompanyName"); } } public string ContactName { get { return _ContactName; } set { _ContactName = value; FirePropertyChangeNotification("ContactName"); } } public string ContactTitle { get { return _ContactTitle; } set { _ContactTitle = value; FirePropertyChangeNotification("ContactTitle"); } } public Boolean IsDirty { get { return ((this.EntityState != EntityStateEnum.Unchanged) || (this.EntityState != EntityStateEnum.Deleted)); } } public enum EntityStateEnum { Unchanged, Added, Deleted, Modified } void IEditableObject.BeginEdit() { if (!_Editing) { _OldCustomerID = _CustomerID; _OldCompanyName = _CompanyName; _OldContactName = _ContactName; _OldContactTitle = _ContactTitle; } this.EntityState = EntityStateEnum.Modified; _Editing = true; } void IEditableObject.CancelEdit() { if (_Editing) { _CustomerID = _OldCustomerID; _CompanyName = _OldCompanyName; _ContactName = _OldContactName; _ContactTitle = _OldContactTitle; } this.EntityState = EntityStateEnum.Unchanged; _Editing = false; } void IEditableObject.EndEdit() { _Editing = false; } public EntityStateEnum EntityState { get { return _EntityState; } set { _EntityState = value; } } string IDataErrorInfo.Error { get { return _Error; } } string IDataErrorInfo.this[string columnName] { get { return (string)_PropErrors[columnName]; } } private void DataStateChanged(EntityStateEnum dataState, string propertyName) { //Raise the event if (PropertyChanged != null && propertyName != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } //If the state is deleted, mark it as deleted if (dataState == EntityStateEnum.Deleted) { this.EntityState = dataState; } if (this.EntityState == EntityStateEnum.Unchanged) { this.EntityState = dataState; } } } } Here is my the code for the double-click event: private void customersDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { Customer oCustomer = (Customer)customersBindingSource.CurrencyManager.List[customersBindingSource.CurrencyManager.Position]; CustomerForm oForm = new CustomerForm(); oForm.NewCustomer = oCustomer; oForm.ShowDialog(this); oForm.Dispose(); oForm = null; } Unfortunately, when this code runs, I receive an InvalidCastException error stating "Unable to cast object to type 'System.Data.DataRowView' to type 'SyncTest.Customer'". This error occurs on the very first line of that event: Customer oCustomer = (Customer)customersBindingSource.CurrencyManager.List[customersBindingSource.CurrencyManager.Position]; What am I doing wrong?... and what can I do to fix this? Any help is greatly appreciated. Thanks!

    Read the article

  • Can i use a SELECT statement to define a CHECK constraint?

    - by Neel
    In MS SQL server, can i use a SELECT statement to define a CHECK constraint? Say i have to work with two tables "Customer Master" and "Indian Customer" in ideal situation both tables are compleatly different, and are not interrelated in anyways. however they share the same database Content of "Customer Master": CustomerName (colomn): a, b, c, d, e Branchlocation (colomn): IN, AU, IN, IN, UK Content of "Indian Customer": customerID (colomn): 1, 2, 3 CustomerName (colomn): a, c, d customer details (colomn): details1, details, details . . . In Table "Indian Customer" i want to put a constraint so that the users entring data in this table should not be able to enter customers that dont exist in "Customer Master" or whose branch location is not IN. also the tables are in the same project but are not directly related.

    Read the article

  • MessageBox if Recordset Update is Successful

    - by Paolo Bernasconi
    In Access 2007, I have a form to add a new contact to a table: RecSet.AddNew RecSet![Code_Personal] = Me.txtCodePersonal.Value RecSet![FName] = Me.TxtFName.Value RecSet![LName] = Me.txtLName.Value RecSet![Tel Natel] = Me.txtNatTel.Value RecSet![Tel Home] = Me.txtHomeTel.Value RecSet![Email] = Me.txtEmail.Value RecSet.Update This has worked so far, and the contact has successfully been aded. But I'm having two problems: I want to display a messagebox to tell the user the contact was successfully added If the contact was not successfully added because A contact with this name already exists A different issue Then display a message box "Contact already exists" or "error occured" respectively. My idea of doing this is: If recSet.Update = true Then MsgBox "Paolo Bernasconi was successfully added" Else if RecSet![FName] & RecSet![LName] 'already exist in table MsgBox "Contact already exists" Else MsgBox "An unknown error occured" I know this code is wrong, and obviously doesn't work, but it's just to give you an idea of what I'm trying to achieve. Thanks for all your help in advance.

    Read the article

  • mysql alter to table

    - by user485783
    Hi, I drop the mysql alter code below to database via phpmyadmin one by one, it it work fine, is there anyone could help me how to drop it all together at once? or do you know the the samples of php code that may execute it? just let me know please. thanks in advace ALTER TABLE user ADD title varchar(16) COLLATE utf8_bin NOT NULL DEFAULT '' AFTER user_id ALTER TABLE customer ADD title varchar(16) COLLATE utf8_bin NOT NULL DEFAULT '' AFTER customer_id ALTER TABLE customer ADD date_birtdate datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER lastname ALTER TABLE customer ADD security_question varchar(96) COLLATE utf8_bin NOT NULL DEFAULT '' AFTER fax ALTER TABLE customer ADD security_answer varchar(96) COLLATE utf8_bin NOT NULL DEFAULT '' AFTER fax ALTER TABLE customer ADD pin_number text COLLATE utf8_bin AFTER password ALTER TABLE customer ADD notes text COLLATE utf8_bin AFTER bank_number ALTER TABLE customer ADD last_active datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER date_added

    Read the article

  • T-SQL: Build Nested Set From Parent-Child Relationship

    - by Peder Rice
    I have a table that stores my Customer hierarchy with a nested set (due to the specific design of the application, I wasn't able to leverage just a Customer/Parent Customer mapping table). To simplify maintenance of this table, I've built a couple of stored procedures to handle moving nodes around and creating new nodes, but it's significantly more work than maintaining a Customer/Parent Customer table. Further, these structures are very fragile. So I'm looking for a way to have a Customer/Parent Customer table and then convert that table to a nested set on demand. Does anyone have a link to such an implementation?

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >