working on it ...

Filters

Explore Public Snippets

Sort by

Found 7,143 snippets matching: customer

    public by bojan.hrnkas  225145  0  7  0

    Serializing a C# object to XML

    We use a simplified object WSCustomer, since we only want some members of Customer to get serialized.
    public string GetCustomerData(int customers_Id)
    {
        Customer customers = IoC.Resolve<ICustomerService>().GetCustomerById(customers_Id);
        WSCustomer wsCustomer = WSMapping(customers);
        StringBuilder sb = new StringBuilder();
        using (TextWriter tw = new StringWriter(sb))
        {
            XmlSerializer xmlS = new XmlSerializer(typeof(WSCustomer));
            xmlS.Serialize(tw, wsCustomer);
            string serialized = sb.ToString();
            return serialized;
        }
    }
    
    

    public by p.kontalis  99036  2  5  0

    VTiger Extraction Customers' Data by City

    Extract from Vtiger Customers' List with address and to whom they have been assigned
    SET @city = '[CITY NAME]'; #Replace [CITY NAME] with your preferable city name
    SET @db_name='[DATABASE NAME]'; #Replace [DATABASE NAME] with your database name
    SET @myquery = CONCAT('
    SELECT	', @db_name, '.vtiger_account.accountid AS \'Company Code\',
    		', @db_name, '.vtiger_account.accountname AS \'Company\', 
    		', @db_name, '.vtiger_account.phone AS \'Phone 1\', 
    		', @db_name, '.vtiger_account.otherphone AS \'Phone 2\', 
    		', @db_name, '.vtiger_account.email1 AS \'Email 1\', 
    		', @db_name, '.vtiger_account.email2 AS \'Email 2\', 
    		', @db_name, '.vtiger_account.website AS \'Website\', 
    		', @db_name, '.vtiger_account.fax AS \'Fax\',
    		', @db_name, '.vtiger_accountbillads.bill_city AS \'City\',
    		', @db_name, '.vtiger_accountbillads.bill_code AS \'TK\',
    		', @db_name, '.vtiger_accountbillads.bill_country AS \'Country\',
    		', @db_name, '.vtiger_accountbillads.bill_state AS \'State\',
    		', @db_name, '.vtiger_accountbillads.bill_street AS \'Street\',
    		', @db_name, '.vtiger_accountbillads.bill_pobox AS \'TK\', 
    		', @db_name, '.vtiger_users.last_name AS \'Αssignment το\'
    FROM ', @db_name, '.vtiger_account
    INNER JOIN ', @db_name, '.vtiger_accountbillads 
    ON ', @db_name, '.vtiger_account.accountid = ', @db_name, '.vtiger_accountbillads.accountaddressid
    INNER JOIN ', @db_name, '.vtiger_crmentity
    ON ', @db_name, '.vtiger_account.accountid = ', @db_name, '.vtiger_crmentity.crmid	
    LEFT JOIN ', @db_name, '.vtiger_users
    ON ', @db_name, '.vtiger_crmentity.smownerid = ', @db_name, '.vtiger_users.id
    WHERE ', @db_name, '.vtiger_accountbillads.bill_city=@city
    AND ', @db_name, '.vtiger_crmentity.setype=\'Accounts\' 
    ');
    PREPARE stmt FROM @myquery;
    EXECUTE stmt;
    DEALLOCATE PREPARE stmt;
                
    

    public by alien  1597  1  4  0

    create stripe customer

    StripeConfiguration.SetApiKey("sk_test_ ");
    
    
              var myCustomer = new StripeCustomerCreateOptions();
    
              // set these properties if it makes you happy
              myCustomer.Email = "pork@email.com";
              myCustomer.Description = "Johnny Tenderloin (pork@email.com)";
    
              // setting up the card
              myCustomer.Source = new StripeSourceOptions()
              {
                  // set this property if using a token
    
    
                  // set these properties if passing full card details (do not
                  // set these properties if you set TokenId)
                  Number = "4242424242424242",
                  ExpirationYear = "2022",
                  ExpirationMonth = "10",
                  AddressCountry = "US",                // optional
                  AddressLine1 = "24 Beef Flank St",    // optional
                  AddressLine2 = "Apt 24",              // optional
                  AddressCity = "Biggie Smalls",        // optional
                  AddressState = "NC",                  // optional
                  AddressZip = "27617",                 // optional
                  Name = "Joe Meatballs",               // optional
                  Cvc = "1223"                          // optional
                  ,
                  Object = "card"
              };
    
    
    
              var customerService = new StripeCustomerService("sk_test_zS9GkWXcxkIf7luArJtX9zsj");
              StripeCustomer stripeCustomer = customerService.Create(myCustomer);
    
              Console.WriteLine(stripeCustomer.Id);
    
    

    public by simonwalker  812  7  5  0

    Magento Customer Registration Attributes Extension by FME

    Magento Customer Registration attributes extension by FME allows you to add customer attribute to user registration form & account pages. You can hide the custom attributes and restrict them by creating different customer attributes. Using this Magento add customer attribute extension, you can make the custom registration form attributes mandatory
    // https://www.fmeextensions.com/magento-additional-registration-attributes-fields.html            

    public by simonwalker  100  0  3  0

    Magento 2 Customer Attributes Extension | FME

    Pursue a user experience design of the sign-up form by adding easy to answer attributes using Magento 2 Customer Attributes Extension. This extension empowers you to put 10 types of attributes on a registration form to intake data from users.Now the next thing is that you can apply validation on custom attributes to avoid errors while entering data
    // Enter here the actual content of the snippet.						

    public by cghersi  4768  1  6  1

    Remove Duplicate rows in SQL Server

    This script removes the duplicate rows in table Customers detecting the rows with the same contactname
    SET NOCOUNT ON
    SET ROWCOUNT 1
    WHILE 1 = 1
      BEGIN
        DELETE  
        FROM Customers
        WHERE contactname IN
            (SELECT  contactname
             FROM    Customers
             GROUP BY contactname
             HAVING  COUNT(*) > 1)
          
        IF @@Rowcount = 0
          BREAK ;
     END
     SET ROWCOUNT 0          

    public by paulsimmons  292  21  3  1

    WooCommerce Checkout Plugin by FMEAddons

    You can crate extra options on checkout form by using WooCommerce checkout plugin by FMEAddons. This addon lets you add the various fields which are text area, radio and check boxes, file/image select, multi-select, date & time, password, input and select box personalize the checkout form. With this addon, you can get extra information on checkout
    cpp
    <a href="https://www.fmeaddons.com/woocommerce-plugins-extensions/additional-checkout-fields.html">https://www.fmeaddons.com/woocommerce-plugins-extensions/additional-checkout-fields.html<a>                        

    public by angelialesnar  2267  0  6  0

    Microsoft Outlook Help | 1-844-815-2122

    Outlook Customer Service is here to resolve some Outlook issues which you may be influenced with i.e. Outlook Password Issues, Sign in issues, Outlook Sync issues, sending and Receiving Messages issues, Spam Mail issues Every Issues like this can be promptly managed by the experts of our team. Our tech representatives are extremely qualified and h
    1. Click on Start catch and afterward sort Microsoft OutloOK in the hunt box. 
    
    2. An OutloOK window will show up, go to €Tool€-> Account Settings€¦. 
    
    3. Click on €add another email account€ radio catch, then tap on €Next€ catch. 
    
    4. Select second one alternative €POP3€ radio catch for server sort. Click on €Next€ 
    
    5. You need to enter your data in the following Internet E-mail Settings (POP3) window. 
    
    6. Click on €More Settings€ catch. 
    
    7. Another window will open, click on €Outgoing Server€ tab 
    
    8. Select checkbox of €My Outgoing Server (SMTP) requires authentication€. 
    
    9. Click on €Advanced€ tab. To change the port number of €Outgoing Server (SMTP)€, use port number 80 or 3535. 
    
    10. Click on €OK€ catch and afterward on €Next€. 
    
    11. At last, tap on €Finish€ tab to spare the settings. 
    

    public by JonahM  1732  2  5  0

    C++ Insurance ~ Structs

    This is a project we use for college - it is where we create an console program which has many prompts for the customer and will print to file and use files for storing the customer information.
    #include <iostream> 
    //#include <string>
    #include <h:\Code\C++\input2010.h>
    #define TXTFILE "h:/file.txt"
    
    
    using namespace std;
    
    
    struct customer{
    	int custNo;
    	int opNo, age, engine, noClaims;
    	char area, name[21], sold;									//Sold Y or N
    	double bPremium, aPremium;//bPrem is total before discount. aPrem is total after discount.
    };
    
    
    //void inputCustomerDetails(string &name,int &age,double base,double &extras)
    void inputCustomerDetails(customer &cust, double base, double extras)
    {	
    	cout << "Enter your name: \n";
    	Input(cust.name,20);
    	cout << "Enter your age: \n";
    	Input(cust.age);
    	if(cust.age < 25)	
    		extras += (.75*base);
    	if ( cust.age > 50 )
    		extras += (.05*base);
    }
    
    //void inputAreaDetails(char &area,double base,double &extras)
    void inputAreaDetails(customer &cust, double base, double &extras)
    {
    	cout << "Please enter a Area (A,B or C): \n";
    	Input(cust.area);
    
    	while (cust.area !='A' && cust.area !='B' && cust.area !='C')
    	{
    		cout << "Please enter a correct Area (A,B or C): \n";
    		Input(cust.area);
    	}
    
    
    	if (cust.area == 'A')
    		extras += 0.01*base;
    
    	if (cust.area == 'B')
    		extras += .02*base;	
    
    	if (cust.area == 'C')
    		extras += (.03*base);	
    }
    //void inputCarDetails(int &engineSize,double base,double &extras)
    void inputCarDetails(customer &cust,double base,double &extras)
    {
    	cout << "Enter your engine size in CC: \n";
    	Input(cust.engine);
    
    	if(cust.engine >= 1300 && cust.engine <= 1500)
    		extras += (.03*base); 
    
    	if (cust.engine > 1500)
    		extras += (.04*base);
    
    }
    void calculateNoClaims(customer &cust)
    {	
    	cout << "Enter the amount of year without claims bonus:\n";
    	Input(cust.noClaims);
    }
    
    //void calculatePayable( double base,double &extras,double &totalPremium,double &totalPayable,int &noClaims,double &gt)
    void calculatePayable(customer &cust, double base,double &extras)
    {
    	cust.bPremium = base+extras;
    	cust.aPremium = cust.bPremium-(cust.noClaims*.10*cust.bPremium);
    	cout << cust.aPremium << endl;
    	cout << "The extras we pay you is: \n"<<cust.aPremium << endl;
    	//cust.gt += cust.aPremium;
    }
    
    void readFile(customer cust[], int &rows)
    {
    	ifstream myfile(TXTFILE,ios::binary);
    	if(!myfile.is_open())
    		cout << "Unable to open file: " << TXTFILE << endl;
    	else
    	{
    		while ( !myfile.eof())
    		{
    			myfile.read((char *)&cust[rows], sizeof(cust));
    			rows++;
    		}
    		rows--;
    		myfile.close();
    	}
    }
    
    void writeFile( customer cust[], int rows)
    {  	
    	int w=0;
    	ofstream myfile(TXTFILE,ios::binary);
    	if (myfile.is_open())
    	{
    		while ( w < rows )
    		{			
    			myfile.write((char *)&cust[w], sizeof(cust));			
    			
    		}
    		w++;
    		myfile.close();
    		cout << "Data written to " << TXTFILE << "\n";
    	}
    	else 
    	  cout << "Unable to open file: " << TXTFILE << endl;  
    }
    void showArray(customer cust[], int rows)
    {
    	int sub=0;
    	while ( sub < rows )
    	{
    		cout
    			<< cust[sub].opNo << " "			//*
    			<< cust[sub].name << " "	
    			<< cust[sub].age << " "
    			<< cust[sub].engine << " "		
    			<< cust[sub].area << " "		
    			<< cust[sub].sold << " "		//*
    			<< cust[sub].aPremium << " "		
    			<< cust[sub].bPremium << endl;
    		sub++;
    	}
    }
    
    
    
    
    void readFile(customer cust[], int &rows);
    void writeFile ( customer cust[], int rows);
    void showArray( customer cust[], int rows);
    
    void main()
    {
    	
    
    	customer cust[99];
    	int rows = 0;
    	double extras = 0;
    	double base = 100;
    	char close;
    	close = ' ';
    	int opNo = 0;
    	double gt[4] = {0,0,0,0};
    	char quoteQuestion = ' ';
    	double sold[4] = {0,0,0,0};
    	double notSold[4] = {0,0,0,0};
    
    	readFile(cust,rows);
    	cout<<"Please enter your operator number..." << opNo << endl;
    	Input(opNo);
    
    	while (opNo !=0){
    		cout<<"Do you want to calculate another insurance program? Y/N "<<endl;
    		Input(close);
    		cout<< close<<endl;
    
    		while (close == 'Y')
    		{
    			cust[rows].opNo = opNo;
    			system("CLS");
    			inputCustomerDetails(cust[rows], base, extras);
    			inputAreaDetails(cust[rows], base, extras);
    			inputCarDetails( cust[rows], base, extras);
    			calculateNoClaims(cust[rows]);
    			calculatePayable(cust[rows],base, extras);
    			gt[opNo] += cust[rows].aPremium;//Adding the gt to the OpNo
    			cout<< "Do you want to sell this quote?" << endl;
    			Input(quoteQuestion);
    			
    			cust[rows].sold = quoteQuestion;
    			if (quoteQuestion  == 'Y' || quoteQuestion  == 'y'){
    				sold[opNo] += cust[rows].aPremium;
    			}
    			if (quoteQuestion  == 'N' || quoteQuestion  == 'n'){
    				notSold[opNo] += cust[rows].aPremium;
    			}
    			cout<<"Do you want to calculate another insurance program? Y/N "<<endl;
    			Input(close);		
    			rows++;
    		}
    		break;
    	}
    	showArray(cust, rows);
    
    	cout << endl << endl;
    	cout << "Total Sold for Operator 1: " << sold[1] << endl;//Displaying the amount sold
    	cout << "Total Sold for Operator 2: " << sold[2] << endl;
    	cout << "Total Sold for Operator 3: " << sold[3] << endl << endl;
    	cout << "  Not Sold for Operator 1: " << notSold[1] << endl;//Displaying the amount not sold
    	cout << "  Not Sold for Operator 2: " << notSold[2] << endl;
    	cout << "  Not Sold for Operator 3: " << notSold[3] << endl << endl;
    	cout <<"The GTotal for Operator 1: " << gt[1] <<endl;//Displaying the grand total for each Operator.
    	cout <<"The GTotal for Operator 2: " << gt[2] <<endl;
    	cout <<"The GTotal for Operator 3: " << gt[3] <<endl;
    	
    	writeFile(cust, rows);
    
    	system("pause");
    		
    }
    
    
    
    

    public by paulsimmons  944  7  4  0

    WooCommerce Bookings and Appointment Plugin

    WooCommerce Bookings and Appointment plugin by FMEAddons gives the ability to business owners to sell products and services that require bookings and timed appointments. These products and services involve tickets selling, bookings for concerts, appointments, rentals services, secure a seat online, space in training, book products and much more lik
    // Enter here the actual content of the snippet.            
    • Public Snippets
    • Channels Snippets