Esempio n. 1
0
        private bool NewWarehouseLocation(string itemID)
        {
            WarehouseLocation newItem = new WarehouseLocation();

            //all new records will be give a negative int autoid...
            //when they are updated then sql will generate one for them overiding this set value...
            //it will allow us to give uniqueness to the tempory new records...
            //Before they are updated to the entity and given an autoid...
            //we use a negative number and keep subtracting by 1 for each new item added...
            //This will allow it to alwasy be unique and never interfere with SQL's positive autoid...
            _newWarehouseLocationAutoId = _newWarehouseLocationAutoId - 1;
            newItem.AutoID = _newWarehouseLocationAutoId;
            newItem.WarehouseLocationID = itemID;
            newItem.CompanyID           = ClientSessionSingleton.Instance.CompanyID;
            newItem.IsValid             = 1;
            newItem.NotValidMessage     = "New Record Key Field/s Are Required.";
            WarehouseLocationList.Add(newItem);
            _serviceAgent.AddToWarehouseLocationRepository(newItem);
            SelectedWarehouseLocation = WarehouseLocationList.LastOrDefault();

            AllowEdit     = true;
            Dirty         = false;
            AllowKeyEntry = true;
            return(true);
        }