Exemplo n.º 1
0
        private int DeleteTerritory()
        {
            Cursor.Current = Cursors.WaitCursor;
            SalesTerritory st     = new SalesTerritory();
            int            terrID = 0;

            try
            {
                terrID = Int32.Parse(lblTerritoryID.Text);
            }
            catch
            {
                MessageBox.Show("Select a territory to delete", "Sales Territory", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Cursor.Current = Cursors.Default;
                return(0);
            }
            try
            {
                st.RemoveSalesTerritory(terrID);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Sales Territory", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                st             = null;
                Cursor.Current = Cursors.Default;
            }
            return(terrID);
        }
Exemplo n.º 2
0
        ///<summary>
        ///  Returns a Typed SalesTerritoryHistory Entity with mock values.
        ///</summary>
        static public SalesTerritoryHistory CreateMockInstance_Generated(TransactionManager tm)
        {
            SalesTerritoryHistory mock = new SalesTerritoryHistory();

            mock.StartDate    = TestUtility.Instance.RandomDateTime();
            mock.EndDate      = TestUtility.Instance.RandomDateTime();
            mock.ModifiedDate = TestUtility.Instance.RandomDateTime();

            //OneToOneRelationship
            SalesPerson mockSalesPersonBySalesPersonId = SalesPersonTest.CreateMockInstance(tm);

            DataRepository.SalesPersonProvider.Insert(tm, mockSalesPersonBySalesPersonId);
            mock.SalesPersonId = mockSalesPersonBySalesPersonId.SalesPersonId;
            //OneToOneRelationship
            SalesTerritory mockSalesTerritoryByTerritoryId = SalesTerritoryTest.CreateMockInstance(tm);

            DataRepository.SalesTerritoryProvider.Insert(tm, mockSalesTerritoryByTerritoryId);
            mock.TerritoryId = mockSalesTerritoryByTerritoryId.TerritoryId;

            // create a temporary collection and add the item to it
            TList <SalesTerritoryHistory> tempMockCollection = new TList <SalesTerritoryHistory>();

            tempMockCollection.Add(mock);
            tempMockCollection.Remove(mock);


            return((SalesTerritoryHistory)mock);
        }
Exemplo n.º 3
0
        private void PopulateTerritories(int selectedID)
        {
            SalesTerritory st = new SalesTerritory();

            colTerritories = new SalesTerritoryCollection();
            try
            {
                colTerritories           = st.GetAllSalesTerritoryCollection();
                gridTerritory.DataSource = colTerritories;
                gridTerritory.Columns.Remove("ModifiedDate");
                gridTerritory.Columns["TerritoryID"].Visible = false;
                gridTerritory.Columns.Remove("CountryRegionCode");
                int index = 0;
                foreach (SalesTerritory t in colTerritories)
                {
                    if (t.TerritoryID == selectedID)
                    {
                        gridTerritory.Rows[index].Selected            = true;
                        gridTerritory.FirstDisplayedScrollingRowIndex = index;
                        break;
                    }
                    index++;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Sales Territory", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 4
0
        private int AddTerritory()
        {
            Cursor.Current = Cursors.WaitCursor;
            SalesTerritory st = new SalesTerritory();
            int            id = 0;

            try
            {
                string territory = txtTerritory.Text.Trim();
                st.Name              = territory;
                st.ModifiedDate      = DateTime.Now;
                st.CountryRegionCode = string.Empty;
                id = st.AddSalesTerritory(st);
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message, "Sales Territory", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
            return(id);
        }
Exemplo n.º 5
0
        public void SaveSalesTerritory(SalesTerritory salesTerritory)
        {
            string connectionString = ConfigurationManager.ConnectionStrings["CustomerDatabase"].ConnectionString;

            // Test to see if there is a valid database connection.
            // Return null if there isn't.
            // Since this is a demo app, the users should be able to use it whether or not a valid database exists or not.
            SqlConnection testConnection = new SqlConnection(connectionString);

            try
            {
                testConnection.Open();
            }
            catch (Exception ex)
            {
                logger.Fatal(ex.ToString());
                testConnection.Close();
                return;
            }
            testConnection.Close();


            try
            {
                SaveSalesTerritoryADO("dbo.SaveSalesTerritory", salesTerritory);
            }
            catch (Exception ex)
            {
                logger.Fatal(ex.ToString());
                throw;
            }
            return;
        }
Exemplo n.º 6
0
        public void ExportTerritories()
        {
            SqlCompactConnection conn = new SqlCompactConnection();
            SalesTerritory       ter  = new SalesTerritory();

            try
            {
                SalesTerritoryCollection colTerr = ter.GetAllSalesTerritoryCollection();
                conn.SynchForm = this;
                conn.DropSalesTerritoryTable();
                conn.CreateTerritoryTable();
                conn.AddSalesTerritory(colTerr);
                ter     = null;
                colTerr = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                conn.CloseDatabase();
                conn = null;
            }
        }
Exemplo n.º 7
0
        public IHttpActionResult PutSalesTerritory(int id, SalesTerritory salesTerritory)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != salesTerritory.TerritoryID)
            {
                return(BadRequest());
            }

            db.Entry(salesTerritory).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SalesTerritoryExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 8
0
 public TerritoryData(SalesTerritory st)
 {
     this.TerritoryID       = st.TerritoryID;
     this.Name              = st.Name;
     this.CountryRegionCode = st.CountryRegionCode;
     this.Group             = st.Group;
 }
Exemplo n.º 9
0
        private SalesTerritory SaveSalesTerritoryADO(string queryString, SalesTerritory salesTerritory)
        {
            // Create and open the connection in a using block. This
            // ensures that all resources will be closed and disposed
            // when the code exits.
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                SqlCommand command = new SqlCommand(queryString, connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.AddWithValue("@TerritoryID", salesTerritory.territoryID);
                command.Parameters.AddWithValue("@Name", salesTerritory.region);
                command.Parameters.AddWithValue("@Country", salesTerritory.country);
                command.Parameters.AddWithValue("@Group", salesTerritory.group);
                command.Parameters.AddWithValue("@SalesYTD", salesTerritory.salesYTD);
                command.Parameters.AddWithValue("@SalesLastYear", salesTerritory.salesLastYear);
                command.Parameters.AddWithValue("@CostYTD", salesTerritory.costYTD);
                command.Parameters.AddWithValue("@CostLastYear", salesTerritory.costLastYear);

                try
                {
                    connection.Open();
                    salesTerritory.territoryID = (int)command.ExecuteScalar();
                }
                catch (Exception ex)
                {
                    logger.Fatal(ex.ToString());
                    throw;
                }
            }

            return(salesTerritory);
        }
Exemplo n.º 10
0
        public int AddSalesTerritory(SalesTerritory ST)
        {
            IDBManager dbm = new DBManager();

            try
            {
                dbm.CreateParameters(4);

                dbm.AddParameters(0, "@Name", ST.Name);
                dbm.AddParameters(1, "@CountryRegionCode", ST.CountryRegionCode);
                dbm.AddParameters(2, "@ModifiedDate", DateTime.Now);
                dbm.AddParameters(3, "@TerritoryID", ST.TerritoryID);
                dbm.Parameters[3].Direction = ParameterDirection.Output;
                dbm.ExecuteNonQuery(CommandType.StoredProcedure, "InsertSalesTerritory");
                ST.TerritoryID = Int32.Parse(dbm.Parameters[3].Value.ToString());
            }
            catch (Exception ex)
            {
                log.Write(ex.Message, "InsertSalesTerritory");
                throw (ex);
            }
            finally
            {
                dbm.Dispose();
            }
            return(ST.TerritoryID);
        }
Exemplo n.º 11
0
        private void LoadTerritoris()
        {
            SalesTerritory           terr    = new SalesTerritory();
            SalesTerritoryCollection terrCol = new SalesTerritoryCollection();

            try
            {
                terrCol           = terr.GetAllSalesTerritoryCollection();
                terr.TerritoryID  = 0;
                terr.Name         = "All";
                terr.ModifiedDate = DateTime.Now;
                terrCol.Insert(0, terr);
                cmbTerritory.DataSource    = terrCol;
                cmbTerritory.DisplayMember = "Name";
                cmbTerritory.ValueMember   = "TerritoryID";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                terr = null;
            }
        }
Exemplo n.º 12
0
        public SalesTerritory GetSalesTerritory(int TerritoryID)
        {
            IDBManager     dbm = new DBManager();
            SalesTerritory ST  = new SalesTerritory();

            try
            {
                dbm.CreateParameters(1);
                dbm.AddParameters(0, "@TerritoryID", TerritoryID);
                IDataReader reader = dbm.ExecuteReader(CommandType.StoredProcedure, "SelectSalesTerritory");
                while (reader.Read())
                {
                    ST.TerritoryID       = Int32.Parse(reader["TerritoryID"].ToString());
                    ST.Name              = reader["Name"].ToString();
                    ST.CountryRegionCode = reader["CountryRegionCode"].ToString();
                    ST.ModifiedDate      = DateTime.Parse(reader["ModifiedDate"].ToString());
                }
            }
            catch (Exception ex)
            {
                log.Write(ex.Message, "GetSalesTerritory");
                throw (ex);
            }
            finally
            {
                dbm.Dispose();
            }
            return(ST);
        }
Exemplo n.º 13
0
        public SalesTerritoryCollection GetAllSalesTerritorysDynamicCollection(string whereExpression, string orderBy)
        {
            IDBManager dbm = new DBManager();
            SalesTerritoryCollection cols = new SalesTerritoryCollection();

            try
            {
                dbm.CreateParameters(2);
                dbm.AddParameters(0, "@WhereCondition", whereExpression);
                dbm.AddParameters(1, "@OrderByExpression", orderBy);
                IDataReader reader = dbm.ExecuteReader(CommandType.StoredProcedure, "SelectSalesTerritorysDynamic");
                while (reader.Read())
                {
                    SalesTerritory ST = new SalesTerritory();
                    ST.TerritoryID       = Int32.Parse(reader["TerritoryID"].ToString());
                    ST.Name              = reader["Name"].ToString();
                    ST.CountryRegionCode = reader["CountryRegionCode"].ToString();
                    ST.ModifiedDate      = DateTime.Parse(reader["ModifiedDate"].ToString());
                    cols.Add(ST);
                }
            }
            catch (Exception ex)
            {
                log.Write(ex.Message, "GetAllSalesTerritorysDynamicCollection");
                throw (ex);
            }
            finally
            {
                dbm.Dispose();
            }
            return(cols);
        }
Exemplo n.º 14
0
        public SalesTerritoryCollection GetAllSalesTerritorysCollection()
        {
            IDBManager dbm = new DBManager();
            SalesTerritoryCollection cols = new SalesTerritoryCollection();

            try
            {
                IDataReader reader = dbm.ExecuteReader(CommandType.StoredProcedure, "SelectSalesTerritoryAll");
                while (reader.Read())
                {
                    SalesTerritory ST = new SalesTerritory();
                    ST.TerritoryID       = Int32.Parse(reader["TerritoryID"].ToString());
                    ST.Name              = reader["Name"].ToString();
                    ST.CountryRegionCode = reader["CountryRegionCode"].ToString();
                    ST.ModifiedDate      = DateTime.Parse(reader["ModifiedDate"].ToString());
                    cols.Add(ST);
                }
            }
            catch (Exception ex)
            {
                log.Write(ex.Message, "GetAllSalesTerritorysCollection");
                throw (ex);
            }
            finally
            {
                dbm.Dispose();
            }
            return(cols);
        }
Exemplo n.º 15
0
        public async Task <IActionResult> Edit(int id, [Bind("TerritoryId,Name,CountryRegionCode,Group,SalesYtd,SalesLastYear,CostYtd,CostLastYear,Rowguid,ModifiedDate")] SalesTerritory salesTerritory)
        {
            if (id != salesTerritory.TerritoryId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(salesTerritory);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SalesTerritoryExists(salesTerritory.TerritoryId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CountryRegionCode"] = new SelectList(_context.CountryRegion, "CountryRegionCode", "CountryRegionCode", salesTerritory.CountryRegionCode);
            return(View(salesTerritory));
        }
Exemplo n.º 16
0
        /// <summary>
        /// Deep load all SalesTerritory children.
        /// </summary>
        private void Step_03_DeepLoad_Generated()
        {
            using (TransactionManager tm = CreateTransaction())
            {
                int count = -1;
                mock           = CreateMockInstance(tm);
                mockCollection = DataRepository.SalesTerritoryProvider.GetPaged(tm, 0, 10, out count);

                DataRepository.SalesTerritoryProvider.DeepLoading += new EntityProviderBaseCore <SalesTerritory, SalesTerritoryKey> .DeepLoadingEventHandler(
                    delegate(object sender, DeepSessionEventArgs e)
                {
                    if (e.DeepSession.Count > 3)
                    {
                        e.Cancel = true;
                    }
                }
                    );

                if (mockCollection.Count > 0)
                {
                    DataRepository.SalesTerritoryProvider.DeepLoad(tm, mockCollection[0]);
                    System.Console.WriteLine("SalesTerritory instance correctly deep loaded at 1 level.");

                    mockCollection.Add(mock);
                    // DataRepository.SalesTerritoryProvider.DeepSave(tm, mockCollection);
                }

                //normally one would commit here
                //tm.Commit();
                //IDisposable will Rollback Transaction since it's left uncommitted
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// Test Find using the Query class
        /// </summary>
        private void Step_30_TestFindByQuery_Generated()
        {
            using (TransactionManager tm = CreateTransaction())
            {
                //Insert Mock Instance
                SalesTerritory mock   = CreateMockInstance(tm);
                bool           result = DataRepository.SalesTerritoryProvider.Insert(tm, mock);

                Assert.IsTrue(result, "Could Not Test FindByQuery, Insert Failed");

                SalesTerritoryQuery query = new SalesTerritoryQuery();

                query.AppendEquals(SalesTerritoryColumn.TerritoryId, mock.TerritoryId.ToString());
                query.AppendEquals(SalesTerritoryColumn.Name, mock.Name.ToString());
                query.AppendEquals(SalesTerritoryColumn.CountryRegionCode, mock.CountryRegionCode.ToString());
                query.AppendEquals(SalesTerritoryColumn.Group, mock.Group.ToString());
                query.AppendEquals(SalesTerritoryColumn.SalesYtd, mock.SalesYtd.ToString());
                query.AppendEquals(SalesTerritoryColumn.SalesLastYear, mock.SalesLastYear.ToString());
                query.AppendEquals(SalesTerritoryColumn.CostYtd, mock.CostYtd.ToString());
                query.AppendEquals(SalesTerritoryColumn.CostLastYear, mock.CostLastYear.ToString());
                query.AppendEquals(SalesTerritoryColumn.Rowguid, mock.Rowguid.ToString());
                query.AppendEquals(SalesTerritoryColumn.ModifiedDate, mock.ModifiedDate.ToString());

                TList <SalesTerritory> results = DataRepository.SalesTerritoryProvider.Find(tm, query);

                Assert.IsTrue(results.Count == 1, "Find is not working correctly.  Failed to find the mock instance");
            }
        }
Exemplo n.º 18
0
        public async void Get()
        {
            var mock   = new ServiceMockFacade <ISalesTerritoryRepository>();
            var record = new SalesTerritory();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(record));
            var service = new SalesTerritoryService(mock.LoggerMock.Object,
                                                    mock.RepositoryMock.Object,
                                                    mock.ModelValidatorMockFactory.SalesTerritoryModelValidatorMock.Object,
                                                    mock.BOLMapperMockFactory.BOLSalesTerritoryMapperMock,
                                                    mock.DALMapperMockFactory.DALSalesTerritoryMapperMock,
                                                    mock.BOLMapperMockFactory.BOLCustomerMapperMock,
                                                    mock.DALMapperMockFactory.DALCustomerMapperMock,
                                                    mock.BOLMapperMockFactory.BOLSalesOrderHeaderMapperMock,
                                                    mock.DALMapperMockFactory.DALSalesOrderHeaderMapperMock,
                                                    mock.BOLMapperMockFactory.BOLSalesPersonMapperMock,
                                                    mock.DALMapperMockFactory.DALSalesPersonMapperMock,
                                                    mock.BOLMapperMockFactory.BOLSalesTerritoryHistoryMapperMock,
                                                    mock.DALMapperMockFactory.DALSalesTerritoryHistoryMapperMock);

            ApiSalesTerritoryResponseModel response = await service.Get(default(int));

            response.Should().NotBeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
Exemplo n.º 19
0
        public SalesTerritory GetSalesTerritoryBySalesTerritoryID(int SalesTerritoryID)
        {
            SalesTerritoryBO salesTerritoryBO = new SalesTerritoryBO();

            SalesTerritory salesTerritory = salesTerritoryBO.GetSalesTerritoryBySalesTerritoryID(SalesTerritoryID);

            return(salesTerritory);
        }
Exemplo n.º 20
0
        ///<summary>
        ///  Update the Typed SalesTerritory Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance(TransactionManager tm, SalesTerritory mock)
        {
            SalesTerritoryTest.UpdateMockInstance_Generated(tm, mock);

            // make any alterations necessary
            // (i.e. for DB check constraints, special test cases, etc.)
            SetSpecialTestData(mock);
        }
Exemplo n.º 21
0
        public ActionResult DeleteConfirmed(int id)
        {
            SalesTerritory salesTerritory = db.SalesTerritory.Find(id);

            db.SalesTerritory.Remove(salesTerritory);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 22
0
        public SalesTerritory SaveSalesTerritory(SalesTerritory salesTerritory)
        {
            SalesTerritoryBO salesTerritoryBO = new SalesTerritoryBO();

            salesTerritoryBO.SaveSalesTerritory(salesTerritory);

            return(salesTerritory);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Check the foreign key dal methods.
        /// </summary>
        private void Step_10_FK_Generated()
        {
            using (TransactionManager tm = CreateTransaction())
            {
                SalesTerritory entity = CreateMockInstance(tm);
                bool           result = DataRepository.SalesTerritoryProvider.Insert(tm, entity);

                Assert.IsTrue(result, "Could Not Test FK, Insert Failed");
            }
        }
Exemplo n.º 24
0
 public ActionResult Edit([Bind(Include = "TerritoryID,Name,CountryRegionCode,Group,SalesYTD,SalesLastYear,CostYTD,CostLastYear,rowguid,ModifiedDate")] SalesTerritory salesTerritory)
 {
     if (ModelState.IsValid)
     {
         db.Entry(salesTerritory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(salesTerritory));
 }
Exemplo n.º 25
0
        /// <summary>
        /// Test methods exposed by the EntityHelper class.
        /// </summary>
        private void Step_20_TestEntityHelper_Generated()
        {
            using (TransactionManager tm = CreateTransaction())
            {
                mock = CreateMockInstance(tm);

                SalesTerritory entity = mock.Copy() as SalesTerritory;
                entity = (SalesTerritory)mock.Clone();
                Assert.IsTrue(SalesTerritory.ValueEquals(entity, mock), "Clone is not working");
            }
        }
Exemplo n.º 26
0
 ///<summary>
 ///  Update the Typed SalesTerritory Entity with modified mock values.
 ///</summary>
 static public void UpdateMockInstance_Generated(TransactionManager tm, SalesTerritory mock)
 {
     mock.Name = TestUtility.Instance.RandomString(24, false);;
     mock.CountryRegionCode = TestUtility.Instance.RandomString(3, false);;
     mock.Group             = TestUtility.Instance.RandomString(24, false);;
     mock.SalesYtd          = TestUtility.Instance.RandomShort();
     mock.SalesLastYear     = TestUtility.Instance.RandomShort();
     mock.CostYtd           = TestUtility.Instance.RandomShort();
     mock.CostLastYear      = TestUtility.Instance.RandomShort();
     mock.ModifiedDate      = TestUtility.Instance.RandomDateTime();
 }
Exemplo n.º 27
0
        public IHttpActionResult GetSalesTerritory(int id)
        {
            SalesTerritory salesTerritory = db.SalesTerritories.Find(id);

            if (salesTerritory == null)
            {
                return(NotFound());
            }

            return(Ok(salesTerritory));
        }
Exemplo n.º 28
0
        ///<summary>
        ///  Returns a Typed SalesTerritory Entity with mock values.
        ///</summary>
        static public SalesTerritory CreateMockInstance(TransactionManager tm)
        {
            // get the default mock instance
            SalesTerritory mock = SalesTerritoryTest.CreateMockInstance_Generated(tm);

            // make any alterations necessary
            // (i.e. for DB check constraints, special test cases, etc.)
            SetSpecialTestData(mock);

            // return the modified object
            return(mock);
        }
        // PUT api/awbuildversion/5
        public void Put(SalesTerritory value)
        {
            var GetActionType = Request.Headers.Where(x => x.Key.Equals("ActionType")).FirstOrDefault();

            if (GetActionType.Key != null)
            {
                if (GetActionType.Value.ToList()[0].Equals("DELETE"))
                    adventureWorks_BC.SalesTerritoryDelete(value);
                if (GetActionType.Value.ToList()[0].Equals("UPDATE"))
                    adventureWorks_BC.SalesTerritoryUpdate(value);
            }
        }
Exemplo n.º 30
0
        public IHttpActionResult PostSalesTerritory(SalesTerritory salesTerritory)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.SalesTerritories.Add(salesTerritory);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = salesTerritory.TerritoryID }, salesTerritory));
        }
Exemplo n.º 31
0
        public async Task <IActionResult> Create([Bind("TerritoryId,Name,CountryRegionCode,Group,SalesYtd,SalesLastYear,CostYtd,CostLastYear,Rowguid,ModifiedDate")] SalesTerritory salesTerritory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(salesTerritory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CountryRegionCode"] = new SelectList(_context.CountryRegion, "CountryRegionCode", "CountryRegionCode", salesTerritory.CountryRegionCode);
            return(View(salesTerritory));
        }
Exemplo n.º 32
0
		private StateProvince GivenStateProvince(string code, string name, bool isOnlyStateProvince, CountryRegion country, SalesTerritory territory)
		{
			var state = new StateProvince
				{
					Code = code,
					Name = name,
					IsOnlyStateProvince = isOnlyStateProvince,
					SalesTerritory = territory,
					Country = country
				};

			Inject(state);

			return state;
		}
Exemplo n.º 33
0
 /// <summary>
 /// There are no comments for SalesTerritory in the schema.
 /// </summary>
 public void AddToSalesTerritory(SalesTerritory salesTerritory)
 {
     base.AddObject("SalesTerritory", salesTerritory);
 }
Exemplo n.º 34
0
 /// <summary>
 /// Create a new SalesTerritory object.
 /// </summary>
 /// <param name="territoryID">Initial value of TerritoryID.</param>
 /// <param name="name">Initial value of Name.</param>
 /// <param name="countryRegionCode">Initial value of CountryRegionCode.</param>
 /// <param name="group">Initial value of Group.</param>
 /// <param name="salesYTD">Initial value of SalesYTD.</param>
 /// <param name="salesLastYear">Initial value of SalesLastYear.</param>
 /// <param name="costYTD">Initial value of CostYTD.</param>
 /// <param name="costLastYear">Initial value of CostLastYear.</param>
 /// <param name="rowguid">Initial value of rowguid.</param>
 /// <param name="modifiedDate">Initial value of ModifiedDate.</param>
 public static SalesTerritory CreateSalesTerritory(int territoryID, string name, string countryRegionCode, string group, decimal salesYTD, decimal salesLastYear, decimal costYTD, decimal costLastYear, global::System.Guid rowguid, global::System.DateTime modifiedDate)
 {
     SalesTerritory salesTerritory = new SalesTerritory();
     salesTerritory.TerritoryID = territoryID;
     salesTerritory.Name = name;
     salesTerritory.CountryRegionCode = countryRegionCode;
     salesTerritory.Group = group;
     salesTerritory.SalesYTD = salesYTD;
     salesTerritory.SalesLastYear = salesLastYear;
     salesTerritory.CostYTD = costYTD;
     salesTerritory.CostLastYear = costLastYear;
     salesTerritory.rowguid = rowguid;
     salesTerritory.ModifiedDate = modifiedDate;
     return salesTerritory;
 }
 // POST api/awbuildversion
 public void Post(SalesTerritory value)
 {
     adventureWorks_BC.SalesTerritoryAdd(value);
 }