using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
namespace UserDocMapping
{
public class BAL
{
DAL _ObjDal = new DAL();// In UI Declare Like BAL _ObjBal=new BAL();
#region UserLoginCheck
public DataTable UserLoginCheck(string UserName, string Password)
{
SqlParameter[] param = new SqlParameter[2];
param[0] = new SqlParameter("@UserName", SqlDbType.VarChar);
param[0].Value = UserName;
param[1] = new SqlParameter("@Password", SqlDbType.VarChar);
param[1].Value = Password;
DataTable ds = _ObjDal.DTWithParams("SP", param);
return ds;
}
#endregion
#region GetDoctorsList
public DataSet GetDoctorsList()
{
return _ObjDal.DSWithOutParams("MSP_SelectOnlyLabDoctors");
}
#endregion
#region InsertDetails
public int InsertDetails(int DocId, int UserId, int CentreId, string Mode)
{
SqlParameter[] param = new SqlParameter[4];
param[0] = new SqlParameter("@DocId", SqlDbType.Int);
param[0].Value = DocId;
param[1] = new SqlParameter("@UserId", SqlDbType.Int);
param[1].Value = UserId;
param[2] = new SqlParameter("@CentreId", SqlDbType.Int);
param[2].Value = CentreId;
param[3] = new SqlParameter("@Mode", SqlDbType.VarChar);
param[3].Value = Mode;
object val = _ObjDal.ExecuteScalar("SP", param);
int _val = Convert.ToInt32(val);
return _val;
}
#endregion
#region SelectMappedList
public DataSet SelectMappedList(int DocId, int UserId, int CentreId, string Mode)
{
SqlParameter[] param = new SqlParameter[4];
param[0] = new SqlParameter("@DocId", SqlDbType.Int);
param[0].Value = DocId;
param[1] = new SqlParameter("@UserId", SqlDbType.Int);
param[1].Value = UserId;
param[2] = new SqlParameter("@CentreId", SqlDbType.Int);
param[2].Value = CentreId;
param[3] = new SqlParameter("@Mode", SqlDbType.VarChar);
param[3].Value = Mode;
return _ObjDal.DSWithParams("SP", param);
}
#endregion
#region Inert New Doctor or Technician
public int InsertNewDoctorTechnician(string Username,string Firtname,string Lastname,int RoleId,string Permission)
{
SqlParameter[] param = new SqlParameter[5];
param[0] = new SqlParameter("@Username", SqlDbType.VarChar);
param[0].Value = Username;
param[1] = new SqlParameter("@Firtname", SqlDbType.VarChar);
param[1].Value = Firtname;
param[2] = new SqlParameter("@Lastname", SqlDbType.VarChar);
param[2].Value = Lastname;
param[3] = new SqlParameter("@RoleId", SqlDbType.Int);
param[3].Value = RoleId;
param[4] = new SqlParameter("@Permission", SqlDbType.VarChar);
param[4].Value = Permission;
object val = _ObjDal.ExecuteScalar("SP", param);
int _val = Convert.ToInt32(val);
return _val;
}
#endregion
#region Update New Doctor or Technician
public void UpdateNewDoctorTechnician(string Firtname,string Lastname,string Restofname, int RoleId,string Permission,int UserId)
{
SqlParameter[] param = new SqlParameter[6];
param[0] = new SqlParameter("@Firtname", SqlDbType.VarChar);
param[0].Value = Firtname;
param[1] = new SqlParameter("@Lastname", SqlDbType.VarChar);
param[1].Value = Lastname;
param[2] = new SqlParameter("@Restofname", SqlDbType.VarChar);
param[2].Value = Restofname;
param[3] = new SqlParameter("@RoleId", SqlDbType.Int);
param[3].Value = RoleId;
param[4] = new SqlParameter("@Permission", SqlDbType.VarChar);
param[4].Value = Permission;
param[5] = new SqlParameter("@UserId", SqlDbType.Int);
param[5].Value = UserId;
_ObjDal.ExecuteNonQuery("SP", param);
}
#endregion
#region Insert Doctor Signature
public void InsertDoctorSignature(int UserId,int RoleId,byte[] ImgBinay)
{
SqlParameter[] param = new SqlParameter[3];
param[0] = new SqlParameter("@UserId", SqlDbType.Int);
param[0].Value = UserId;
param[1] = new SqlParameter("@RoleId", SqlDbType.Int);
param[1].Value = RoleId;
param[2] = new SqlParameter("@UserSignature", SqlDbType.VarBinary);
param[2].Value = ImgBinay;
_ObjDal.ExecuteNonQuery("SP", param);
}
#endregion
#region Update TblUserMapping
public void UpdateTblUserMapping(int DocId,int UserId)
{
SqlParameter[] param = new SqlParameter[2];
param[0] = new SqlParameter("@DocId", SqlDbType.Int);
param[0].Value = DocId;
param[1] = new SqlParameter("@UserId", SqlDbType.Int);
param[1].Value = UserId;
_ObjDal.ExecuteNonQuery("SP", param);
}
#endregion
}
}
No comments:
Post a Comment