private int GetOTPayrollItem(string RegHoursID) { using (clsDataGetter dg = new clsDataGetter(CommonProcs.WCompanyConnStr)) { string branchStr = GetCurrentBranch(); string nameSQL = "SELECT name FROM PayrollItem "; nameSQL += "WHERE payItemID=" + RegHoursID; string itemName = dg.GetScalarString(nameSQL); string[] nameParts = itemName.Split('-'); itemName = nameParts[0] + "-" + nameParts[1]; string IDSql = "SELECT payItemID FROM PayrollItem "; IDSql += "WHERE Name LIKE '%" + itemName + "-OT' "; IDSql += "AND WageType = 'HourlyOvertime' "; IDSql += "AND QBFile='" + GetCurrentCompany() + "'"; return(dg.GetScalarInteger(IDSql)); } }
private static string LookupEmail(string type, bool isDistrict) { Dist23Data db = new Dist23Data(); clsDataGetter dg = new clsDataGetter(db.Database.Connection.ConnectionString); string sql = "SELECT email FROM contacts c "; sql += "INNER JOIN ContactPosition cp ON cp.contactID = c.pKey "; sql += "INNER JOIN positions p ON p.pKey = cp.PositionID "; sql += "INNER JOIN groups g ON g.pKey = cp.GroupID "; sql += "WHERE positionName = '" + type + "' "; sql += "AND g.DistKey = " + GlobalVariables.DistKey; if (isDistrict) { sql += " AND g.isDistrict = 1"; } string email = dg.GetScalarString(sql); return(email); }