public List <MVCModels.HiDoctor_Master.WeekendGroup> GetWeekendGroupHeader() { string companyCode = _objCurInfo.GetCompanyCode(); List <MVCModels.HiDoctor_Master.WeekendGroup> lstWeekendGroup = new List <MVCModels.HiDoctor_Master.WeekendGroup>(); try { _objData.OpenConnection(companyCode); { using (sqldataReader = _objData.ExecuteReader("" + EXEC + " " + SP_HDGETWEEKENDGROUPNAME + " '" + companyCode + "'")) { while (sqldataReader.Read()) { MVCModels.HiDoctor_Master.WeekendGroup objWeekendGroup = new MVCModels.HiDoctor_Master.WeekendGroup(); objWeekendGroup.Weekend_Off_Code = sqldataReader["Weekend_Off_Code"].ToString(); objWeekendGroup.Weekend_Off_Name = sqldataReader["Weekend_Off_Name"].ToString(); lstWeekendGroup.Add(objWeekendGroup); } } } } catch { throw; } finally { _objData.CloseConnection(); } return(lstWeekendGroup); }
public IEnumerable <MVCModels.HiDoctor_Master.UserTypeSplashModel> GetselectedUserTypes(string companyCode, string userCode, DataTable dtdivisionCodes, DataTable dtUserTypeCodes) { List <MVCModels.HiDoctor_Master.UserTypeSplashModel> lstUsertypes = new List <MVCModels.HiDoctor_Master.UserTypeSplashModel>(); SqlConnection objSqlConnection = new SqlConnection(); try { objSqlConnection = _objData.GetConnectionObject(companyCode); //lstUsertypes = connection.Query<MVCModels.HiDoctor_Master.UserTypeSplashModel>(USP_HD_GetSelectedUserTypeCodes, p, commandType: CommandType.StoredProcedure); string commtxt = "USP_HD_GetSelectedUserTypeCodes"; SqlCommand command = new SqlCommand(commtxt); command.CommandType = CommandType.StoredProcedure; SqlDataReader sqlReader; _objSPData.AddParamToSqlCommand(command, "@Company_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); if (dtUserTypeCodes.Rows.Count == 0) { _objSPData.AddParamToSqlCommandWithTypeName(command, "@TVP_UserTypeCode", ParameterDirection.Input, SqlDbType.Structured, null, "TVP_UserTypeCode"); } else { _objSPData.AddParamToSqlCommandWithTypeName(command, "@TVP_UserTypeCode", ParameterDirection.Input, SqlDbType.Structured, dtUserTypeCodes, "TVP_UserTypeCode"); } if (dtdivisionCodes.Rows.Count == 0) { _objSPData.AddParamToSqlCommandWithTypeName(command, "@TVP_DivisionCode", ParameterDirection.Input, SqlDbType.Structured, null, "TVP_DivisionCode"); } else { _objSPData.AddParamToSqlCommandWithTypeName(command, "@TVP_DivisionCode", ParameterDirection.Input, SqlDbType.Structured, dtdivisionCodes, "TVP_DivisionCode"); } objSqlConnection.Open(); command.Connection = objSqlConnection; using (sqlReader = _objData.ExecuteReader(command)) { while (sqlReader.Read()) { MVCModels.HiDoctor_Master.UserTypeSplashModel lstUsertypecodes = new MVCModels.HiDoctor_Master.UserTypeSplashModel(); lstUsertypecodes.User_Code = sqlReader["User_Code"].ToString(); lstUsertypes.Add(lstUsertypecodes); } } } catch (Exception ex) { Dictionary <string, string> dicObj = new Dictionary <string, string>(); Impl.ExceptionHandler.WriteLog(ex: ex, dic: dicObj); return(null); } finally { _objData.CloseConnection(); } return(lstUsertypes); }
public List <Models.MasterModel> UserDetails(string userCode, string companyCode) { try { List <Models.MasterModel> lstUserDetail = new List <Models.MasterModel>(); _objData.OpenConnection(companyCode); using (IDataReader reader = _objData.ExecuteReader("exec SP_hdGetTpVsActualDeviationSummary '" + companyCode + "', '" + userCode + "','','','USER'")) { lstUserDetail = DataReaderMapToList <Models.MasterModel>(reader); } _objData.CloseConnection(); return(lstUserDetail); } catch (Exception ex) { throw ex; } finally { _objData.CloseConnection(); } }