상속: esEmployeesCollection
예제 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            InitService();

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button   button  = FindViewById <Button> (Resource.Id.myButton);
            EditText textbox = FindViewById <EditText> (Resource.Id.myTextBox);

            button.Click += delegate {
                BusinessObjects.EmployeesCollection coll = client.Employees_LoadAll();

                string text = "";
                foreach (Employees emp in coll)
                {
                    text += emp.LastName + ", " + emp.FirstName + "\r\n";
                }

                textbox.Text = text;
            };
        }
예제 #2
0
        public jsResponse<EmployeesCollection, Employees> EmployeesCollection_LoadAll()
        {
            jsResponse<EmployeesCollection, Employees> response = new jsResponse<EmployeesCollection, Employees>();

            try
            {
                EmployeesQuery q = new EmployeesQuery();
                q.Select(q.EmployeeID, q.FirstName, q.LastName);

                EmployeesCollection collection = new EmployeesCollection();
                collection.Load(q);

                if(collection.Count == 0)
                {
                    EnsureData();

                    collection = new EmployeesCollection();
                    collection.LoadAll();
                }

                response.collection = collection;
            }
            catch (Exception ex)
            {
                response.exception = ex.Message;
            }

            return response;
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            coll = new EmployeesCollection();
            coll.LoadAll();

            _bindingSource.DataSource = coll;
        }
예제 #4
0
        public EmployeesCollection.EmployeesCollectionWCFPacket Employees_LoadAll()
        {
            EmployeesCollection coll = new EmployeesCollection();
            if (coll.LoadAll())
            {
                return coll;
            }

            return null;
        }
예제 #5
0
        public EmployeesCollection.EmployeesCollectionWCFPacket Employees_SaveCollection(EmployeesCollection.EmployeesCollectionWCFPacket collection)
        {
            if (collection != null)
            {
                collection.Collection.Save();
                return collection;
            }

            return null;
        }
        public EmployeesCollection Employees_Prefetch()
        {
            // Very simplistic prefetch ..
            EmployeesCollection coll = new EmployeesCollection();
            coll.Query.Prefetch(Employees.Prefetch_OrdersCollectionByEmployeeID);
            coll.Query.Prefetch(Employees.Prefetch_OrdersCollectionByEmployeeID, Orders.Prefetch_OrderDetailsCollectionByOrderID);
            coll.Query.Load();

            return coll;
        }
예제 #7
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     try
     {
         coll = svc.Employees_SaveCollection(coll);
         coll.EnableHierarchicalBinding = false;
         _bindingSource.DataSource      = coll;
     }
     catch (Exception ex)
     {
         lblError.Text = ex.Message;
     }
 }
        public Hierarchical()
        {
            InitializeComponent();

            EmployeesQuery q = new EmployeesQuery();
            q.es.Top = 15;
            q.Select(q.EmployeeID, q.FirstName, q.LastName, q.BirthDate.As("ExtraColumn"));

            EmployeesCollection coll = new EmployeesCollection();
            coll.Load(q);

            dataGrid1.DataSource = coll;
        }
예제 #9
0
        public EmployeesCollection.EmployeesCollectionWCFPacket Employees_QueryForCollection(string serializedQuery)
        {
            EmployeesQuery query = EmployeesQuery.SerializeHelper.FromXml(
                serializedQuery, typeof(EmployeesQuery), AllKnownTypes) as EmployeesQuery;

            EmployeesCollection coll = new EmployeesCollection();
            if (coll.Load(query))
            {
                return coll;
            }

            return null;
        }
        public Form1()
        {
            InitializeComponent();

            this.dataGrid.AutoGenerateColumns = true;

            EmployeesQuery q = new EmployeesQuery();
            q.Select(q.EmployeeID, q.FirstName, q.LastName, q.HireDate, q.BirthDate, (q.LastName + ", " + q.FirstName).As("Fullname"));

            EmployeesCollectionProxyStub proxyColl = svc.Employees_QueryForCollection(EmployeesQuery.SerializeHelper.ToXml(q));

            _bindingSource.DataSource = coll = proxyColl.GetCollection();
        }
예제 #11
0
        private void buttonQuery_Click(object sender, EventArgs e)
        {
            EmployeesQuery q = new EmployeesQuery("emp");

            q.Select(q.EmployeeID, q.FirstName, q.LastName, q.HireDate, q.BirthDate);

            q.Where(q.LastName.Like("%" + txtLastName.Text + "%"));
            q.OrderBy(q.LastName.Ascending);

            coll = svc.Employees_QueryForCollection(EmployeesQuery.SerializeHelper.ToXml(q));
            coll.EnableHierarchicalBinding = false;
            _bindingSource.DataSource      = coll;
        }
예제 #12
0
        public Form1()
        {
            InitializeComponent();

            this.dataGrid.AutoGenerateColumns = true;

            EmployeesQuery q = new EmployeesQuery();

            q.Select(q.EmployeeID, q.FirstName, q.LastName, q.HireDate, q.BirthDate, (q.LastName + ", " + q.FirstName).As("Fullname"));

            EmployeesCollectionProxyStub proxyColl = svc.Employees_QueryForCollection(EmployeesQuery.SerializeHelper.ToXml(q));

            _bindingSource.DataSource = coll = proxyColl.GetCollection();
        }
예제 #13
0
파일: Form1.cs 프로젝트: BrewDawg/Tiraggo
 private void LoadGrid()
 {
     try
     {
         coll = new EmployeesCollection();
         if (coll.LoadAll())
         {
             grid.DataSource = coll;
         }
     }
     catch (Exception ex)
     {
         throw;
         //string error = ex.Message;
     }
 }
예제 #14
0
        public jsResponse<EmployeesCollection, Employees> EmployeesCollection_Save(EmployeesCollection collection)
        {
            jsResponse<EmployeesCollection, Employees> response = new jsResponse<EmployeesCollection, Employees>();

            try
            {
                collection.Save();
                response.collection = collection;
            }
            catch (Exception ex)
            {
                response.exception = ex.Message;
            }

            return response;
        }
예제 #15
0
        private void buttonSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (coll.IsDirty)
                {
                    EmployeesCollectionProxyStub proxyColl = new EmployeesCollectionProxyStub(coll);
                    proxyColl = svc.Employees_SaveCollection(proxyColl);

                    _bindingSource.DataSource = coll = proxyColl.GetCollection();
                }
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message;
            }
        }
예제 #16
0
        private void buttonQuery_Click(object sender, EventArgs e)
        {
            EmployeesQuery q = new EmployeesQuery("emp");

            q.Where(q.LastName.Like("%" + txtLastName.Text + "%"));
            q.OrderBy(q.LastName.Ascending);

            EmployeesCollectionProxyStub proxyColl = svc.Employees_QueryForCollection(EmployeesQuery.SerializeHelper.ToXml(q));

            if (proxyColl != null)
            {
                _bindingSource.DataSource = coll = proxyColl.GetCollection();
            }
            else
            {
                _bindingSource.DataSource = coll = new BusinessObjects.EmployeesCollection();
            }
        }
        public Form1()
        {
            InitializeComponent();

            System.Net.ServicePointManager.Expect100Continue = false;

            this.dataGrid.AutoGenerateColumns = true;

            EmployeesQuery q = new EmployeesQuery();
            q.Select(q.EmployeeID, q.FirstName, q.LastName, q.HireDate, q.BirthDate);

            coll = svc.Employees_QueryForCollection(EmployeesQuery.SerializeHelper.ToXml(q));

            coll.EnableHierarchicalBinding = false;

            _bindingSource.DataSource = coll;

        }
예제 #18
0
        public Form1()
        {
            InitializeComponent();

            System.Net.ServicePointManager.Expect100Continue = false;

            this.dataGrid.AutoGenerateColumns = true;

            EmployeesQuery q = new EmployeesQuery();

            q.Select(q.EmployeeID, q.FirstName, q.LastName, q.HireDate, q.BirthDate);

            coll = svc.Employees_QueryForCollection(EmployeesQuery.SerializeHelper.ToXml(q));

            coll.EnableHierarchicalBinding = false;

            _bindingSource.DataSource = coll;
        }
        public EmployeesCollection Employees_PrefetchSophisticated()
        {
            // EmployeeID = "1"
            EmployeesCollection coll = new EmployeesCollection();
            coll.Query.Where(coll.Query.EmployeeID == 1);

            // Orders Query (nothing fancy, just ensure we're only getting Orders for EmployeeID = 1
            OrdersQuery o = coll.Query.Prefetch<OrdersQuery>(Employees.Prefetch_OrdersCollectionByEmployeeID);
            EmployeesQuery e1 = o.GetQuery<EmployeesQuery>();
            o.Where(e1.EmployeeID == 1);

            // OrderDetailsQuery (here we even limit the Select in addition to  EmployeeID = 1) notice the "false"
            OrderDetailsQuery od = coll.Query.Prefetch<OrderDetailsQuery>(false, Employees.Prefetch_OrdersCollectionByEmployeeID, Orders.Prefetch_OrderDetailsCollectionByOrderID);
            EmployeesQuery e2 = od.GetQuery<EmployeesQuery>();
            od.Where(e2.EmployeeID == 1);
            od.Select(od.OrderID, od.ProductID, od.UnitPrice);

            coll.Query.Load();
            return coll;
        }
        public jsResponse<EmployeesCollection, Employees> Employees_LoadHierarchical()
        {
            jsResponse<EmployeesCollection, Employees> response = new jsResponse<EmployeesCollection, Employees>();

            try
            {
                // The Main Query
                EmployeesQuery q = new EmployeesQuery("e");
                q.Select(q.EmployeeID, q.FirstName, q.LastName, q.City, q.Country, q.HomePhone, q.Region, q.PostalCode, q.Title);
                q.Where(q.EmployeeID < 7);

                // The OrdersCollection
                OrdersQuery o1 = q.Prefetch<OrdersQuery>(Employees.Prefetch_OrdersCollectionByEmployeeID);
                EmployeesQuery emp1 = o1.GetQuery<EmployeesQuery>();
                o1.Where(emp1.EmployeeID < 7);

                // The OrdersDetailsCollection
                OrderDetailsQuery od = q.Prefetch<OrderDetailsQuery>(Employees.Prefetch_OrdersCollectionByEmployeeID, Orders.Prefetch_OrderDetailsCollectionByOrderID);
                EmployeesQuery emp2 = od.GetQuery<EmployeesQuery>();
                OrdersQuery o2 = od.GetQuery<OrdersQuery>();
                od.Where(emp2.EmployeeID < 7);

                // Load It
                EmployeesCollection coll = new EmployeesCollection();
                if (coll.Load(q))
                {
                    response.collection = coll;

                    response.columnCollection["Employees"] = jsColumn.PopulateColumns(coll[0]);
                    response.columnCollection["Orders"] = jsColumn.PopulateColumns(coll[0].OrdersCollectionByEmployeeID[0]);
                    response.columnCollection["OrderDetails"] = jsColumn.PopulateColumns(coll[0].OrdersCollectionByEmployeeID[0].OrderDetailsCollectionByOrderID[0]);
                }
            }
            catch (Exception ex)
            {
                response.exception = ex.Message;
            }

            return response;
        }
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            btnAdd.Enabled = true;
            btnDelete.Enabled = true;
            btnSave.Enabled = true;

            coll = new EmployeesCollection();
            coll.LoadAll();

            _bindingSource.DataSource = coll;
        }
        private void buttonQuery_Click(object sender, EventArgs e)
        {
            EmployeesQuery q = new EmployeesQuery("emp");

            q.Where(q.LastName.Like("%" + txtLastName.Text + "%"));
            q.OrderBy(q.LastName.Ascending);

            EmployeesCollectionProxyStub proxyColl = svc.Employees_QueryForCollection(EmployeesQuery.SerializeHelper.ToXml(q));

            if (proxyColl != null)
            {
                _bindingSource.DataSource = coll = proxyColl.GetCollection();
            }
            else
            {
                _bindingSource.DataSource = coll = new BusinessObjects.EmployeesCollection();
            }
        }
        private void buttonSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (coll.IsDirty)
                {
                    EmployeesCollectionProxyStub proxyColl = new EmployeesCollectionProxyStub(coll);
                    proxyColl = svc.Employees_SaveCollection(proxyColl);

                    _bindingSource.DataSource = coll = proxyColl.GetCollection();
                }
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message;
            }
        }
        private void buttonQuery_Click(object sender, EventArgs e)
        {
            EmployeesQuery q = new EmployeesQuery("emp");
            q.Select(q.EmployeeID, q.FirstName, q.LastName, q.HireDate, q.BirthDate);

            q.Where(q.LastName.Like("%" + txtLastName.Text + "%"));
            q.OrderBy(q.LastName.Ascending);

            coll = svc.Employees_QueryForCollection(EmployeesQuery.SerializeHelper.ToXml(q));
            coll.EnableHierarchicalBinding = false;
            _bindingSource.DataSource = coll;
        }
		public EmployeesCollectionProxyStub Employees_LoadAll()
		{
			EmployeesCollection coll = new EmployeesCollection();
			if (coll.LoadAll())
			{
				return coll;
			}

			return null;
		}		
		public EmployeesCollection Employees_LoadByDynamic(string serializedQuery)
		{
			EmployeesQuery query = EmployeesQuery.SerializeHelper.FromXml(
				serializedQuery, typeof(EmployeesQuery), AllKnownTypes) as EmployeesQuery;

			EmployeesCollection coll = new EmployeesCollection();
			coll.es.IsLazyLoadDisabled = true;
			coll.Load(query);
			return coll;
		}
		public EmployeesCollection Employees_LoadAll()
		{
			EmployeesCollection coll = new EmployeesCollection();
			coll.es.IsLazyLoadDisabled = true;
			coll.LoadAll();
			return coll;
		}
		public jsResponse<EmployeesCollection, Employees> EmployeesCollection_LoadAll()
		{
			jsResponse<EmployeesCollection, Employees> response = new jsResponse<EmployeesCollection, Employees>();

			try
			{
				EmployeesCollection collection = new EmployeesCollection();
				collection.LoadAll();
				response.collection = collection;
			}
			catch (Exception ex)
			{
				response.exception = ex.Message;
			}

			return response;
		}
        private void btnDynamicQuery_Click(object sender, EventArgs e)
        {
            btnAdd.Enabled = false;
            btnDelete.Enabled = false;
            btnSave.Enabled = false;

            EmployeesQuery eq = new EmployeesQuery("eq");
            OrdersQuery oq = new OrdersQuery("oq");

            eq.Select(eq.EmployeeID, eq.LastName, eq.FirstName, oq.OrderID, oq.ShipCity);
            eq.InnerJoin(oq).On(eq.EmployeeID == oq.EmployeeID);

            coll = new EmployeesCollection();
            coll.Load(eq);

            _bindingSource.DataSource = coll;
        }
 private void buttonSave_Click(object sender, EventArgs e)
 {
     try
     {
         coll = svc.Employees_SaveCollection(coll);
         coll.EnableHierarchicalBinding = false;
         _bindingSource.DataSource = coll;
     }
     catch (Exception ex)
     {
         lblError.Text = ex.Message;
     }
 }
        public jsResponse<EmployeesCollection, Employees> Employees_Pager(jsPagerRequest request)
        {
            jsResponse<EmployeesCollection, Employees> response = new jsResponse<EmployeesCollection, Employees>();

            try
            {
                // We send the the same data they sent us back
                response.pagerRequest = request;

                EmployeesQuery q = null;
                if (response.pagerRequest.getTotalRows == true)
                {
                    // Get the total count of rows in the Employee table
                    q = new EmployeesQuery();
                    q.es.CountAll = true;

                    response.pagerRequest.totalRows = q.ExecuteScalar<int>();
                }

                q = new EmployeesQuery();
                q.Select(q.EmployeeID, q.FirstName, q.LastName, q.Title);

                if (request.sortCriteria != null && request.sortCriteria.Length > 0)
                {
                    for (int i = 0; i < request.sortCriteria.Length; i++)
                    {
                        jsPagerSortCriteria sort = request.sortCriteria[i];

                        q.OrderBy(sort.column, sort.direction.ToUpper().StartsWith("A") ?
                            esOrderByDirection.Ascending : esOrderByDirection.Descending);
                    }
                }
                else
                {
                    // Default sort if none is specified
                    q.OrderBy(q.EmployeeID.Ascending);
                }

                if (request.filterCriteria != null && request.filterCriteria.Length > 0)
                {
                    esComparison comp = null;

                    for (int i = 0; i < request.filterCriteria.Length; i++)
                    {
                        jsPagerFilterCriteria filter = request.filterCriteria[i];
                        comp = q.ManualWhere(filter.column, filter.operation, filter.criteria1, filter.criteria2, filter.conjuction);
                    }

                    q.Where(comp);
                }

                // Set the paging indicators up
                q.es.PageNumber = request.pageNumber;
                q.es.PageSize = request.pageSize;

                EmployeesCollection coll = new EmployeesCollection();
                coll.Load(q);

                response.pagerRequest.getTotalRows = false;
                response.collection = coll;
            }
            catch (Exception ex)
            {
                response.exception = ex.Message;
            }

            return response;
        }