Ejemplo n.º 1
0
        /// <summary>
        /// Get all the modelWorkOrder.
        /// </summary>
        /// <param name="modelWorkOrder">modelWorkOrder Identifier</param>
        /// <returns></returns>
        public List <SOFTTEK.SCMS.Entity.FA.WorkOrder> SearchWorkOrders(SOFTTEK.SCMS.Entity.FA.WorkOrder modelWorkOrder)
        {
            List <SOFTTEK.SCMS.Entity.FA.WorkOrder> listWorkOrders = new List <SOFTTEK.SCMS.Entity.FA.WorkOrder>();

            return(context.Execute(() =>
            {
                using (dataSource = new FAMDataContext(context.SecurityContext))
                {
                    dataSource.ConnectionString = "SRA";
                    dataSource.DefaultUser = System.Configuration.ConfigurationManager.AppSettings["S_APP_UID"];
                    dataSource.Initialize();

                    var results = dataSource.GetWorkOrders(modelWorkOrder);
                    listWorkOrders = results;
                }

                return listWorkOrders;
            }, "Retrieve the registered WorkOrders in system."));
        }