Пример #1
0
        /// <summary>
        /// Description  : Get WOStatus History by WOID
        /// Created By   : SHIVA
        /// Created Date : 25 July 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns>WOStatus History by WOID</returns>
        public static WOStatusAndAssignmentInfo GetWOStatusHistoryByWOID(int WOID)
        {
            var WOStatus = new WOStatusAndAssignmentInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                var lstWOStatus = new List<WOStatusAndAssignment>();
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0] = new SqlParameter("@WOID", WOID);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetWOStatusHistoryByWOID", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var getWOAssignment = new WOStatusAndAssignment();
                    getWOAssignment.FetchStatusHistory(getWOAssignment, safe);
                    lstWOStatus.Add(getWOAssignment);
                }
                WOStatus.WOStatusAndAssignmentInfoList = lstWOStatus;
                return WOStatus;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return WOStatus;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }