Ejemplo n.º 1
0
        public static CustomList <ProductionDataCapture> GetAllProductionDataCaptureEmp(string empCode)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <ProductionDataCapture> ProductionDataCaptureCollection = new CustomList <ProductionDataCapture>();
            IDataReader reader = null;
            String      sql    = "select EmpCode,EmpKey,EmpName from HRM_Emp Where EmpCode='" + empCode + "'";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    ProductionDataCapture newProductionDataCapture = new ProductionDataCapture();
                    newProductionDataCapture.SetDataEmp(reader);
                    ProductionDataCaptureCollection.Add(newProductionDataCapture);
                }
                return(ProductionDataCaptureCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Ejemplo n.º 2
0
        public static CustomList <ProductionDataCapture> GetAllProductionDataCapture(string date)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <ProductionDataCapture> ProductionDataCaptureCollection = new CustomList <ProductionDataCapture>();
            IDataReader reader = null;
            String      sql    = "select *from ProductionDataCapture Where ProcessDate='" + date + "'";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    ProductionDataCapture newProductionDataCapture = new ProductionDataCapture();
                    newProductionDataCapture.SetData(reader);
                    ProductionDataCaptureCollection.Add(newProductionDataCapture);
                }
                ProductionDataCaptureCollection.InsertSpName = "spInsertProductionDataCapture";
                ProductionDataCaptureCollection.UpdateSpName = "spUpdateProductionDataCapture";
                ProductionDataCaptureCollection.DeleteSpName = "spDeleteProductionDataCapture";
                return(ProductionDataCaptureCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }