Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
<table class="style5">
<tr>
<td class="style7" colspan="2">
<span class="style24">Enter Personal
Details:</span><span class="style8">(*)Mandatory Fields</span></td>
</tr>
<tr>
<td align="right" class="style23" colspan="2">
<table class="style5">
<tr>
<td class="style10">
First Name:</td>
<td align="left" class="style11">
<asp:TextBox ID="txtFname"
runat="server" Height="23px" ValidationGroup="add"
Width="135px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtFname"
ErrorMessage="*" ValidationGroup="add"></asp:RequiredFieldValidator>
</td>
<td class="style12">
Last Name:</td>
<td align="left" class="style23">
<asp:TextBox ID="txtLname"
runat="server" Height="23px" ValidationGroup="add"
Width="135px"></asp:TextBox>
</td>
</tr>
</table>
</td>
</tr>
<tr class="style23">
<td align="right" class="style22">
Gender:
</td>
</tr>
<tr>
<td align="right" class="style19"> Address:</td>
<td class="style23">
<asp:TextBox ID="txtAddress" runat="server"
Height="44px" TextMode="MultiLine"
ValidationGroup="add" Width="170px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txtAddress" ErrorMessage="*"
ValidationGroup="add"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right" class="style19">
PhoneNo:</td>
<td class="style23">
<asp:TextBox ID="txtPhoneno" runat="server"
Height="25px"
Width="150px"
ValidationGroup="add"></asp:TextBox>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server"
ControlToValidate="txtPhoneno"
ErrorMessage="*" ValidationExpression="\d{10}"
ValidationGroup="add"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td align="right" class="style19">
Date Of Reg:</td>
<td style="color: #FF0000">
<span class="style23">
<asp:TextBox ID="txtDate" runat="server"
Height="26px" ValidationGroup="add"
Width="150px"></asp:TextBox>
</span>
<cc1:CalendarExtender ID="CalendarExtender1"
runat="server"
TargetControlID="txtDate">
</cc1:CalendarExtender>
<span>e.g (dd/mm/yyyy)</span></td>
</tr>
<tr>
<td align="right" class="style19">
EmailId:</td>
<td>
<span class="style23">
<asp:TextBox ID="txtEmail" runat="server"
Height="24px" ValidationGroup="add"
Width="150px"></asp:TextBox>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator2" runat="server"
ControlToValidate="txtEmail" ErrorMessage="*"
ValidationExpression="\w+([-+.']\w+)*@\w+
([-.]\w+)*\.\w+([-.]\w+)*"
ValidationGroup="add"></asp:RegularExpressionValidator>
</span>
<br class="style23" />
<span>e.g (ab.ab@mail.com)</span></td>
</tr>
<tr>
<td align="right" class="style19">
Qualification:</td>
<td class="style23">
<asp:DropDownList ID="ddlQualification"
runat="server" Height="20px"
ValidationGroup="add" Width="100px">
<asp:ListItem>---Select---</asp:ListItem>
<asp:ListItem>Bi.P.C</asp:ListItem>
<asp:ListItem>M.Pharmse</asp:ListItem>
<asp:ListItem>B.Pharmce</asp:ListItem>
<asp:ListItem>D.Pharmace</asp:ListItem>
<asp:ListItem>Bio Technology</asp:ListItem>
<asp:ListItem>M.Sc Chemestry</asp:ListItem>
<asp:ListItem>M.Sc Zoovolagy</asp:ListItem>
<asp:ListItem>B.Sc</asp:ListItem>
<asp:ListItem>Madicin</asp:ListItem>
<asp:ListItem>M.Sc Bio.Tech</asp:ListItem>
<asp:ListItem>Agriculture B.Sc</asp:ListItem>
<asp:ListItem>Organic Chemistry</asp:ListItem>
<asp:ListItem>MCA</asp:ListItem>
<asp:ListItem>MBA</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server"
ControlToValidate="ddlQualification"
ErrorMessage="*" ValidationGroup="add"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right" class="style18">
<span class="style23">Experience:</span></td>
<td>
<table>
<tr>
<td align="right" class="style14">
Yrs</span></td>
<td class="style15">
<asp:DropDownList ID="ddlyrs"
runat="server" ValidationGroup="add">
<asp:ListItem>---Select---
</asp:ListItem>
<asp:ListItem>0</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
</asp:DropDownList>
</td>
<td align="right" class="style16">
Mths</td>
<td class="style17">
<asp:DropDownList ID="ddlMnths"
runat="server" ValidationGroup="add">
<asp:ListItem>---Select---
</asp:ListItem>
<asp:ListItem>0</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
<asp:ListItem>11</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" class="style19">
Designation:</td>
<td class="style23">
<asp:TextBox ID="txtDesignation" runat="server"
Height="23px"
ValidationGroup="add"
Width="150px"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" class="style19">
Photo:</td>
<td class="style23">
<asp:FileUpload ID="FileUpload1" runat="server"
Width="227px" />
</td>
</tr>
<tr>
<td align="right" class="style18">
</td>
<td>
<asp:ScriptManager ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
</td>
</tr>
<tr>
<td align="left" class="style13" colspan="2">
<span class="style25">Enter Login
Details:</span><span class="style26">(*)Mandatory
Fields</span></td>
</tr>
<tr>
<asp:Button ID="btnCancel" runat="server" Font-
Bold="True" ForeColor="Red"
onclick="btnCancel_Click" Text="Cancel" />
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
</table>
<p>
</p>
</asp:Content>
Registration page Code Behind:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
}
protected void btnCheck_Click(object sender, EventArgs e)
{
try
{
if (txtUserName.Text.Contains("@"))
objReg.UserName = txtUserName.Text.Trim();
else
objReg.UserName = (txtUserName.Text +
"@webpharms.com").Trim();
objReg.CheckUserAvailability(out msg);
Label1.Visible = true;
Label1.Text = msg;
}
catch (Exception er)
{
Label1.Visible = true;
Label1.Text = er.Message;
}
}
}
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using E–Pharmaceuticals.DAL;
using System.Data.SqlClient;
/// <summary>
/// Summary description for clsRegistration
/// </summary>
public class clsRegistration
{
public clsRegistration()
{
//
// TODO: Add constructor logic here
//
}
string _DorRid, _FirstName, _LastName, _Address, _PhoneNo,_Email,
_Qualification,_Gender;
string
_Experience,_Designation,_status,_UserName,_Password,_Cpassword,_HintQtn,_Answ
er;
DateTime _DORegistration;
byte[] _Image;
int _RoleId;
public string DorRid
{
get { return _DorRid; }
set { _DorRid = value; }
}
public string Firstname
{
get { return _FirstName; }
set { _FirstName = value; }
}
public string LastName
{
get { return _LastName; }
set { _LastName = value; }
}
public string Address
{
get { return _Address; }
set { _Address = value; }
}
public string Phoneno
{
get { return _PhoneNo; }
set { _PhoneNo = value; }
}
public string Email
{
get { return _Email; }
set { _Email = value; }
}
public string Qualification
{
get { return _Qualification; }
set { _Qualification = value; }
}
public string Gender
{
get { return _Gender; }
set { _Gender = value; }
}
public string Experience
{
get { return _Experience; }
set { _Experience = value; }
}
public string Designation
{
get { return _Designation; }
set { _Designation = value; }
}
public string Status
{
get { return _status; }
set { _status = value; }
}
public string UserName
{
get { return _UserName; }
set { _UserName = value; }
}
public string Password
{
get { return _Password; }
set { _Password = value; }
}
public string CPassword
{
get { return _Cpassword; }
set { _Cpassword = value; }
}
public string HintQtn
{
get { return _HintQtn; }
set { _HintQtn = value; }
}
public string Answer
{
get { return _Answer; }
set { _Answer = value; }
}
public DateTime DORegistration
{
get { return _DORegistration; }
set { _DORegistration = value; }
}
public byte[] Image
{
get { return _Image; }
set { _Image = value; }
}
public int RoleId
{
get { return _RoleId; }
set { _RoleId = value; }
}
if (id < 0)
{
nid = "R0001";
}
else
{
nid1 = Convert.ToString(dt.Rows[id-1][0]);
}
return nid;
}
catch (ArgumentException er)
{
throw new ArgumentException(er.Message);
}
}
//Getting RoleId
public int GetRoleId(string RoleType)
{
try
{
SqlParameter[] p = new SqlParameter[1];
p[0] = new SqlParameter("@RoleType", RoleType);
int id =
Convert.ToInt32(SqlHelper.ExecuteScalar(clsConnection.connection(),
CommandType.StoredProcedure, "Sp_GetRoleId", p));
return id;
}
catch (Exception er)
{
throw new ArgumentException(er.Message);
}
}
}
catch (Exception er)
{
throw new ArgumentException(er.Message);
}
}
}
catch (Exception er)
{
throw new ArgumentException(er.Message);
}
}
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
GO
as
begin
begin transaction
insert into tblRegistration
values(@DorRId,@FirstName,@LastName,@Gender,@Address,@PhoneNo,@DoRegistration,
@Email,
@Qualification,@Experience,@Designation,@photo,@status)
commit transaction
end
Login Form:
/// <summary>
/// Summary description for clsRegistration
/// </summary>
public class clsRegistration
{
public clsRegistration()
{
//
// TODO: Add constructor logic here
//
}
string _DorRid, _FirstName, _LastName, _Address, _PhoneNo,_Email,
_Qualification,_Gender;
string
_Experience,_Designation,_status,_UserName,_Password,_Cpassword,_HintQtn,_Answ
er;
DateTime _DORegistration;
byte[] _Image;
int _RoleId;
public string DorRid
{
get { return _DorRid; }
set { _DorRid = value; }
}
public string Firstname
{
get { return _FirstName; }
set { _FirstName = value; }
}
public string LastName
{
get { return _LastName; }
set { _LastName = value; }
}
public string Address
{
get { return _Address; }
set { _Address = value; }
}
public string Phoneno
{
get { return _PhoneNo; }
set { _PhoneNo = value; }
}
public string Email
{
get { return _Email; }
set { _Email = value; }
}
public string Qualification
{
get { return _Qualification; }
set { _Qualification = value; }
}
public string Gender
{
get { return _Gender; }
set { _Gender = value; }
}
public string Experience
{
get { return _Experience; }
set { _Experience = value; }
}
public string Designation
{
get { return _Designation; }
set { _Designation = value; }
}
public string Status
{
get { return _status; }
set { _status = value; }
}
public string UserName
{
get { return _UserName; }
set { _UserName = value; }
}
public string Password
{
get { return _Password; }
set { _Password = value; }
}
public string CPassword
{
get { return _Cpassword; }
set { _Cpassword = value; }
}
public string HintQtn
{
get { return _HintQtn; }
set { _HintQtn = value; }
}
public string Answer
{
get { return _Answer; }
set { _Answer = value; }
}
public DateTime DORegistration
{
get { return _DORegistration; }
set { _DORegistration = value; }
}
public byte[] Image
{
get { return _Image; }
set { _Image = value; }
}
public int RoleId
{
get { return _RoleId; }
set { _RoleId = value; }
}
if (id < 0)
{
nid = "R0001";
}
else
{
nid1 = Convert.ToString(dt.Rows[id-1][0]);
}
return nid;
}
catch (ArgumentException er)
{
throw new ArgumentException(er.Message);
}
}
//Getting RoleId
public int GetRoleId(string RoleType)
{
try
{
SqlParameter[] p = new SqlParameter[1];
p[0] = new SqlParameter("@RoleType", RoleType);
int id =
Convert.ToInt32(SqlHelper.ExecuteScalar(clsConnection.connection(),
CommandType.StoredProcedure, "Sp_GetRoleId", p));
return id;
}
catch (Exception er)
{
throw new ArgumentException(er.Message);
}
}
}
catch (Exception er)
{
throw new ArgumentException(er.Message);
}
}
}
catch (Exception er)
{
throw new ArgumentException(er.Message);
}
}
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
GO
as
begin
declare @Status varchar(25)
if @DorRId is null
begin
set @RoleType=0
set @RoleId=0
set @Msg='User Name or Pwd Incorrect'
end
else
begin
set @Status=(select status from tblRegistration where DorRId=@DorRId)
if @Status = 'Registered'
begin
set @RoleId=(select RoleId from tblLoginDetails where UserName=@UserName and
Password=@Password)
set @RoleType=(select RoleType from tblRolemaster where RoleId=@RoleId)
end
else
begin
set @RoleId=(select RoleId from tblLoginDetails where UserName=@UserName and
Password=@Password)
set @RoleType=(select RoleType from tblRolemaster where RoleId=@RoleId)
set @Msg='Still ur Profile is in Pending'
end
end
end