Monday, December 3, 2012

GeoSoft Update:

We received a outsourcing project for SLT, which consists of 6 modules:

* Interview
* Training
* Event Calender
* Inventory Control
* Procurement procedure
* Welfare

Hard work ahead! O.o :-)






Wednesday, October 31, 2012

GeoSoft Update


GeoSoft Update:


We are in the process of completing the POS system and the Inventory Control system requested by "Sisira Motors" (Dambulla branch). We are currently schedule for the 2nd system assessment with the client on next Tuesday.




Friday, October 26, 2012

Our Software page for computer programming students





GeoSoft Update:

GeoSoft Update:

The Inventory Control Software project we've undertaken for Darshana Engineers Pvt Ltd. has completed and installed on Client's location (Darshana Eng branch, Wehara, Kurunegala) about a month ago. The system's Beta testing period is yet ongoing. And we are providing continuous customer care online.



Friday, October 12, 2012

Movies Library for Movies Rental Shop (MS Windows) v1.0 (c) 2012 Kasun Liyanage

Movies Library for Movies Rental Shop (MS Windows) v1.0
(c) 2012 Kasun Liyanage


Download, Extract, and Run "DVDShopNonEDM.exe". Enjoy!

Note: You need .NET framework installed to run it

DOWNLOAD


Tuesday, October 2, 2012

C#: How to upload files using FTP to a remote server and the localhost



Uploading files to localhost


1. Make your computer a FTP server.

  • i use XAMPP to do this.

  

                    OR    


  • In the Xampp control panel, click the check boxes before Apache, MySql, FileZilla and click on the 3 start buttons.
  • Make sure to click "Install" when asked, when you click on the checkbox before FileZilla.
  • Now click on the "Admin" button next to "Stop" button of FileZilla. That will open FileZilla Server control panel.

  • Select Edit > Users to create a new user.
  • Click the "Add" button under "users" and Type a user name and click OK.

  • Type a password in Password field.
  • Then click on "Shared Folders" in "Page" box.
  • Click "Add" button to add the home directory to use as the location to upload files.

  • Select the added path  and click the "Set as home dir" button to make it your home directory.
  • Check all the check boxes Read, Write, Delete etc next to folders list box.

  • Click OK of the Users dialog box and close it.
  • Ok now you have a FTP server with a username and a pass.





2. Write the C# code.


  • Below is the C# code to upload a test.text file as "voot.txt", to the localhost directory. When the code is executed, the "test.txt" file be copied into the localhost home directory as "voot.txt".


            // Get the object used to communicate with the server.
            //<FOR LOCALHOST>
            FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://localhost/voot.txt");
            
            request.Method = WebRequestMethods.Ftp.UploadFile;

            // This example assumes the FTP site uses anonymous logon.

            //<FOR LOCALHOST>
            request.Credentials = new NetworkCredential("kasun", "mypass");

            // Copy the contents of the file to the request stream.
            StreamReader sourceStream = new StreamReader("test.txt");
            byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
            sourceStream.Close();
            request.ContentLength = fileContents.Length;

            Stream requestStream = request.GetRequestStream();
            requestStream.Write(fileContents, 0, fileContents.Length);
            requestStream.Close();

            FtpWebResponse response = (FtpWebResponse)request.GetResponse();

            response.Close();









Uploading files to a Remote-Host


1. Register for a free/non-free web host with FTP. 


  • i have used free hosting site "worlditsme.com" for testing.
  • Get your Host (ftp) address, username, password from the site after registering.
  • Example Host (ftp) address: ftp://yourname.worlditsme.com/
  • User name and password will be the ones that you've used to register the worlditsme.com site.

2. Write the C# code.


Below code will upload "test.txt" file as "voot.txt" to the remote hosts, home folder.

            // Get the object used to communicate with the server.

            //<FOR REMOTE HOST>
            //FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://myusername.worlditsme.com/voo.txt");
            
            request.Method = WebRequestMethods.Ftp.UploadFile;

            // This example assumes the FTP site uses anonymous logon.

            //<FOR REMOTE-HOST>
            //request.Credentials = new NetworkCredential("kasunl", "mypass");

            // Copy the contents of the file to the request stream.
            StreamReader sourceStream = new StreamReader("test.txt");
            byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
            sourceStream.Close();
            request.ContentLength = fileContents.Length;

            Stream requestStream = request.GetRequestStream();
            requestStream.Write(fileContents, 0, fileContents.Length);
            requestStream.Close();

            FtpWebResponse response = (FtpWebResponse)request.GetResponse();

            response.Close();

To check whether the file is uploaded, use a client like FileZilla, or the site's home directory by login in with your ftp host address (insert it into your browser and enter your username and pass when prompted.




That's it.

Thursday, August 9, 2012

My Recent Work

Inventory Control System. Programming Language: C#.
(c) GeoSoft.
      Kasun Liyanage
      geosoft.developers@gmail.com



My Recent Work


POS system for a CD Shop. Programming Language: C#.
(c) Kasun Liyanage


Thursday, July 19, 2012

ඔබේ ව්‍යාපාරය පරිගණක ගත කළ යුත්තේ ඇයි? Why Should You Computerize Your Bussiness?


ඔබේ ව්‍යාපාරය පරිගණක ගත කළ යුත්තේ ඇයි?

  • ඔබේ කෑෂ් රෙජිස්ටරය පරිගණක ගත කිරීමෙන් ලැබෙන වාසිය කුමක්ද?
ඔබේ පැරණි කැෂ් රෙජිස්ටරය සිදු කරන්නේ එක් කාර්ය්‍යකි. එනම්, දිනය අවසානයේ දී වෙළදාම් වලින් කොපමණ මුදල් ප්‍රමාණයක් ඔබට ලැබී ඇත් දැයි එය ඔබට පවසයි. ඔබට රැපියල් 10000ක් ලැබී ඇතැයි එයට කිව හැකි වුවත්, එයින් කොපමණ ප්‍රමාණයක් ඔබේ ලාභය දැයි කීමට එයට බැරිය. දිනය තුළදී කොපමණ ටී-ෂර්ට්ස් (හෝ සිසිල් බීම, නැතිනම් කිරිපිටි පැකට්.. ඕනෑම දෙයක්) ප්‍රමාණයක් විකිණී ඇති දැයි ද, තවත් කොපමණ ප්‍රමාණයක් රාක්කය මත ඇතැයිද කීමට එයට බැරිය. එහෙත් පරිගණක ගත කරන ලද කෑෂ් රෙජිස්ටරයකට ඉහත කියූ සියළු දෙය කළ හැකිය. එයට පසුගිය පැය තුළ, අද දිනය තුළ, මාසය තුළ, හෝ මෙම අවුරැද්ද තුළ ඔබට ලැබුණු මුදල් සහ එයින් ඔබේ ලාභය ද, කිසියම් බඩුවක් විකිණී ඇති ප්‍රමාණය සහ ඉතිරි වී ඇති ප්‍රමාණය පෙන්වා දිය හැකිය. ස්ටොක්ස් අඩු වී තිබෙන්නේ කවර බඩු වලද ඔබ ලගදී මිළ දී ගත්‍ යුත්තේ කවර බඩු දැයි එයට කිව හැකිය.


  • ව්‍යාපාරය පරිගණක ගත කිරීමෙන් අත් වැරදීම් සහ සොරකම් අඩු වෙයි.
මිනිසුන්ට අත් වැරදීම සිදු වේ. ඔබේ ව්‍පාරයේදී සිදුවන මුදල් අත් වැරදීම් මගින් ඔබට පාඩු සිදුවේ. එහෙත් පරිගණක වලට අත් වැරදීම් සිදුවන්නේ නැත. මෙනිසා ව්‍යාපාරය පරිගණක ගත කිරීමෙන් ඔබේ අය වැය වල නිවැරදි භාවය තහවුරැ කර ගත හැකිය.


එමෙන්ම, සිදුවෙන සෑම ගණුදෙනුවක් ම පරිගණකයේ සටහන් වන බව සහ සෑම භාණ්ඩයකම මිල සහ ස්ටොක්ස් ප්‍රමාණයක් පරිගණකයේ වාර්ථා වන බව දන්නා ඔබේ සේවකයින්, පෙරට වඩා ගනු දෙනු ගැන සහ භාණ්ඩ ගැන සැළකිළිමත් වනු ඇත. මන්දයත්, ව්‍යාපාරයේ දී කිසියම් වරදක් සිදුවී ඇත්නම් එය පරිගණකයට හසු වන හෙයිණි.


  • වැඩි ලාභ ලැබෙන භාණ්ඩ සහ අවස්ථා හදුනාගැනීම.
පරිගණකය මගින් ලබා දෙන වාර්ථා මගින්, වාඩාත්ම විකිණී සහ ලාභ ඉපයී ඇත්තේ කවර භාණ්ඩ වලින් දැයි පරිගණකය ඔබට පෙන්වා දෙයි. එවිට එම ඉහළ ලාභයක් ඇති භාණ්ඩ ගෙන්වීම සදහා ඔබට මුල් තැන ලබා දිය හැකිය.


තවද, පරිගණකය මගින් කිසියම් භාණ්ඩයක් වැඩියෙන්ම විකිණෙන කාලය හදුනාගෙන, එම භාණ්ඩය එම කාළය තුළ දී ඔබ ලග හිග නොවන බවට තහවුරැ කර දෙයි.


  • ඔබේ විශ්වාසී සේවාදායකයන් කවුදැයි හදුනා ගැනීම සහ ඔවුන් සමග සම්බන්ධතාව පැවැත්වීම
පරිගණක මගින් ඔබේ සේවාදායකයින් ගේ නම සහ ලිපිනය වැනි දත්ත ලබා ගැනීම මගින් ඔබට ඔබේ සේවාදායකයින් කවුදැයි හදුනා ගත හැක. එමෙන්ම නිරතුරැවම ඔබ සමග ගණුදෙනු කරන සේවා දායකයින් කවුදැයි පරිගණකය ඔබට කියයි. සේවකයින්ගේ විස්තර පරිගණකය දන්නා හෙයින්, ඔබට කිසියම් භාණ්ඩයක් සදහා ප්‍රචාරයක් ලබා දීම වැනි අවස්ථා වලදී ඔබේ සේවාදායකයින්ට ලිපි හෝ ඊ-මේල් යැවිය හැකිය.


ඉහත කියූ ප්‍රධාන පහසුකම් සහ තවත් පහසුකම්, ඔබේ ව්‍යාපාරය පරිගණක ගත කිරීමෙන් ලබා ගත හැකිය. එය කරන්නේ කෙසේද? අප සමග සම්බන්ධ වන්න. අපට ඔබේ ව්‍යාපාරය පරිගණක ගත කළ හැකිය.
--------------------------------------------
අපට ඊමේල් කරන්න: 

E-mail: geekat02@yahoo.com
--------------------------------------------




  • Increase Accuracy : Checkout is more accurate because the price of every item is specified in the program (for example in the Cash Register software). Never again will you have to figure out how much that flashlight sells for.
  • Reduce Theft : Every piece of transactions are being recorded by the Software.
  • Order more Efficiently : With sales reports you can track trends and seasonal sales to order goods to your shop more efficiently.
  • Identify products with high profits : With Sales reports you can recognize and stock products that bring greater profits and products that carry lower profits.
  • Speed customer checkout : With a bar-code scanner and a computerized cash register, you can checkout a customer in half the time required with a  conventional cash register.
  • Keep track of your customers : With customer info you can see who are your faithful and regular customers.



A Computerized Cash Register system replaces your old fashioned cash register. A Cash Register has a single purpose. It tells you how much money your business has taken in during the day. It can tell you that you took in $350, but it can't tell you how much of that money is profit. It can't tell you how much inventory you have on the shelf. It can't tell you how many bottles of soda your business sold today. A computerized cash register can instantly tell you that you have $350 in your cash drawer. It will tell you that $225 of that $350 is profit. It can tell you that you sold 123 bottles of soda today and that you still have 246 bottles on the shelf. It can also tell you what items you should order today because your stock is low. 



By computerizing, you can reduce theft in your business by an average of 2½%. An average small business doing $500,000 per year can reduce in-store theft by an average of $12,500. How? Your employees become more involved in watching the store inventory if they know that every piece of inventory in your business is being monitored. 


By watching your inventory reports, you can make sure that you order more wisely. You don't need 150 snow shovels on the shelf in the summer. 

 

You don't need 150 snow shovels in the summer, but you may need 500 more batteries for your store during the month of August. Many stores order products based on what they think they sell. If you check your inventory reports and see that you sold 500 batteries last August, it gives you a good clue to help make sure that you don't run out of batteries this August. Watching your inventory reports increases your efficiency. 



Watch Your Margins.
 
By reading your reports you may find that you sell 10,000 batteries that cost 48 cents for 50 cents each and that you sell 100 flashlights that cost $1.98 for $9.95 each. Your inventory reports will help you to stock more products that give you greater profits and fewer products that give you the least amount of profit.






Your best customers are your present customers. No matter what type of store you have, you should try to obtain the name and address of every one of your customers. Keeping a customer list is an obvious asset for a clothing store. You want your customers to keep coming back, especially when you have a sale. The importance of keeping a customer list is less obvious in a hardware store, but extremely important. Mailing to your customers periodically keeps them coming back. Your vendors may even help you pay for the cost of the mailing. Mailing to your customers is the best form of advertising - even if it is just a quick postcard listing a few new sale items. Every mailing to your customer list will always be a positive to your cash flow. What about a store such as a convenience store? You don't have to get the name and address of every customer that walks into the store, but you should get the names and addresses of your best customers. 


Tuesday, June 19, 2012

Power failure destroyed my Win7 boot


Ok so a sudden power failure messed up my Win7 boot configuration, preventing me to log in. I select the 'Start-up Repair' option, but before it get to the repairing the harddisk  seemed to stuck in a endless loop doing something. My mind said it could be a disk error, recoverable or otherwise. So i couldn't repair the startup.

But then, as usual, my Linux Ubuntu OS came to the rescue. I switched in to Ubuntu and it said there's a startup problem but not to worry she's fixing it -- like a master. It took a minute an said it fixed it and booted into itself. Now i restarted machine to check Win7, and this time it went directly to the repairing and fixed the boot (took about 10-15 mins to repair) and logged in successfully.

So Linux saved the day, again!

Monday, June 4, 2012

C# Database Programming Start-up Guide. Free E-Book



  So you wanna learn the basics of C# database programming? Then read along this booklet, and you’ll learn how to build your own database programs. In this guide we are going to create a Movies library for a Movies rental shop.  It’ll demonstrate things like: how to iterate and retrieve data from databases and display them on forms, how to add new data into databases, how to search a database, and how to display filtered data from the database etc.








Saturday, February 18, 2012

PHP simple user Registration + Login system


  •  First thing, create a MySQl database with the following structure:














  • You could create this with the Xamp's PhpMyAdmin utility, or running commands at the php console, or by running commands as a php program.
  • I've named the above database as "test", and the table as "bkmark_users".
  • Now, we need following 5 files to create the Registration + Login system:

  1. Login.html: User interface for user registration / login. Includes forms that execute the php codes in CheckLogin.php and Register.php in order to register and login users.
  2. CheckLogin.php: Search the database for the user inputted username and password to log her/him in. Also creates cookies for storing username and pass.
  3. Register.php: Writes the user inputted new username and pass into the database as a new user record.
  4. ProtectedPage.php: This is the page protected by passwords. Firstly it checks whether a user has logged in by checking the cookies. If not, opens the Login page. Also it extracts the username using the cookie to display a message.
  5. Logout.php: Closes the session deleting the cookies, indicating the user have logged out. Then redirects the user to the Login page.

Ok below are the complete file sources:

Login.html

<html>
<head>
<title>My Website - Login</title>
</head>
<body bgcolor="#FFFFCC">
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<table style="margin:15px auto;" align="center">
<tr>
<td colspan="3"><h2>Login:</h2></td>
</tr>
<tr>
<form action="CheckLogin.php" method="post">
<td>Username:</td>
<td><input type="text" name="username"/></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password"/></td>
</tr>
<tr>
<td></td>
<td align="right"><input type="submit" name="Submit" value="Login"/></td>
</form>
</tr>
</table>
<table style="margin:15px auto;" align="center">
<tr>
<td colspan="3"><h2>Register:</h2></td>
</tr>
<tr>
<form action="Register.php" method="post">
<td>New username:</td>
<td><input type="text" name="newusername"/></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="newpassword"/></td>
</tr>
<tr>
<td></td>
<td align="right"><input type="submit" name="Submit" value="Register"/></td>
</form>
</tr>
</table>
</html>


CheckLogin.html

<?php
session_start();
$username = $_POST["username"]; // This is the inputted username from the form in Login.html
$password = $_POST["password"]; // This is the inputted password from the form in Login.html

mysql_connect('localhost');
mysql_select_db('test') or die('Could not select database');

$result = mysql_query("SELECT username, password FROM bkmark_users"); // Get data from username and password fields

$hituser=false;
$hitpass=false;
// Sarch username in the database
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
if($row[0] == $username){ // If found, open ProtectedPage.php. Else goto Login.html
$hituser=true;
if($row[1] == $password){
$hitpass=true;
echo "USER FOUND!";
$_SESSION["username"] = $username; // Creates a cookie saving the username
$_SESSION["loggedIn"] = true; // Creates a cookie saying the user is logged in
header("Location:ProtectedPage.php");
}else {
}
}else{
// header("Location:Login.html"); // Lastly, redirect back to login page
}
}
if($hitpass==false){
echo "PASSWORD INCORRECT!<br>";
}
if($hituser==false){
echo "USER NOT FOUND!<br>";
}
?>


Register.html

<?php
session_start();
$newusername = $_POST["newusername"]; // This is the inputted username from the form in Login.html
$newpassword = $_POST["newpassword"]; // This is the inputted password from the form in Login.html

mysql_connect('localhost'); // *** INSERT YOUR DATABSE INFORMATION HERE ***
mysql_select_db('test') or die('Could not select database');

mysql_query("INSERT INTO bkmark_users(username, password) VALUES('" . mysql_real_escape_string($newusername) . "','" . mysql_real_escape_string(
$newpassword) . "')")or die('Could not insert data into db');
echo "New user created:<br>";
echo $newusername."<br>";
echo $newpassword."<br>";
echo "<a href='Logout.php'>Logout</a>";
?>


ProtectedPage.html

<?
session_start();
if(!$_SESSION['loggedIn']) // If the user IS NOT logged in (the loggedIn cookie is created), forward them back to the login page
{
header("location:Login.html");
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>My Website - Protected Content</title>
</head>
<body bgcolor="#FFFFCC">
<?php

// If the user IS logged in, then echo the page contents:
$currentUser = $_SESSION['username']; // Gets the username from the cookie we created in Check.php
$message = '<p>Welcome, ' . ucfirst($currentUser) . '!</p>'; // This compiles hello (your username)
echo $message; // This echo's (actually outputs) the message
?>
<p>Good job! You got it working!!</p>
<a href="Logout.php">Logout</a>
</body>
</html>


Logout.html

<?php
session_start();
session_destroy();
header("Location:Login.html");
?>


Create these files inside the same folder and run the Login.html file. Enjoy!

Wednesday, February 15, 2012

PHP and MySql. How to connect to a database, Create a table, and add data




Below code will,


1. Make a sql connection to localhost (display error if something goes wrong).
2. Select the database "test" as the working db.
3. Create a table named example2 inside the "test" db.
4. Set the member variables and their data types in the table.
5. Insert 3 rows of data into the table.
6. Retrieve back the data from the table as a resource ($result).
7. Use the resource to print out the contents inside the table, with a while loop.


=============================================================

// 1. Make a MySQL Connection
mysql_connect("localhost") or die(mysql_error());


// 2.
mysql_select_db("test") or die(mysql_error());


// 3. Create a MySQL table in the selected database
mysql_query("CREATE TABLE example2(
id INT NOT NULL AUTO_INCREMENT, 
PRIMARY KEY(id),
 name VARCHAR(30), 
 age INT)")
 or die(mysql_error());


// 5. Insert rows of information into the table "example2"
mysql_query("INSERT INTO example2 
(name, age) VALUES('Timmy Mellowman', '23' ) ") 
or die(mysql_error());  


mysql_query("INSERT INTO example2 
(name, age) VALUES('Sandy Smith', '21' ) ") 
or die(mysql_error());  


mysql_query("INSERT INTO example2 
(name, age) VALUES('Bobby Wallace', '15' ) ") 
or die(mysql_error());  


// 6. Retrieve all the data from the "example2" table
$result = mysql_query("SELECT * FROM example2")
or die(mysql_error()); 
 
// 7. store the record of the "example2" table into $row
// Print out the contents of the entry 
while($row = mysql_fetch_array($result)){
echo $row['name']. " - ". $row['age'];
echo "
";

}


?>
=============================================================


(( SQL help ))


SQL CREATE TABLE Syntax


CREATE TABLE table_name
(
column_name1 data_type,
column_name2 data_type,
column_name3 data_type,
....
)



SQL INSERT INTO Syntax


INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...)

SELECT * Example


The SELECT statement is used to select data from a database.

The result is stored in a result table, called the result-set.

The asterisk (*) is a quick way of selecting all columns! 

The mysql_query() function 
Executes a query on a MySQL database. 

The mysql_fetch_array() function
Returns a row from a recordset  





https://www.youtube.com/channel/UC6OIDpOAFf4sY3LcydDI5zw?view_as=subscriber