Friday, July 9, 2010

fnlcss

body
{
PADDING-RIGHT: 10px;
PADDING-LEFT: 10px;
padding-top :10px;

FONT-SIZE: 11px;
PADDING-BOTTOM: 10px;
MARGIN: 2px 5px 0px;

COLOR: Black;
/*SCROLLBAR-3DLIGHT-COLOR: #fff0c1;
SCROLLBAR-ARROW-COLOR: white;
SCROLLBAR-HIGHLIGHT-COLOR: #dbdac4;
SCROLLBAR-FACE-COLOR: #dbdac4;*/

/*#c1dad0*/

FONT-FAMILY: Verdana;
BACKGROUND-COLOR: #EFDAF2;
}
.Txtb
{

background-color:Gray;
font-style:italic;
font-family:Verdana;
font-size:medium;
color : White;

}
.Err
{
/*font-weight: bold;
font-size: 11px;
color: red;
font-family: Tahoma,Verdana;
background-color: transparent;*/
}

fnlc

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Text.RegularExpressions;
using System.Text;
using System.Globalization;
using System.Data.Sql;
using System.Data.SqlClient;




public partial class Empform : System.Web.UI.Page
{
int output;
DataSet ds = new DataSet();
SqlConnection con;
//Here we declare the parameter which we have to use in our application
SqlCommand cmd = new SqlCommand();
SqlParameter sp1 = new SqlParameter();
SqlParameter sp2 = new SqlParameter();
SqlParameter sp3 = new SqlParameter();
SqlParameter sp4 = new SqlParameter();
SqlParameter sp5 = new SqlParameter();
SqlParameter sp6 = new SqlParameter();
SqlParameter sp7 = new SqlParameter();
SqlParameter sp8 = new SqlParameter();
SqlParameter sp9 = new SqlParameter();
SqlParameter op = new SqlParameter();



protected void button_submit_Click(object sender, EventArgs e)
{
con = new SqlConnection("server=10.4.141.46 ; database = HRSS; uid = hrss ; pwd= hrss01");
cmd = new SqlCommand("Emp_info_Insert", con);
cmd.CommandType = CommandType.StoredProcedure;

sp1 = cmd.Parameters.Add("@emp_no", SqlDbType.VarChar, 10);
sp1.Direction = ParameterDirection.Output;

sp2 = cmd.Parameters.Add("@emp_name", SqlDbType.VarChar, 12);
sp2.Value = txt_emp_name.Text;
sp3 = cmd.Parameters.Add("@dob", SqlDbType.DateTime);
sp3.Value = txt_dob.Text;
sp4 = cmd.Parameters.Add("@email_id", SqlDbType.VarChar, 20);
sp4.Value = txt_email_id.Text;
sp5 = cmd.Parameters.Add("@date_joining", SqlDbType.DateTime);
sp5.Value = txt_date_of_joining.Text;
sp6 = cmd.Parameters.Add("@contact_no", SqlDbType.VarChar, 12);
sp6.Value = txt_contact_no.Text;
sp7 = cmd.Parameters.Add("@address", SqlDbType.VarChar, 30);
sp7.Value = txt_address.Text;
sp8 = cmd.Parameters.Add("@gender", SqlDbType.VarChar, 30);
sp8.Value = radio_gender.SelectedValue;
sp9 = cmd.Parameters.Add("@department", SqlDbType.VarChar, 30);
sp9.Value = dropdown_dept.SelectedValue;



con.Open();
cmd.ExecuteNonQuery();
con.Close();
label_insert.Visible = true;
txt_emp_no_asgnd.Visible = true;
txt_emp_no_asgnd.Text = cmd.Parameters["@emp_no"].Value.ToString();
Txt_Emp_no.Text = txt_emp_no_asgnd.Text;

}

protected void Button1_Click(object sender, EventArgs e)
{

con = new SqlConnection("server=10.4.141.46 ; database = HRSS; uid = hrss ; pwd= hrss01");
cmd = new SqlCommand("Emp_info_Update", con);
cmd.CommandType = CommandType.StoredProcedure;

sp1 = cmd.Parameters.Add("@emp_no", SqlDbType.VarChar, 10);
sp1.Value = Txt_Emp_no.Text;
sp2 = cmd.Parameters.Add("@emp_name", SqlDbType.VarChar, 12);
sp2.Value = txt_emp_name.Text;
sp3 = cmd.Parameters.Add("@dob", SqlDbType.DateTime);
sp3.Value = txt_dob.Text;
sp4 = cmd.Parameters.Add("@email_id", SqlDbType.VarChar, 20);
sp4.Value = txt_email_id.Text;
sp5 = cmd.Parameters.Add("@date_joining", SqlDbType.DateTime);
sp5.Value = txt_date_of_joining.Text;
sp6 = cmd.Parameters.Add("@contact_no", SqlDbType.VarChar, 12);
sp6.Value = txt_contact_no.Text;
sp7 = cmd.Parameters.Add("@address", SqlDbType.VarChar, 30);
sp7.Value = txt_address.Text;
sp8 = cmd.Parameters.Add("@gender", SqlDbType.VarChar, 30);
sp8.Value = radio_gender.SelectedValue;
sp9 = cmd.Parameters.Add("@department", SqlDbType.VarChar, 30);
sp9.Value = dropdown_dept.SelectedValue;


op = cmd.Parameters.Add("@op", SqlDbType.VarChar, 1);

op.Direction = ParameterDirection.Output;


con.Open();
cmd.ExecuteNonQuery();
label_update.Visible = true;

con.Close();
output = Convert.ToInt32((cmd.Parameters["@op"].Value));
if (output == 1)
{
label_update.Text = "Entry Updated successfully ! ";
clearall();
}
else
label_update.Text = "No record found, please enter correct Employee number";
}

protected void Button2_Click(object sender, EventArgs e)
{

con = new SqlConnection("server=10.4.141.46 ; database = HRSS; uid = hrss ; pwd= hrss01");
cmd = new SqlCommand("Emp_info_Delete", con);
cmd.CommandType = CommandType.StoredProcedure;

sp1 = cmd.Parameters.Add("@emp_no", SqlDbType.VarChar, 10);
sp1.Value = Txt_Emp_no.Text;


op = cmd.Parameters.Add("@op", SqlDbType.Int);

op.Direction = ParameterDirection.Output;

con.Open();
cmd.ExecuteNonQuery();
label_delete.Visible = true;
con.Close();
output = Convert.ToInt32((cmd.Parameters["@op"].Value));
if (output == 1)
{
label_delete.Text = "Entry deleted successfully ! ";
clearall();
}
else
label_delete.Text = "No record found, please enter correct Employee number";


}

protected void cal_date_of_joining_SelectionChanged(object sender, EventArgs e)
{
txt_date_of_joining.Text = cal_date_of_joining.SelectedDate.ToString("MM/dd/yyyy");
}
protected void cal_dob_SelectionChanged(object sender, EventArgs e)
{
txt_dob.Text = cal_dob.SelectedDate.ToString("MM/dd/yyyy");
}



protected void Page_Load(object sender, EventArgs e)
{
CompareValidator_dob.ValueToCompare = DateTime.Now.AddYears(-18).ToShortDateString();
label_delete.Visible = false;
label_insert.Visible = false;
label_update.Visible = false;
txt_emp_no_asgnd.Visible = false;

if (!Page.IsPostBack )
Txt_Emp_no.Text = "000000";

}

protected void clearall()
{
Txt_Emp_no.Text = "";
txt_emp_name.Text = "";
txt_email_id.Text = "";
txt_dob.Text = "";
txt_date_of_joining.Text = "";
txt_contact_no.Text = "";
txt_address.Text = "";
}


}

fnl

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Emp_form.aspx.cs" Inherits="Empform" %>





Employee Database Entry Form





Please enter your details:





* Only Emp_no needs to provided in case of deleting a record.

* In case of inserting a new record use New Entry button. Don't Enter any value
in Employee number column.

* In case of changing an already exixsting record, use the Update button.

















Employee number                   
:

ErrorMessage= "*The Entry cannot be left blank"
ControlToValidate= "Txt_Emp_no" SetFocusOnError="True" />


ErrorMessage= "*Entry should be a six digit number only"
ControlToValidate="Txt_Emp_no"
ValidationExpression = "\d\d\d\d\d\d" CssClass="Err" />


Employee name                   
    :

ErrorMessage= "*The Entry cannot be left blank"
ControlToValidate= "Txt_emp_name" SetFocusOnError="True" CssClass="Err" />



Date of Birth                   
         :
  (MM/dd/yyyy) 
ErrorMessage = "*You must be atleast 18years old to be employed! "

Operator = "LessThan"
Type= "Date" ControlToValidate="txt_dob" SetFocusOnError="True" CssClass="Err" />

Font-Names="Verdana" Font-Size="9pt" ForeColor="Black" Height="250px" NextPrevFormat="ShortMonth"
OnSelectionChanged="cal_dob_SelectionChanged" Width="330px" BorderStyle="Solid" CellSpacing="1">





Font-Size="12pt" ForeColor="White" BorderStyle="Solid" Height="12pt" />


 




Gender                 
                      
:   RepeatLayout="Flow" Width="150px" CausesValidation="True">
Male
Female

ErrorMessage= "*The Entry cannot be left blank"
ControlToValidate= "radio_gender" SetFocusOnError="True" CssClass="Err" />



Department                 
                :

RCB
IT
CES
FCC
RTF




Email address                    
          :

ErrorMessage= "*The Entry cannot be left blank"
ControlToValidate= "Txt_email_id" SetFocusOnError="True" CssClass="Err" />

ErrorMessage="*Email address is not valid."
ControlToValidate= "txt_email_id"
ValidationExpression= "[\w.]+@[\w.]+\.[\w.]+" CssClass="Err" />

 

Date of joining                   
         :
(MM/dd/yyyy) 
ErrorMessage = "*Date of joining cannot be before the Date of birth !"
ControlToCompare = "txt_dob"
Operator = "GreaterThan"
Type= "Date" ControlToValidate="txt_date_of_joining" SetFocusOnError="True" CssClass="Err" />


NextPrevFormat="ShortMonth"
Width="330px" OnSelectionChanged="cal_date_of_joining_SelectionChanged" BorderStyle="Solid" CellSpacing="1" >





Font-Size="12pt" ForeColor="White" BorderStyle="Solid" Height="12pt" />


 


Contact number            +91  :



ErrorMessage="*Entry should only be a 10 digit number"
ControlToValidate= "txt_contact_no"
ValidationExpression= "\d\d\d\d\d\d\d\d\d\d" CssClass="Err" />

 

Address                      
          :








Text="Delete" />





Monday, June 28, 2010

BODY
{ PADDING-RIGHT: 0px;
PADDING-LEFT: 0px;

FONT-SIZE: 11px;
PADDING-BOTTOM: 0px;
MARGIN: 2px 5px 0px;

COLOR: black;
SCROLLBAR-3DLIGHT-COLOR: #fff0c1;
SCROLLBAR-ARROW-COLOR: white;
SCROLLBAR-HIGHLIGHT-COLOR: #dbdac4;
SCROLLBAR-FACE-COLOR: #dbdac4;

/*#c1dad0*/
PADDING-TOP: 0px;
FONT-FAMILY: Tahoma,Verdana;
BACKGROUND-COLOR: #e3f1f2 }


BODY1
{
PADDING-RIGHT: 0px;
PADDING-LEFT: 0px;
FONT-SIZE: 8px;
PADDING-BOTTOM: 0px;
MARGIN: 2px 5px 0px;
COLOR: #722400;
PADDING-TOP: 0px;
font-family: Tahoma,Verdana;
BACKGROUND-COLOR: #FFF0C1;
SCROLLBAR-FACE-COLOR: #FFF0C1;
scrollbar-highlight-color:#d68500;
scrollbar-arrow-color:#993300;
scrollbar-3dlight-color :#FFF0C1;
}
.Excel
{
border-right:0px;
border-top:0px;
font-weight: bold;
font-size: 11px;
border-left:0px;
cursor: hand;
border-bottom:0px;
font-family: Verdana;
width:16px;
height:16px;
background:url(..\images\Excel.bmp);
background-color:Transparent;
}

.Word
{
border-right:0px;
border-top:0px;
font-weight: bold;
font-size: 11px;
border-left:0px;
cursor: hand;
border-bottom:0px;
font-family: Verdana;
width:16px;
height:16px;
background:url(..\images\word.bmp);
background-color:Transparent;
}
A:hover
{
font-size: 11px;
cursor: hand;
color: #993300;
font-family: Tahoma,Verdana;
background-color: transparent;
text-decoration: none;
}
A:link
{
font-size: 11px;
cursor: hand;
color: #993300;
font-family: Tahoma,Verdana;
background-color: transparent;
text-decoration: none;
}
A:visited
{
font-size: 11px;
color: #993300;
font-family: Tahoma,Verdana;
background-color: transparent;
cursor:hand;
text-decoration:none;
}

.Title
{
border:none 0 transparent;
font-size: 11px;
color: #722400;
font-family: Tahoma,Verdana;
background-color: transparent;
}
.TitleAbout
{
font-size: 13px;
color: #722400;
font-family: Tahoma,Verdana;
background-color: transparent;
}

.TitleHead
{
font-weight: bolder;
font-size: 11px;
color: #722400;
font-family: Tahoma,Verdana;
background-color: transparent;

}
.TextRequired
{
border-right: #55848e 1px solid;
border-top: #55848e 1px solid;
font-size: 11px;
border-left: #55848e 1px solid;
border-bottom: #55848e 1px solid;
font-family: Tahoma,Verdana;
background-color:White;
}
.TextNormal
{
border: #55848e 1px solid;
font-size: 11px;
font-family: Tahoma,Verdana;
background-color: white;
}
.TextReadOnly
{
border-right: #55848e 1px solid;
border-top: #55848e 1px solid;
font-size: 11px;
border-left: #55848e 1px solid;
color: BLACK;
border-bottom: #55848e 1px solid;
font-family: Tahoma,Verdana;
background-color: #FFF0C1;
}
.List
{
font-size: 11px;
font-family: Tahoma,Verdana;
}
/*
.Button
{
border-right: black 1px solid;
border-top: black 1px solid;
font-weight: bold;
font-size: 11px;
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr= '#ffffff' , EndColorStr= '#c2d6e1' );
border-left: black 1px solid;
cursor: hand;
color: #55848e;
border-bottom: black 1px solid;
font-family: Tahoma,Verdana;
}
*/
.Button
{
border-right: #468786 1px solid;
border-top: #468786 1px solid;
font-weight: bold;
font-size: 10px;
border-left: #468786 1px solid;
cursor: hand;
color: black;
border-bottom: #468786 1px solid;
font-family: Tahoma,Verdana;
BACKGROUND-IMAGE: url(/Fueal_N_Loss/Fin/btnGen2.png);
height:20px;

}

.ButtonOver
{
border-right: black 1px solid;
border-top: black 1px solid;
font-weight: bold;
font-size: 11px;
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr= '#ffffff' , EndColorStr= '#c2d6e1' ), DXImageTransform.Microsoft.Blur(PixelRadius=1, ShadowOpacity=.30), progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
border-left: black 1px solid;
cursor: hand;
color: #c2d6e1;
border-bottom: black 1px solid;
font-family: Tahoma,Verdana;
}
.Err
{
font-weight: bold;
font-size: 11px;
color: red;
font-family: Tahoma,Verdana;
background-color: transparent;
}

.Grid
{
border-right: #55848e 2px solid;
border-top: #55848e 2px solid;
font-size: 11px;
border-left: #55848e 2px solid;
border-bottom: #55848e 2px solid;
font-family: Tahoma,Verdana;

}

.GridHeader
{
/*
border-right: #55848e 1px solid;
border-top: #55848e 1px solid;
font-weight: bold;
font-size: 11px;
border-left: #55848e 1px solid;
color:White;
border-bottom: #55848e 1px solid;
font-family: Tahoma,Verdana;
background-color: #55848e;
background-image:url(Images/Question_Bar.png);
text-align: center;
*/
border-right: #468786 1px solid;
border-top: #468786 1px solid;
font-weight: bold;
font-size: 10px;
border-left: #468786 1px solid;
color: black;
border-bottom: #468786 1px solid;
font-family: Tahoma,Verdana;
/*BACKGROUND-IMAGE: url(Images/Bar_Btn_Dark.png);*/
background-repeat:repeat;
/*height:20px;*/
}
.GridHeader1
{
border-right: #55848e 1px solid;
border-top: #55848e 1px solid;
font-weight: bold;
font-size: 11px;
border-left: #55848e 1px solid;
color:Black;
border-bottom: #55848e 1px solid;
font-family: Tahoma,Verdana;
/*background-color:Green;*/
background-color: #55848e;
background-color:Teal;
text-align: center;
border-width:1px;
}
.FixGridHeader
{
border-right: #d68500 1px solid;
border-top: #d68500 1px solid;
font-weight: bold;
font-size: 11px;
border-left: #d68500 1px solid;
color: black;
border-bottom: #d68500 1px solid;
font-family: Tahoma,Verdana;
background-color: #d68500;
text-align: center;
position:relative ;
top:expression(this.offsetParent.scrollTop);
LEFT: expression(this.offsetParent.scrollLeft);
/*TOP: expression(document.getElementById("pnlData").scrollTop);*/
z-index: 10;
}
.GridItem
{
border-right: black 1px solid;
border-top: black 1px solid;
font-size: 11px;
border-left: black 1px solid;
color: black;
border-bottom: black 1px solid;
font-family: Tahoma,Verdana;
background-color: #d0dfed;
}
.GridAlternateItem
{
border-right: black 1px solid;
border-top: black 1px solid;
font-size: 11px;
border-left: black 1px solid;
color: black;
border-bottom: black 1px solid;
font-family: Tahoma,Verdana;
background-color: #b1c9db;
}
.GridSelect
{
border-right: #55848e 1px solid;
border-top: #55848e 1px solid;
border-left: #55848e 1px solid;
border-bottom: #55848e 1px solid;
font-size: 11px;
color: white;
font-family: Tahoma,Verdana;
font-weight:bold;
background-color:#669966;
}
.Panel
{
border-right: #55848e 2px groove;
border-top: #55848e 2px groove;
border-bottom: #55848e 2px groove;
border-left: #55848e 2px groove;
margin-top: 0px;
padding-left: 0px;
color:#55848e;
font-size: 11px;
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr= '#ffffff' , EndColorStr= '#c2d6e1' );
margin-left: 0px;
overflow: auto;
padding-top: 0px;
font-family: Tahoma,Verdana;


}
.TopGroup
{
PADDING-RIGHT: 0px;
PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px;
CURSOR: default;
PADDING-TOP: 0px;
BACKGROUND-COLOR: #d68500 ;
font-family:Tahoma,Verdana;
font-size:11px;
}

/*
.MenuBar
{
padding-right: 2px;
padding-left: 2px;
font-size: 11px;
padding-bottom: 2px;
cursor: default;
color: #ffffff;
padding-top: 2px;
font-family: Tahoma,Verdana;
background-color: #55848e;
}
*/
.MenuBar
{
padding-right: 2px;
padding-left: 2px;
font-size: 11px;
background-image: url(../images/bar.png);
padding-bottom: 2px;
color: #000000;
padding-top: 2px;
font-family: Verdana, Arial, Times New Roman;
}

.MenuBarOver
{
border-right: #55848e 1px solid;
padding-right: 2px;
border-top: #55848e 1px solid;
padding-left: 2px;
padding-bottom: 2px;
border-left: #55848e 1px solid;
cursor: Hand;
color: black;
padding-top: 2px;
border-bottom: #55848e 1px solid;
background-color: #c2d6e1;
font-family:Tahoma,Verdana;
font-size:11px;
}

.MenuItem
{
padding-left: 3px;
padding: 2px;
padding-right: 3px;
cursor: default;
font-size: 11px;
font-family: Tahoma,Verdana;
color:#000000;

}

.MenuItemOver
{
border:solid 1px #55848e;
padding-right: 2px;
padding-left: 2px;
padding: 1px;
cursor:hand;
color: #993300;
background-color: white;
font-family:Tahoma,Verdana;
font-size:11px;
}

.MenuSideBar
{
BORDER-RIGHT: #adc5ed 1px solid;
PADDING-RIGHT: 1px;
BORDER-TOP: #adc5ed 1px solid;
PADDING-LEFT: 1px;
BACKGROUND: url(../Images/LIMS_sidebar.png) #ffffff repeat-y;
PADDING-BOTTOM: 1px;
BORDER-LEFT: #adc5ed 1px solid;
CURSOR: default;
PADDING-TOP: 1px;
BORDER-BOTTOM: #adc5ed 1px solid
}

.MenuBreak
{
MARGIN-LEFT: 5px
}
.TabSelect
{
border-right: #d68500 2px solid;
padding-right: 1px;
border-top: #d68500 2px solid;
padding-left: 1px;
border-left: #d68500 2px solid;
cursor: default;
color: #722400;
padding-top: 1px;
background-color:Transparent;
}
.TabPage
{
border-right: #d68500 2px solid;
border-bottom: #d68500 2px solid;
border-left: #d68500 2px solid;
padding-right: 1px;
padding-left: 1px;
padding-bottom:1px;
padding-top:1px;
cursor: default;
color: #722400;
background-color:Transparent ;
}

.Tab
{
border-right: #d68500 2px solid;
border-top: #d68500 2px solid;
border-left: #d68500 2px solid;
border-bottom:#d68500 2px solid;
padding-right: 1px;
padding-left: 1px;
padding-bottom:1px;
padding-top:1px;
cursor: default;
color: black;
background-color: Transparent ;
}
.Space
{
border-bottom: #d68500 2px solid;
}

.CellSelect
{
padding-right: 1px;
border-right: #8a867a 2px solid;
padding-top: 1px;
border-top: #8a867a 2px solid;
padding-left: 1px;
border-left: #8a867a 2px solid;
padding-bottom: 1px;
border-bottom: #8a867a 2px solid;
cursor: default;
color: black;

background-color: #efede3;
}
.TabNormal
{
border-right: #8a867a 2px solid;
padding-right: 1px;
border-top: #8a867a 2px solid;
padding-left: 1px;
padding-bottom: 1px;
border-left: #8a867a 2px solid;
border-bottom:#8a867a 2px solid;
cursor: default;
color: black;
padding-top: 1px;
}
.Table
{
border-right: #55848e 2px solid;
border-top: #55848e 2px solid;
font-size: 11px;
border-left: #55848e 2px solid;
border-bottom: #55848e 2px solid;
font-family: Tahoma,Verdana;
}
.TableHeader
{

border-right: black 1px solid;
border-top: black 1px solid;
font-weight: bold;
font-size: 11px;
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr= '#ffffff' , EndColorStr= '#aef4f4' );
border-left: black 1px solid;
color: #000000;
border-bottom: black 1px solid;
font-family: Tahoma,Verdana;
text-align: left;
text-decoration: none;


}
.TableHeaderMain
{
border-right: black 0px solid;
border-top: black 0px solid;
font-weight: bold;
font-size: 11px;
background-attachment: fixed;
background-image: url(\Common\Image\header.gif);
border-left: black 0px solid;
color: #993300;
border-bottom: black 0px solid;
background-repeat: no-repeat;
font-family: Tahoma,Verdana;
text-align: left;
text-decoration: none;
}

.shadow
{
}

.Image
{
TextColor:255,255,255;
SColor:255,224,113;
EColor:214,133,0;
ShadowColor:102,102,102;
GType:1;
}

.DatePicker
{
BORDER-RIGHT: outset;
BORDER-TOP: outset;
FONT-SIZE: 10px;
BORDER-LEFT: outset;
CURSOR: hand;
BORDER-BOTTOM: outset;
font-family: Tahoma,Verdana;
HEIGHT: 20px;
BACKGROUND-COLOR: transparent;
}

.SaveButton
{
background-image : url(Images/Save_Normal.png);
cursor: hand;

}
.OnMouseOverSaveButton
{
background-image : url(Images/Save_Over.png);
cursor: hand;

}
.OnMouseOverHyperLink
{
TextColor:255,255,0;
}
.ViewReportButton
{
background-image:url(Images/Save_Normal2.png);
cursor:hand;
}
.OnMouseOverViewReportButton
{
background-image:url(Images/Save_Over2.png);
}
.SaveButtonFuel
{
background-image:url(Images/Save.png);background-repeat:no-repeat;cursor:hand;
}
.HelpFuelNLoss
{
background-image:url(Images/Help.png);background-repeat:no-repeat;
}
divFuelScroll
{

SCROLLBAR-FACE-COLOR:#c1dad0;
}
.FormPopup
{
font-size: 11px;
color: #000000;
font-family: Tahoma, Verdana, Arial, Times New Roman;
background-color: #f7fdff;
border-right: #719ddb 1px solid;
border-top: #719ddb 1px solid;
border-left: #719ddb 1px solid;
border-bottom: #719ddb 1px solid;
margin: 0px;
height:100%;
}
.MenuItemOver1
{
border:solid 1px #2254b1;
padding-right: 2px;
padding-left: 2px;
padding: 1px;
cursor: default;
color: #0000ff;
/*filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr= '#FE914E' , EndColorStr= '#FFD38E' );*/
background-color:#ffd38e;
font-family: Tahoma, Verdana, Arial, Times New Roman;
font-size:11px;
}
div#div-datagrid {
width: 420px;
height: 200px;
overflow: auto;
scrollbar-base-color:#ffeaff;
}


.CalFuelNLoss
{
background-image:url(Images/Calender.png);background-repeat:no-repeat;
}
.CalOnFuelNLoss
{
background-image:url(Images/Bar_Button_Cal_Back.png);background-repeat:no-repeat;
}
.GridCentralUser
{
border-right: #55848e 1px solid;
border-top: #55848e 1px solid;
font-weight: bold;
font-size: 11px;
border-left: #55848e 1px solid;
color:White;
border-bottom: #55848e 1px solid;
font-family: Tahoma,Verdana;

/*background-color: Red;*/
background-color: #55848e;
background-image:url(Images/Central_User_Bar.png);
text-align: center;
}
.GridAction
{
border-right: #55848e 1px solid;
border-top: #55848e 1px solid;
font-weight: bold;
font-size: 11px;
border-left: #55848e 1px solid;
color:White;
border-bottom: #55848e 1px solid;
font-family: Tahoma,Verdana;

/*background-color: Red;*/
background-color: #55848e;
background-image:url(Images/Assignee_Bar.png);
text-align: center;
}
.AddButton
{

src:url(Images/Icons/Add_New.png);background-repeat:no-repeat;
cursor: hand;

}
.OnMouseOverAddButton
{
src:url(Images/Icons/Add_New_Ovr.png);background-repeat:no-repeat;
cursor: hand;

}
.CUButton
{

src:url(Images/Icons/Pending_at_CU.png);background-repeat:no-repeat;
cursor: hand;

}
.AUButton
{

src:url(Images/Icons/Pending_to_AE.png);background-repeat:no-repeat;
cursor: hand;

}
.NAUButton
{

src:url(Images/Icons/Assigned_New.png);background-repeat:no-repeat;
cursor: hand;

}
.PAtAEButton
{
src:url(Images/Icons/Pending_at_AE.png);background-repeat:no-repeat;
cursor: hand;

}

.ShowButton
{
src:url(Images/Icons/Show_All.png);background-repeat:no-repeat;
cursor: hand;

}
.Btn
{
background-image:url(Images/XP_Btn.png);
cursor:hand;
width:68px;
height:19px;
border-style:none;
background-color:Transparent;
background-repeat:no-repeat;
}
.BtnBig
{
background-image:url(Images/XP_Btn_Big.png);
cursor:hand;
width:136px;
height:19px;
border-style:none;
background-color:Transparent;
background-repeat:no-repeat;
}
body
{
PADDING-RIGHT: 10px;
PADDING-LEFT: 10px;
padding-top :10px;

FONT-SIZE: 11px;
PADDING-BOTTOM: 10px;
MARGIN: 2px 5px 0px;

COLOR: Black;
/*SCROLLBAR-3DLIGHT-COLOR: #fff0c1;
SCROLLBAR-ARROW-COLOR: white;
SCROLLBAR-HIGHLIGHT-COLOR: #dbdac4;
SCROLLBAR-FACE-COLOR: #dbdac4;*/

/*#c1dad0*/

FONT-FAMILY: Verdana;
BACKGROUND-COLOR: #EFDAF2;
}
.Txtb
{

background-color:Gray;
font-style:italic;
font-family:Verdana;
font-size:medium;
color : White;

}
.Err
{
/*font-weight: bold;
font-size: 11px;
color: red;
font-family: Tahoma,Verdana;
background-color: transparent;*/
}
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Text.RegularExpressions;
using System.Text;
using System.Globalization;
using System.Data.Sql;
using System.Data.SqlClient;




public partial class Empform : System.Web.UI.Page
{

DataSet ds = new DataSet();
SqlConnection con;
//Here we declare the parameter which we have to use in our application
SqlCommand cmd = new SqlCommand();
SqlParameter sp1 = new SqlParameter();
SqlParameter sp2 = new SqlParameter();
SqlParameter sp3 = new SqlParameter();
SqlParameter sp4 = new SqlParameter();
SqlParameter sp5 = new SqlParameter();
SqlParameter sp6 = new SqlParameter();
SqlParameter sp7 = new SqlParameter();
SqlParameter sp8 = new SqlParameter();
SqlParameter sp9 = new SqlParameter();



protected void button_submit_Click(object sender, EventArgs e)
{
con = new SqlConnection("server=10.4.141.46 ; database = HRSS; uid = hrss ; pwd= hrss01");
cmd = new SqlCommand("Emp_info_Insert", con);
cmd.CommandType = CommandType.StoredProcedure;

sp1 = cmd.Parameters.Add("@emp_no", SqlDbType.VarChar, 10);
sp1.Value = Txt_Emp_no.Text;
sp2 = cmd.Parameters.Add("@emp_name", SqlDbType.VarChar, 12);
sp2.Value = txt_emp_name.Text;
sp3 = cmd.Parameters.Add("@dob", SqlDbType.DateTime);
sp3.Value = txt_dob.Text;
sp4 = cmd.Parameters.Add("@email_id", SqlDbType.VarChar, 20);
sp4.Value = txt_email_id.Text;
sp5 = cmd.Parameters.Add("@date_joining", SqlDbType.DateTime);
sp5.Value = txt_date_of_joining.Text;
sp6 = cmd.Parameters.Add("@contact_no", SqlDbType.VarChar, 12);
sp6.Value = txt_contact_no.Text;
sp7 = cmd.Parameters.Add("@address", SqlDbType.VarChar, 30);
sp7.Value = txt_address.Text;
sp8 = cmd.Parameters.Add("@gender", SqlDbType.VarChar, 30);
sp8.Value = radio_gender.SelectedValue;
sp9 = cmd.Parameters.Add("@department", SqlDbType.VarChar, 30);
sp9.Value = dropdown_dept.SelectedValue;

con.Open();
cmd.ExecuteNonQuery();
label_insert.Visible = true;
con.Close();
}

protected void Button1_Click(object sender, EventArgs e)
{

con = new SqlConnection("server=10.4.141.46 ; database = HRSS; uid = hrss ; pwd= hrss01");
cmd = new SqlCommand("Emp_info_Update", con);
cmd.CommandType = CommandType.StoredProcedure;

sp1 = cmd.Parameters.Add("@emp_no", SqlDbType.VarChar, 10);
sp1.Value = Txt_Emp_no.Text;
sp2 = cmd.Parameters.Add("@emp_name", SqlDbType.VarChar, 12);
sp2.Value = txt_emp_name.Text;
sp3 = cmd.Parameters.Add("@dob", SqlDbType.DateTime);
sp3.Value = txt_dob.Text;
sp4 = cmd.Parameters.Add("@email_id", SqlDbType.VarChar, 20);
sp4.Value = txt_email_id.Text;
sp5 = cmd.Parameters.Add("@date_joining", SqlDbType.DateTime);
sp5.Value = txt_date_of_joining.Text;
sp6 = cmd.Parameters.Add("@contact_no", SqlDbType.VarChar, 12);
sp6.Value = txt_contact_no.Text;
sp7 = cmd.Parameters.Add("@address", SqlDbType.VarChar, 30);
sp7.Value = txt_address.Text;
sp8 = cmd.Parameters.Add("@gender", SqlDbType.VarChar, 30);
sp8.Value = radio_gender.SelectedValue;
sp9 = cmd.Parameters.Add("@department", SqlDbType.VarChar, 30);
sp9.Value = dropdown_dept.SelectedValue;

con.Open();
cmd.ExecuteNonQuery();
label_update.Visible = true;
con.Close();
}
protected void Button2_Click(object sender, EventArgs e)
{

con = new SqlConnection("server=10.4.141.46 ; database = HRSS; uid = hrss ; pwd= hrss01");
cmd = new SqlCommand("Emp_info_Delete", con);
cmd.CommandType = CommandType.StoredProcedure;

sp1 = cmd.Parameters.Add("@emp_no", SqlDbType.VarChar, 10);
sp1.Value = Txt_Emp_no.Text;

con.Open();
cmd.ExecuteNonQuery();
label_delete.Visible = true;
con.Close();
}

protected void cal_date_of_joining_SelectionChanged(object sender, EventArgs e)
{
txt_date_of_joining.Text = cal_date_of_joining.SelectedDate.ToString("MM/dd/yyyy");
}
protected void cal_dob_SelectionChanged(object sender, EventArgs e)
{
txt_dob.Text = cal_dob.SelectedDate.ToString("MM/dd/yyyy");
}



protected void Page_Load(object sender, EventArgs e)
{
CompareValidator_dob.ValueToCompare = DateTime.Now.AddYears(-18).ToShortDateString();
label_delete.Visible = false;
label_insert.Visible = false;
label_update.Visible = false;
}


}

1


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Emp_form.aspx.cs" Inherits="Empform" %>
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml" > Untitled Page
Please enter your details:

* Only Emp_no needs to provided in case of deleting a record
* In case of inserting a new record use New Entry button
* In case of changing an already exixsting record, use the Update button.





Employee number :

Employee name :

Date of Birth : (MM/dd/yyyy)

Gender : Male Female

Department &nbsp : RCB IT CES FCC RTF

Email address :


Date of joining : (MM/dd/yyyy)

Contact number +91 :


Address :