Exemple #1
0
        /// <summary>
        /// Description  : Get ID and Name from MWorkOrderType from database for Type dropdown in WorkOrder. 
        /// Created By   : Shiva
        /// Created Date : 20 May 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns></returns>
        public static WorkOrderInfo GetWorkOrderType()
        {
            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 lstWorkOrder = new List<WorkOrders>();

                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SPGetMWorkOrderType");
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var getIDFromDIType = new WorkOrders();
                    getIDFromDIType.FetchWorkOrderType(getIDFromDIType, safe);
                    lstWorkOrder.Add(getIDFromDIType);
                }
                data.WorkOrdersList = lstWorkOrder;
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
Exemple #2
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);
            }
        }
Exemple #3
0
        /// <summary>
        /// Description  : To get MWOType by Category Code.
        /// Created By   : Shiva
        /// Created Date : 15 July 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns></returns>
        public static WorkOrderInfo GetMWOTypeByCategoryCode(string CategoryCode)
        {
            var WOTypeByCategoryCodeData = new WorkOrderInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                var lstWOType = new List<WorkOrders>();
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0] = new SqlParameter("@CategoryCode", CategoryCode);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetMWOTypeByCategoryCode", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var GetMWOType = new WorkOrders();
                    GetMWOType.FetchWOTypeOrCategory(GetMWOType, safe);
                    lstWOType.Add(GetMWOType);
                }
                WOTypeByCategoryCodeData.WorkOrdersList = lstWOType;
                return WOTypeByCategoryCodeData;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return WOTypeByCategoryCodeData;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
Exemple #4
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 GetSerchWOData(string ClientId, string SourceID, string WorkOrderID, string statusCode, int startpage, int rowsperpage, string Type, string OrderBy, string FromDate, string ToDate, int CreatedBy, string IsAdhoc, string AssignedTo)
        {
            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[13];
                sqlParams[0] = new SqlParameter("@startPage", startpage);
                sqlParams[1] = new SqlParameter("@resultPerPage", rowsperpage);
                sqlParams[2] = new SqlParameter("@ClientId", ClientId);
                sqlParams[3] = new SqlParameter("@SourceID", SourceID);
                sqlParams[4] = new SqlParameter("@WorkOrderID", WorkOrderID);
                sqlParams[5] = new SqlParameter("@status", statusCode);
                sqlParams[6] = new SqlParameter("@Type", Type);
                sqlParams[7] = new SqlParameter("@OrderBy", OrderBy);
                sqlParams[8] = new SqlParameter("@FromDate", HelperClasses.ConvertDateFormat(FromDate));
                sqlParams[9] = new SqlParameter("@ToDate", HelperClasses.ConvertDateFormat(ToDate));
                sqlParams[10] = new SqlParameter("@CreatedBy", CreatedBy);
                sqlParams[11] = new SqlParameter("@IsAdhoc", IsAdhoc);
                sqlParams[12] = new SqlParameter("@AssignedTo", AssignedTo);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "[SpGetAllWorkOrder]", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var WorkOrderList = new WorkOrders();
                    WorkOrderList.FetchingSerchWOData(WorkOrderList, safe);
                    getWorkOrder.Add(WorkOrderList);
                    data.workorderCount = Convert.ToInt32(reader["Workordercount"]);
                }
                data.WorkOrdersList = getWorkOrder;
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
Exemple #5
0
        /// <summary>
        /// Description  : To get DashBord Details.
        /// Created By   : Sudheer  
        /// Created Date : 7th Oct 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns></returns>
        public static object GetDashbordDetails()
        {
            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>();
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetDashbordDetails");
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var WorkOrderList = new WorkOrders();
                    WorkOrderList.FetchingSerchWOData(WorkOrderList, safe);
                    getWorkOrder.Add(WorkOrderList);
                    data.workorderCount = Convert.ToInt32(reader["Workordercount"]);
                }
                data.WorkOrdersList = getWorkOrder;
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }