using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using HRHO_Entities;
using HRHO_Utilities;
using System.Configuration;
namespace HRHO_DAL
{
class LoginDAL:DataProviderBase
{
public List<LoginProperty> Getloginval(string uname, string pwd, string ipaddr)
{
string a = "";
string b = "";
List<LoginProperty> Stlogin = new List<LoginProperty>();
IDBManager dbManager = new DBManager(base.GetProvider(), ConfigurationManager.AppSettings["connection"].ToString());
DataSet dS = new DataSet();
DataTable dT = new DataTable();
try
{
dbManager.Open();
dbManager.CreateParameters(3);
dbManager.AddParameters(0, "@uname", uname);
dbManager.AddParameters(1, "@pwd", pwd);
dbManager.AddParameters(2, "@IP_ADDR", ipaddr);
dS = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "Getloginval");
if (dS.Tables.Count > 0)
{
LoginProperty stl = new LoginProperty();
foreach (DataRow Dr in dS.Tables[0].Rows)
{
stl.firstName = Convert.ToString(Dr["firstName"]);
//b = Convert.ToString(Dr["firstName"]);
stl.userType = Convert.ToInt32(Dr["userType"]);
Stlogin.Add(stl);
}
}
else
{
return Stlogin;
}
return Stlogin;
}
catch (Exception er)
{
throw;
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using HRHO_Entities;
using HRHO_Utilities;
using System.Configuration;
namespace HRHO_DAL
{
class LoginDAL:DataProviderBase
{
public List<LoginProperty> Getloginval(string uname, string pwd, string ipaddr)
{
string a = "";
string b = "";
List<LoginProperty> Stlogin = new List<LoginProperty>();
IDBManager dbManager = new DBManager(base.GetProvider(), ConfigurationManager.AppSettings["connection"].ToString());
DataSet dS = new DataSet();
DataTable dT = new DataTable();
try
{
dbManager.Open();
dbManager.CreateParameters(3);
dbManager.AddParameters(0, "@uname", uname);
dbManager.AddParameters(1, "@pwd", pwd);
dbManager.AddParameters(2, "@IP_ADDR", ipaddr);
dS = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "Getloginval");
if (dS.Tables.Count > 0)
{
LoginProperty stl = new LoginProperty();
foreach (DataRow Dr in dS.Tables[0].Rows)
{
stl.firstName = Convert.ToString(Dr["firstName"]);
//b = Convert.ToString(Dr["firstName"]);
stl.userType = Convert.ToInt32(Dr["userType"]);
Stlogin.Add(stl);
}
}
else
{
return Stlogin;
}
return Stlogin;
}
catch (Exception er)
{
throw;
}
}
}
}
No comments:
Post a Comment