コード例 #1
0
        public static WorkerCollection GetTypedWorkers(BusinessObjects.WorkManagement.AreaDetails areaDetails, eMobileIdentityType identityType)
        {
            DataSet dsResults = null;
            FinalBuild.DataAccess objADO = new DataAccess();
            System.Collections.ArrayList colParameters = new System.Collections.ArrayList();
            string strStoredProcedure = "selWorkersMatchingCriteria";

            // Assemble Parameters
            if(areaDetails.SubArea != null && !string.IsNullOrEmpty(areaDetails.SubArea.Name))
            {
                colParameters.Add(new SqlParameter("@SubArea", areaDetails.SubArea.Name));
            }
            colParameters.Add(new SqlParameter("@MobileIdentityType", identityType.ToString()));
            if(areaDetails.PrimaryArea != null && !string.IsNullOrEmpty(areaDetails.PrimaryArea.Name))
            {
                colParameters.Add(new SqlParameter("@PrimaryArea", areaDetails.PrimaryArea.Name));
            }

            dsResults = objADO.GetDataSet(strStoredProcedure, (SqlParameter[])colParameters.ToArray(typeof(SqlParameter)));

            return WorkerCollection.PopulateTyped(dsResults, string.Empty);
        }
コード例 #2
0
        public static bool SaveUserDetails(string userID, AreaDetails areaDetails, eMobileIdentityType identityType, string displayName, string isClickEngineer)
        {
            DataAccess objADO = new DataAccess();
            ArrayList colParameters = new ArrayList();
            string strStoredProcedure = "updUserDetails";

            colParameters.Add(new SqlParameter("@UserID", userID));
            colParameters.Add(new SqlParameter("@PrimaryArea", areaDetails.PrimaryArea.Name));
            if (areaDetails.SubArea != null && areaDetails.SubArea.Name != null && areaDetails.SubArea.Name != string.Empty)
            {
                colParameters.Add(new SqlParameter("@SubArea", areaDetails.SubArea.Name));
            }
            if (displayName != null && displayName != string.Empty)
            {
                colParameters.Add(new SqlParameter("@DisplayName", displayName));
            }
            colParameters.Add(new SqlParameter("@MobileIdentityType", identityType.ToString()));

            if (isClickEngineer != null && isClickEngineer != string.Empty)
            {
                bool isClickEngineerValue = false;
                if (isClickEngineer == "1")
                    isClickEngineerValue = true;
 
                colParameters.Add(new SqlParameter("@IsClickEngineer", isClickEngineerValue));
            }

            int intReturn = objADO.ExecuteSQL(strStoredProcedure, (SqlParameter[])colParameters.ToArray(typeof(SqlParameter)));
            objADO = null;

            return (intReturn > 0);
        }