Projects

ASP.NET PROJECTS
Note: All the projects are incomplete

EMPLOYEE DESK
Technology : ASP.Net C#, ADO.NET  
Front End : Microsoft Visual Studio 2013
Back End : Microsoft SQL Server 2014
























DOWNLOAD THIS PROJECT CLICK HERE TO GET THIS... 




HRM STUDIO (Human Resource Management Studio)
Technology : ASP.Net C#, ADO.NET  
Front End : Microsoft Visual Studio 2013
Back End : Microsoft SQL Server 2014




















 N.A.



                       N.A.


DOWNLOAD THIS PROJECT CLICK HERE TO GET THIS... 


LIBRA LIBRARY 
Technology : ASP.Net C#, ADO.NET  
Front End : Microsoft Visual Studio 2013
Back End : Microsoft SQL Server 2014




















 N.A.



                       N.A.


DOWNLOAD THIS PROJECT CLICK HERE TO GET THIS... 




------------------------------------------------------------------------------------------------------------------------

Windows form Application simple




using System;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;

namespace WinFormCRUD
{
    public partial class FormEmployee : Form
    {
        string conString = "Data Source=DESKTOP-PCF0TIB\\LOCALSERVER;Initial Catalog=WinformDatabase;Integrated Security=True";
        
        SqlConnection sqlCon;
        SqlCommand sqlCmd;
        string EmployeeId = "";

        public FormEmployee()
        {
            InitializeComponent();
            sqlCon = new SqlConnection(conString);
            sqlCon.Open();
        }

        private void FormEmployee_Load(object sender, EventArgs e)
        {
            dgvEmp.AutoGenerateColumns = false; // dgvEmp is DataGridView name
            dgvEmp.DataSource = FetchEmpDetails();
        }

        private DataTable FetchEmpDetails()
        {
            if (sqlCon.State == ConnectionState.Closed)
            {
                sqlCon.Open();
            }
            DataTable dtData = new DataTable();            
            sqlCmd = new SqlCommand("spEmployee", sqlCon);
            sqlCmd.CommandType = CommandType.StoredProcedure;
            sqlCmd.Parameters.AddWithValue("@ActionType", "FetchData");
            SqlDataAdapter sqlSda = new SqlDataAdapter(sqlCmd);
            sqlSda.Fill(dtData);
            return dtData;
        }

        private DataTable FetchEmpRecords(string empId)
        {
            if (sqlCon.State == ConnectionState.Closed)
            {
                sqlCon.Open();
            }
            DataTable dtData = new DataTable();
            sqlCmd = new SqlCommand("spEmployee", sqlCon);
            sqlCmd.CommandType = CommandType.StoredProcedure;
            sqlCmd.Parameters.AddWithValue("@ActionType", "FetchRecord");
            sqlCmd.Parameters.AddWithValue("@EmployeeId", empId);
            SqlDataAdapter sqlSda = new SqlDataAdapter(sqlCmd);
            sqlSda.Fill(dtData);
            return dtData;
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textBoxEmp.Text))
            {
                MessageBox.Show("Enter Employee Name !!!");
                textBoxEmp.Select();
            }
            else if (string.IsNullOrWhiteSpace(textBoxCity.Text))
            {
                MessageBox.Show("Enter Current City !!!");
                textBoxCity.Select();
            }
            else if (string.IsNullOrWhiteSpace(textBoxDept.Text))
            {
                MessageBox.Show("Enter Department !!!");
                textBoxDept.Select();
            }
            else if (comboBoxGen.SelectedIndex <= -1)
            {
                MessageBox.Show("Select Gender !!!");
                comboBoxGen.Select();
            }
            else
            {
                try
                {                    
                    if (sqlCon.State == ConnectionState.Closed)
                    {
                        sqlCon.Open();
                    }
                    DataTable dtData = new DataTable();
                    sqlCmd = new SqlCommand("spEmployee", sqlCon);
                    sqlCmd.CommandType = CommandType.StoredProcedure;
                    sqlCmd.Parameters.AddWithValue("@ActionType", "SaveData");
                    sqlCmd.Parameters.AddWithValue("@EmployeeId", EmployeeId);
                    sqlCmd.Parameters.AddWithValue("@Name", textBoxEmp.Text);
                    sqlCmd.Parameters.AddWithValue("@City", textBoxCity.Text);
                    sqlCmd.Parameters.AddWithValue("@Department", textBoxDept.Text);
                    sqlCmd.Parameters.AddWithValue("@Gender", comboBoxGen.Text);
                    int numRes = sqlCmd.ExecuteNonQuery();
                    if (numRes > 0)
                    {
                        MessageBox.Show("Record Saved Successfully !!!");
                        ClearAllData();
                    }
                    else
                        MessageBox.Show("Please Try Again !!!");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error:- " + ex.Message);
                }
            }
        }

        private void btnClear_Click(object sender, EventArgs e)
        {
            ClearAllData();
        }

        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(EmployeeId))
            {
                try
                {
                    if (sqlCon.State == ConnectionState.Closed)
                    {
                        sqlCon.Open();
                    }
                    DataTable dtData = new DataTable();
                    sqlCmd = new SqlCommand("spEmployee", sqlCon);
                    sqlCmd.CommandType = CommandType.StoredProcedure;
                    sqlCmd.Parameters.AddWithValue("@ActionType", "DeleteData");
                    sqlCmd.Parameters.AddWithValue("@EmployeeId", EmployeeId);
                    int numRes = sqlCmd.ExecuteNonQuery();
                    if (numRes > 0)
                    {
                        MessageBox.Show("Record Deleted Successfully !!!");
                        ClearAllData();
                    }
                    else
                    {
                        MessageBox.Show("Please Try Again !!!");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error:- " + ex.Message);
                }
            }
            else
            {
                MessageBox.Show("Please Select A Record !!!");
            }
        }

        private void dgvEmp_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                btnSave.Text = "Update";
                EmployeeId = dgvEmp.Rows[e.RowIndex].Cells[0].Value.ToString();
                DataTable dtData = FetchEmpRecords(EmployeeId);
                if (dtData.Rows.Count > 0)
                {
                    EmployeeId = dtData.Rows[0][0].ToString();
                    textBoxEmp.Text = dtData.Rows[0][1].ToString();
                    textBoxCity.Text = dtData.Rows[0][2].ToString();
                    textBoxDept.Text = dtData.Rows[0][3].ToString();
                    comboBoxGen.Text = dtData.Rows[0][4].ToString();
                }
                else
                {
                    ClearAllData(); // For clear all control and refresh DataGridView data.
                }
            }
        }

        private void ClearAllData()
        {
            btnSave.Text = "Save";
            textBoxEmp.Text = "";
            textBoxCity.Text = "";
            textBoxDept.Text = "";
            comboBoxGen.SelectedIndex = -1;
            EmployeeId = "";
            dgvEmp.AutoGenerateColumns = false;
            dgvEmp.DataSource = FetchEmpDetails();
        }
    }
}

DOWNLOAD THIS PROJECT CLICK HERE TO GET THIS... 


----------------------------------------------------------------------------------------------------------------------------

SAURASHTRA GRAMIN BANK WINDOWS PROJECT




DOWNLOAD THIS PROJECT CLICK HERE TO GET THIS... 

----------------------------------------------------------------------------------------------------------------------------



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Configuration;
namespace Students_Desk
{
    public partial class frmStudents : Form
    {
        string CS = ConfigurationManager.ConnectionStrings["StudentDB"].ConnectionString;
        SqlConnection conn;
        SqlCommand cmd;
        SqlDataAdapter da;
        SqlDataReader rdr;
        public frmStudents()
        {
            InitializeComponent();
        }
        private void frmStudents_Load(object sender, EventArgs e)
        {
            conn = new SqlConnection(CS);
            conn.Open();
            DataTable dt = new DataTable();
            da = new SqlDataAdapter("select * from tblInformation ", conn);
            da.Fill(dt);
            dataGridView1.DataSource = dt;
        }
        private void btnInsert_Click(object sender, EventArgs e)
        {
            if (txtName.Text == string.Empty || txtAge.Text == string.Empty || txtGender.Text == string.Empty || txtCity.Text == string.Empty)
            {
                MessageBox.Show("Data fields cannot be blank!""info"MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
            }
            else
            {
                try
                {
                    conn = new SqlConnection(CS);
                    conn.Open();
                    cmd = new SqlCommand("Insert into tblInformation values(@Name, @Age, @Gender, @City)", conn);
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.AddWithValue("@Name", txtName.Text);
                    cmd.Parameters.AddWithValue("@Age", txtAge.Text);
                    cmd.Parameters.AddWithValue("@Gender", txtGender.Text);
                    cmd.Parameters.AddWithValue("@City", txtCity.Text);
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("Data saved Successfully!""info"MessageBoxButtons.OK,MessageBoxIcon.Information);
                    DataTable dt = new DataTable();
                    da = new SqlDataAdapter("select * from tblInformation ", conn);
                    da.Fill(dt);
                    dataGridView1.DataSource = dt;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
        private void btnCancel_Click(object sender, EventArgs e)
        {
            ClearFields();
        }
        private void ClearFields()
        {
            txtAge.Clear();
            txtName.Clear();
            txtCity.Clear();
            txtGender.Clear();
            txtSearch.Clear();
        }
        private void btnExit_Click(object sender, EventArgs e)
        {
            DialogResult d = MessageBox.Show("Do you want to close Application? ""Inform"MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
            if (d == DialogResult.Yes)
            {
                Application.Exit();
            }
        }
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (txtSearch.Text == string.Empty)
            {
                MessageBox.Show("Please enter the ID to be updated!""info"MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                try
                {
                    conn = new SqlConnection(CS);
                    conn.Open();
                    cmd = new SqlCommand("Update tblInformation set Name=@Name, Age=@Age, Gender=@Gender, City=@City where ID='" + txtSearch.Text + "'", conn);
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.AddWithValue("@Name", txtName.Text);
                    cmd.Parameters.AddWithValue("@Age", txtAge.Text);
                    cmd.Parameters.AddWithValue("@Gender", txtGender.Text);
                    cmd.Parameters.AddWithValue("@City", txtCity.Text);
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("Data Updated successfully!""info"MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ClearFields();
                    DataTable dt = new DataTable();
                    da = new SqlDataAdapter("select * from tblInformation ", conn);
                    da.Fill(dt);
                    dataGridView1.DataSource = dt;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
        private void btnSearch_Click(object sender, EventArgs e)
        {
            conn = new SqlConnection(CS);
            conn.Open();
            if (txtSearch.Text == string.Empty)
            {
                MessageBox.Show("Please enter the ID to search!""info"MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                cmd = new SqlCommand("select * from tblInformation where ID ='"+txtSearch.Text+"' ", conn);
                rdr = cmd.ExecuteReader();
                if (rdr.HasRows)
                {
                    while (rdr.Read())
                    {
                        txtName.Text = rdr[1].ToString();
                        txtAge.Text = rdr[2].ToString();
                        txtGender.Text = rdr[3].ToString();
                        txtCity.Text = rdr[4].ToString();
                    }
                }
                else
                {
                    MessageBox.Show("User ID doesn't exist!""info"MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
        private void btnDelete_Click(object sender, EventArgs e)
        {
            conn = new SqlConnection(CS);
            conn.Open();
            if (txtSearch.Text == string.Empty)
            {
                MessageBox.Show("Please enter the ID to be deleted!""info"MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                try
                {
                    DialogResult d = MessageBox.Show("Do you want to Delete User having ID " + txtSearch.Text, "Inform"MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (d == DialogResult.Yes)
                    {
                        cmd = new SqlCommand("delete from tblInformation where ID='" + txtSearch.Text + "'", conn);
                        cmd.CommandType = CommandType.Text;
                        cmd.ExecuteNonQuery();
                        MessageBox.Show("Record deleted successfully! ""Delete"MessageBoxButtons.OK, MessageBoxIcon.Information);
                        ClearFields();
                        DataTable dt = new DataTable();
                        da = new SqlDataAdapter("select * from tblInformation ", conn);
                        da.Fill(dt);
                        dataGridView1.DataSource = dt;
                    }
                    else
                    {
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                
                }
            }
        }
    }
}
----------------------------------------------------------------------------------------------------------------------------




DOWNLOAD THIS PROJECT SYNOPSIS CLICK HERE TO GET THIS... 
---------------------------------------------------------------------------------------------------------------------------ASP.NET MVC 5 BASIC CRUD OPERATION PROJECT WITH DATA FIRST APPROCH & ENTITY FRAMEWORK

DOWNLOAD THIS PROJECT SYNOPSIS CLICK HERE TO GET THIS...





1 comment: