示例#1
0
        /// <summary>
        /// Description  : To Show all the Workorders SearchWO List 
        /// Created By   : hussain
        /// Created Date : 27 May 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns>it will give all the Workorders details available in database</returns>
        public static WorkOrderInfo GetWorkOrderDetailsById(int ID)
        {
            var data = new WorkOrderInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                var getWorkOrder = new List<WorkOrders>();
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0] = new SqlParameter("@ID", ID);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetWorkorderById", sqlParams);
                var WorkOrderList = new WorkOrders();
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    WorkOrderList.FetchingSerchWODataByWO(WorkOrderList, safe);
                    getWorkOrder.Add(WorkOrderList);
                }
                data.WorkOrdersList = getWorkOrder;

                reader.NextResult();
                while (reader.Read())
                {
                    var Assignment = new WOAssignment();
                    Assignment.FetchWOAssignmentDetails(Assignment, safe);
                    data.WOAssignment.Add(Assignment);
                }
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
示例#2
0
 public WOAssignment FetchWOAssignmentDetails(WOAssignment objAssignment, SafeDataReader dr)
 {
     objAssignment.AssignedTo = dr.GetString("AssignedTo");
     objAssignment.GroupName = dr.GetString("AssignedToGroup");
     return objAssignment;
 }